git/list[1] front-page[2] threads[3] people[4] search[5] about
 

tracking branch on a tag

From
SBSimon Braunschmidt <sb@emlix.com>
Date
Apr 23, 2009, 09:52 UTC
Message-ID
<49F03A74.5080805@emlix.com>
Hi
So i set up a tracking branch on an annotated signed tag like:
$git branch --track foobranch v2.6.26
 >Branch foobranch set up to track local ref refs/tags/v2.6.26.
Check it out, get an error
$git checkout foobranch
 >Switched to branch 'foobranch'
 >error: Object 14650d6ec137e70b6c1918cdef235027c5156020 is a commit, 
not a tag
 >fatal: Invalid symmetric difference expression 
bce7f793daec3e65ec5c5705d2457b81fe7b5725...14650d6ec137e70b6c1918cdef235027c5156020
Inspect the relevant object
$git-cat-file -p bce7f793daec3e65ec5c5705d2457b81fe7b5725
 >tree 05bc81f9b27a1ab60ea4e506357f0c7f2ece4eda
 >parent ec229e830060091b9be63c8f873c1b2407a82821
 >author Linus Torvalds <torvalds@linux-foundation.org> 1215985889 -0700
 >committer Linus Torvalds <torvalds@linux-foundation.org> 1215985889 -0700
 >Linux 2.6.26
$git-cat-file -p 14650d6ec137e70b6c1918cdef235027c5156020
 >object bce7f793daec3e65ec5c5705d2457b81fe7b5725
 >type commit
 >tag v2.6.26
 >tagger Linus Torvalds <torvalds@linux-foundation.org> Sun Jul 13 
 >14:51:38 2008 -0700
 >
 >Linux 2.6.26
 >-----BEGIN PGP SIGNATURE-----
 >Version: GnuPG v1.4.9 (GNU/Linux)
 >
 >iEYEABECAAYFAkh6ePIACgkQF3YsRnbiHLuJcACgpHzd21qAY25V2VQWBCYPW8bB
 >Z8MAoJ9qfiwuRt27cdrmAU2aJq+YFrYs
 >=aHK8
 >-----END PGP SIGNATURE-----

I get this errors only on annotated/signed tags, not on lightweight tags. Admittedly it doesnt make much sense to track a tag, yet this error message makes even less sense:

error: Object 14650d6ec137e70b6c1918cdef235027c5156020 is a commit, not a tag

with 14650d being a tag.

Is this error message serious, as fatal sound quite harsh? Can it be avoided, by guiding the user on branch creation or by simply not showing it in this situation?

Gruessle Simon

Next: Michael J Gruber
Message 1 of 4 in “tracking branch on a tag”
  1. Simon BraunschmidtApr 23, 2009
  2. Fix behavior with non-committish upstream referencesMichael J Gruber, Apr 27, 2009
  3. Junio C HamanoApr 28, 2009
  4. Michael J GruberApr 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.