All of lore.kernel.org
 help / color / mirror / Atom feed
* git subtree issue in more recent versions
@ 2014-04-29  0:50 Kevin Cagle (kcagle) [CONT - Type 2]
  2014-04-29 18:22 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Cagle (kcagle) [CONT - Type 2] @ 2014-04-29  0:50 UTC (permalink / raw)
  To: git@vger.kernel.org

Hi,

I've discovered a bug in git subtree related to annotated tags. The command 'git subtree' will fail if you use an annotated tag as the <refspec>. e.g.:

$ git subtree add -P oldGit https://github.com/git/git.git tags/v1.9.2

Will produce this error:

10ff115f5c572299de4e04ade0d7adb3c75fbf1f is not a valid 'commit' object

The bug isn't found in 1.7.1 (installed subtree manually) but is found in 1.9.0 and 2.0.0.rc1. 

It's related to the git fetch putting the "wrong" SHA1 in .git/FETCH_HEAD. Thus, if you do:

$ git ls-remote https://github.com/git/git.git | grep v1.9.2

You'll see this:
10ff115f5c572299de4e04ade0d7adb3c75fbf1f        refs/tags/v1.9.2
0bc85abb7aa9b24b093253018801a0fb43d01122        refs/tags/v1.9.2^{}

An older version will put the 0bc85a in FETCH_HEAD but newer versions will put 10ff11 which will not work. I'm new to Git so I don't know when/why that was changed but somewhere along the way, that change broke git subtree add. :( A workaround is to use lightweight tags but that's not suitable for some. 

Thanks,
Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-29 18:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29  0:50 git subtree issue in more recent versions Kevin Cagle (kcagle) [CONT - Type 2]
2014-04-29 18:22 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.