From: Petr Baudis Date: Sun, 03 Jul 2005 06:59:20 GMT Subject: Re: [PATCH] Cogito: Use git-rev-parse instead of cg-Xnormid. Message-ID: <20050703065920.GA11765@pasky.ji.cz> In-Reply-To: <42C77ECE.2080903@didntduck.org> Dear diary, on Sun, Jul 03, 2005 at 07:59:42AM CEST, I got a letter where Brian Gerst told me that... > Use git-rev-parse instead of cg-Xnormid. This allows Cogito to work > properly with packed objects. > > Signed off by: Brian Gerst But git-rev-parse sucks. It won't detect invalid IDs (--revs-only?), and does not support short object IDs (that's a must, it's tremendously useful). You need to add that for it to be useful first. > diff --git a/tree-id b/tree-id > --- a/tree-id > +++ b/tree-id > @@ -5,8 +5,8 @@ > # > # Takes ID of the appropriate commit, defaults to HEAD. > > -id="$1" > -normid=$(${COGITO_LIB}cg-Xnormid "$id") || exit 1 > +id="${1:-HEAD}" > +normid=$(git-rev-parse "$id") > type=$(git-cat-file -t "$normid") > > if [ "$type" = "commit" ]; then This is broken too. You need to be able to pass _tree_ ID to tree-id too, not just commit ID. Hmm, or is git-rev-parse able to process any ids? Then it's terribly misnamed too. :-) A comment would be useful in that case. (Or better a patch to rename it.) Thanks, -- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ be careful, some twit might quote you out of context..