Subject: Re: Tags, Grafts, and Clones, oh my!

From: Ramkumar Ramachandra <[email-masked]>
Date: Fri, 20 Aug 2010 19:09:32 +0530

Hi Stephen,

Stephen Bash writes:
> Sure:
> 
> mkdir gitTagBug
> cd gitTagBug
> 
> git init foo
> cd foo
> echo A >> foo.txt
> git add foo.txt
> git commit -m "Created foo"
> GRAFT_PARENT=`git rev-parse master`
> echo B >> foo.txt
> git commit -am "Added B"
> cd ..
> 
> git init bar
> cd bar
> echo A >> foo.txt
> echo C >> foo.txt
> git add foo.txt
> git commit -m "Added C"
> GRAFT_CHILD=`git rev-parse master`
> git tag -am "Tagging foo C" tagFoo $GRAFT_CHILD
> cd ..
> 
> cd foo
> git fetch ../bar refs/tags/tagFoo:refs/tags/tagFoo
> echo "$GRAFT_CHILD $GRAFT_PARENT" >> .git/info/grafts
> git filter-branch --tag-name-filter cat tagFoo
> cd ..
> 
> # Purposely use a file URL to prune any unreferenced objects
> git clone file:///`pwd`/foo newFoo
> 
> My output from the clone:
> 
>    Cloning into newFoo...
>    remote: Counting objects: 9, done.
>    remote: Compressing objects: 100% (3/3), done.
>    remote: Total 9 (delta 0), reused 0 (delta 0)
>    Receiving objects: 100% (9/9), done.
>    error: refs/tags/tagFoo does not point to a valid object!

Thanks for the testcase! Offhand, it definitely looks like a bug. I'm
investigating to figure out which part of the chain is at fault.

-- Ram