Re: [PATCH] cg-fetch will now retrieve commits related to tags if missing.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Oct 20, 2005, 01:25 UTC
- Message-ID
- <7voe5lvv1q.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <1129769745158-git-send-email-martin@catalyst.net.nz>
Martin Langhoff <martin@catalyst.net.nz> writes:
Show 8 quoted lines
> diff --git a/cg-fetch b/cg-fetch > index 7694584..d4650e5 100755 > --- a/cg-fetch > +++ b/cg-fetch > @@ -417,7 +417,8 @@ $get -i -s -u -d "$uri/refs/tags" "$_git > for tag in *; do > [ "$tag" = "*" ] && break > tagid=$(cat $tag)
You just reported this $tag needs quoting ;-).
> + GIT_DIR=../.. [ "`git-cat-file -t $tagid 2>/dev/null`" = "commit" ] && continue
> + GIT_DIR=../.. git-cat-file commit `git-rev-parse $tag^{commit} 2>/dev/null` 2>&1 >> /dev/null && continueYou are saying:
if "$tagid" is already commit then continue;
if "$tagid" dereferences to a commit and if you have it
then continueIf that is the case, then this might be more efficient.
GIT_DIR=../.. git-rev-parse --verify "$tagid^0" >/dev/null 2>&1 && continue
You can say ^{commit} instead of ^0 if you like that newer style, of course.