From: Martin Langhoff <martin@catalyst.net.nz>
To: git@vger.kernel.org
Cc: Martin Langhoff <martin@catalyst.net.nz>
Subject: [PATCH] cg-fetch: handle tags with funny chars, retrieve missing commits
Date: Tue, 25 Oct 2005 09:49:23 +1300 [thread overview]
Message-ID: <1130186963916-git-send-email-martin@catalyst.net.nz> (raw)
In-Reply-To:
+ 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
next reply other threads:[~2005-10-24 20:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-24 20:49 Martin Langhoff [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-10-20 5:07 [PATCH] cg-fetch: handle tags with funny chars, retrieve missing commits Martin Langhoff
2005-10-20 4:45 Martin Langhoff
2005-10-20 5:05 ` Martin Langhoff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1130186963916-git-send-email-martin@catalyst.net.nz \
--to=martin@catalyst.net.nz \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).