git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] cg-fetch: handle tags with funny chars, retrieve missing commits
@ 2005-10-20  4:45 Martin Langhoff
  2005-10-20  5:05 ` Martin Langhoff
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Langhoff @ 2005-10-20  4:45 UTC (permalink / raw
  To: git; +Cc: Martin Langhoff

 + handles tags with funny chars a bit better
 + will check tagrefs, trying to ensure it actually has the relevant
   commits. If the commits are missing, it'll go out and fetch them.

This isn't a complete solution for cg-fetch -- git-fetch is actually
much smarter now, and cg-fetch should perhaps be a thin wrapper
around it, dropping all the duplicate code.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>


---

 cg-fetch |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

applies-to: 38ed7981343a8e2bb734d64e019186a8a482dbef
21a91d74a6807677f8e59c737fee3692d0f392e8
diff --git a/cg-fetch b/cg-fetch
index 7694584..625444c 100755
--- a/cg-fetch
+++ b/cg-fetch
@@ -416,8 +416,9 @@ $get -i -s -u -d "$uri/refs/tags" "$_git
 	cd $_git/refs/tags
 	for tag in *; do
 		[ "$tag" = "*" ] && break
-		tagid=$(cat $tag)
-		GIT_DIR=../.. git-cat-file -t "$tagid" >/dev/null 2>&1 && continue
+		tagid=$(cat "$tag")
+		GIT_DIR=../.. git-cat-file commit `git-rev-parse --verify "$tag"^{commit} 2>/dev/null` 2>/dev/null >> /dev/null && continue
+		GIT_DIR=../.. git-cat-file blob `git-rev-parse --verify "$tag"^{blob} 2>/dev/null` 2>/dev/null >> /dev/null && continue
 		echo -n "Missing object of tag $tag... "
 		if [ "$fetch" != "fetch_rsync" ] && GIT_DIR=../.. $fetch "$tagid" "$uri" 2>/dev/null >&2; then
 			echo "retrieved"
---
0.99.8.GIT

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] cg-fetch: handle tags with funny chars, retrieve missing commits
  2005-10-20  4:45 Martin Langhoff
@ 2005-10-20  5:05 ` Martin Langhoff
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Langhoff @ 2005-10-20  5:05 UTC (permalink / raw
  To: Git Mailing List, Petr Baudis

Pulled, superceded by new version.

On 10/20/05, Martin Langhoff <martin@catalyst.net.nz> wrote:
>  + handles tags with funny chars a bit better
>  + will check tagrefs, trying to ensure it actually has the relevant
>    commits. If the commits are missing, it'll go out and fetch them.
>
> This isn't a complete solution for cg-fetch -- git-fetch is actually
> much smarter now, and cg-fetch should perhaps be a thin wrapper
> around it, dropping all the duplicate code.
>
> Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] cg-fetch: handle tags with funny chars, retrieve missing commits
@ 2005-10-20  5:07 Martin Langhoff
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Langhoff @ 2005-10-20  5:07 UTC (permalink / raw
  To: git; +Cc: Martin Langhoff

 + handles tags with funny chars a bit better
 + will check tagrefs, trying to ensure it actually has the relevant
   commits. If the commits are missing, it'll go out and fetch them.
 + if the tagref points to a blob and we have it, it'll skip it

This isn't a complete solution for cg-fetch -- git-fetch is actually
much smarter now, and cg-fetch should perhaps be a thin wrapper
around it, dropping all the duplicate code.

This version uses ^0 instead of ^{commit} which does a more thorough check,
so we don't need to call git-cat-file.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>


---

 cg-fetch |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

applies-to: 38ed7981343a8e2bb734d64e019186a8a482dbef
6adda5a9a938adbc313c6ed40156257d62707757
diff --git a/cg-fetch b/cg-fetch
index 7694584..ec9fff3 100755
--- a/cg-fetch
+++ b/cg-fetch
@@ -416,8 +416,9 @@ $get -i -s -u -d "$uri/refs/tags" "$_git
 	cd $_git/refs/tags
 	for tag in *; do
 		[ "$tag" = "*" ] && break
-		tagid=$(cat $tag)
-		GIT_DIR=../.. git-cat-file -t "$tagid" >/dev/null 2>&1 && continue
+		tagid=$(cat "$tag")
+		GIT_DIR=../.. git-rev-parse --verify "$tag"^0 2>/dev/null >> /dev/null && continue
+		GIT_DIR=../.. git-cat-file blob `git-rev-parse --verify "$tag"^{blob} 2>/dev/null` 2>/dev/null >> /dev/null && continue
 		echo -n "Missing object of tag $tag... "
 		if [ "$fetch" != "fetch_rsync" ] && GIT_DIR=../.. $fetch "$tagid" "$uri" 2>/dev/null >&2; then
 			echo "retrieved"
---
0.99.8.GIT

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] cg-fetch: handle tags with funny chars, retrieve missing commits
@ 2005-10-24 20:49 Martin Langhoff
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Langhoff @ 2005-10-24 20:49 UTC (permalink / raw
  To: git; +Cc: Martin Langhoff

 + handles tags with funny chars a bit better
 + will check tagrefs, trying to ensure it actually has the relevant
   commits. If the commits are missing, it'll go out and fetch them.
 + if the tagref points to a blob and we have it, it'll skip it

This isn't a complete solution for cg-fetch -- git-fetch is actually
much smarter now, and cg-fetch should perhaps be a thin wrapper
around it, dropping all the duplicate code.

This version uses ^0 instead of ^{commit} which does a more thorough check,
so we don't need to call git-cat-file.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>

---

Resend: added signoff as requested.

---

 cg-fetch |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

applies-to: e6fab694ece986de77f6e17c16df9f17276c6666
e2cf1ab9b594d3d12655dd93377dfea03247379e
diff --git a/cg-fetch b/cg-fetch
index b004ab3..f0c11aa 100755
--- a/cg-fetch
+++ b/cg-fetch
@@ -377,7 +377,8 @@ $get -i -s -u -d "$uri/refs/tags" "$_git
 	for tag in *; do
 		[ "$tag" = "*" ] && break
 		tagid="$(cat "$tag")"
-		GIT_DIR=../.. git-cat-file -t "$tagid" >/dev/null 2>&1 && continue
+		GIT_DIR=../.. git-rev-parse --verify "$tag"^0 2>/dev/null >> /dev/null && continue
+		GIT_DIR=../.. git-cat-file blob `git-rev-parse --verify "$tag"^{blob} 2>/dev/null` 2>/dev/null >> /dev/null && continue
 		echo -n "Missing object of tag $tag... "
 		if [ "$fetch" != "fetch_rsync" ] && GIT_DIR=../.. $fetch "$tagid" "$uri" 2>/dev/null >&2; then
 			echo "retrieved"
---
0.99.8.GIT

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-24 20:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-24 20:49 [PATCH] cg-fetch: handle tags with funny chars, retrieve missing commits Martin Langhoff
  -- strict thread matches above, loose matches on Subject: below --
2005-10-20  5:07 Martin Langhoff
2005-10-20  4:45 Martin Langhoff
2005-10-20  5:05 ` Martin Langhoff

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).