Re: Cogito: cg-clone doesn't like packed tag objects
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Sep 27, 2005, 15:34 UTC
- Message-ID
- <Pine.LNX.4.58.0509270821590.3308@g5.osdl.org>
- In-Reply-To
- <4338F3F6.8040401@michonline.com>
On Tue, 27 Sep 2005, Ryan Anderson wrote:
> > git-rev-parse $tagname^0
You need "--verify". Otherwise git-rev-parse will think that you just have a strange filename or other random thing:
prompt$ git-rev-parse 000^0 000^0
prompt$ git-rev-parse --verify 000^0 fatal: Needed a single revision
Now, if the tag doesn't point to a commit, then the "^0" thing will fail. What you could use instead is
git-rev-list --max-count=1 "$tag"
since git-rev-list will actually follow the tag. Of course, whether it does so correctly or not if the tagged object doesn't exist, I dunno. Testing needed.
Finally, you might just do it by hand
type=$(git-cat-file -t "$obj") || exit if [ "$type" == "$tag" ]; then tagged=$(git-cat-file tag "$obj" | sed 's/object // ; q') git-rev-parse --verify "$tagged" fi
untested, of course.
Linus