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

Re: Cogito: cg-clone doesn't like packed tag objects

From
Linus Torvalds <torvalds@osdl.org>
Date
Sep 27, 2005, 18:04 UTC
Message-ID
<Pine.LNX.4.58.0509271058110.3308@g5.osdl.org>
In-Reply-To
<20050927173445.GC23034@mythryan2.michonline.com>
On Tue, 27 Sep 2005, Ryan Anderson wrote:
Show 9 quoted lines
> 
> $ cat .git/refs/tags/v2.6.13-rc4
> 7eab951de91d95875ba34ec4c599f37e1208db93
> $ git-rev-parse v2.6.13-rc4
> 7eab951de91d95875ba34ec4c599f37e1208db93
> $ git-rev-parse v2.6.13-rc4^0
> 63953523341bcafe5928bf6e99bffd7db94b471e
> $ git-rev-parse 63953523341bcafe5928bf6e99bffd7db94b471e^0
> 63953523341bcafe5928bf6e99bffd7db94b471e

The point being that if you want to test whether you have the thing the tag _points_ to, you should verify it.

And that's where the "--verify" flag comes in:
	[torvalds@g5 linux]$ git-rev-parse v2.6.11^0 ; echo $?
	error: Object 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c is a tree, not a commit
	v2.6.11^0
	0

and if the object the tag points to didn't exist at _all_ in your object store, you'd have silently gotten

	[torvalds@g5 linux]$ git-rev-parse v2.6.11^0 ; echo $?
        v2.6.11^0
        0
but if you used "--verify", you'd have at least gotten
	[torvalds@g5 linux]$ git-rev-parse --verify v2.6.11^0 ; echo $?
	fatal: Needed a single revision
	1
which is what you want, I thought.
		Linus
Previous: Ryan AndersonNext: Junio C Hamano
Message 39 of 41 in “Cogito: cg-clone doesn't like packed tag objects”
  1. H. Peter AnvinSep 23, 2005
  2. Petr BaudisSep 24, 2005
  3. H. Peter AnvinSep 24, 2005
  4. Junio C HamanoSep 24, 2005
  5. Petr BaudisSep 24, 2005
  6. Daniel BarkalowSep 24, 2005
  7. Junio C HamanoSep 24, 2005
  8. Petr BaudisNov 9, 2005
  9. Junio C HamanoNov 9, 2005
  10. Nick HengeveldNov 9, 2005
  11. Petr BaudisNov 9, 2005
  12. Nick HengeveldNov 10, 2005
  13. Junio C HamanoNov 9, 2005
  14. Petr BaudisSep 26, 2005
  15. Brian GerstSep 26, 2005
  16. Petr BaudisSep 26, 2005
  17. Junio C HamanoSep 26, 2005
  18. Petr BaudisSep 26, 2005
  19. Junio C HamanoSep 27, 2005
  20. Tom PrinceSep 27, 2005
  21. Junio C HamanoSep 27, 2005
  22. Junio C HamanoSep 26, 2005
  23. Petr BaudisSep 27, 2005
  24. Josef WeidendorferSep 27, 2005
  25. Petr BaudisSep 27, 2005
  26. Josef WeidendorferSep 27, 2005
  27. Junio C HamanoSep 27, 2005
  28. Linus TorvaldsSep 27, 2005
  29. Junio C HamanoSep 27, 2005
  30. Linus TorvaldsSep 27, 2005
  31. Linus TorvaldsSep 27, 2005
  32. Junio C HamanoSep 27, 2005
  33. Junio C HamanoSep 28, 2005
  34. Peeling the onionJunio C Hamano, Oct 14, 2005
  35. Sven VerdoolaegeSep 27, 2005
  36. Ryan AndersonSep 27, 2005
  37. Linus TorvaldsSep 27, 2005
  38. Ryan AndersonSep 27, 2005
  39. Linus TorvaldsSep 27, 2005
  40. Junio C HamanoSep 27, 2005
  41. Junio C HamanoOct 14, 2005

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.