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

Re: Commit ID in exported Tar Ball

From
Brian Gernhardt <benji@silverinsanity.com>
Date
May 21, 2007, 06:56 UTC
Message-ID
<74FC1AD6-199E-4A01-BB9F-AD030659AE29@silverinsanity.com>
In-Reply-To
<20070521063752.GB23350@cip.informatik.uni-erlangen.de>
On May 21, 2007, at 2:37 AM, Thomas Glanzmann wrote:
Show 5 quoted lines
> so maybe it isn't that useless as I thought it initial is. But my  
> point
> still stands. I want the commit id of the HEAD in a _file within_ the
> tarball and I definitively don't want to tag my project before I get a
> unique identifier.

If you haven't tagged anything, then git can't give you anything better than the SHA-1. Giving a reference relative to a branch isn't useful, as the branch can change. If the branch doesn't change, it's really a tag and you should mark it as such.

Hopefully the patch for the "in a file" flag for git-archive will go in soon (or something like it). I don't think we should make it any more complex than just the hash, myself. If you want something more complex a Makefile rule like

dist:
	git archive HEAD > dist.tar
	git describe HEAD > version-file
	tar rf dist.tar version-file
	gzip dist.tar

should do the trick. (And you can replace "git describe" with "git parse-rev" for a bare hash if you'd like.)

~~ Brian
Previous: Thomas GlanzmannNext: Thomas Glanzmann
Message 33 of 38 in “Commit ID in exported Tar Ball”
  1. Thomas GlanzmannMay 17, 2007
  2. Johan HerlandMay 17, 2007
  3. Frank LichtenheldMay 17, 2007
  4. Thomas GlanzmannMay 17, 2007
  5. Johan HerlandMay 17, 2007
  6. git-archive: convert archive entries like checkouts doRené Scharfe, May 18, 2007
  7. Daniel BarkalowMay 18, 2007
  8. René ScharfeMay 18, 2007
  9. René ScharfeMay 19, 2007
  10. Junio C HamanoMay 19, 2007
  11. A Large Angry SCMMay 19, 2007
  12. René ScharfeMay 20, 2007
  13. René ScharfeMay 20, 2007
  14. Shawn O. PearceMay 20, 2007
  15. René ScharfeMay 20, 2007
  16. Shawn O. PearceMay 21, 2007
  17. Petr BaudisMay 21, 2007
  18. René ScharfeMay 21, 2007
  19. René ScharfeMay 22, 2007
  20. Junio C HamanoMay 22, 2007
  21. René ScharfeMay 22, 2007
  22. Shawn O. PearceMay 23, 2007
  23. René ScharfeMay 20, 2007
  24. Thomas GlanzmannMay 20, 2007
  25. Brian GernhardtMay 20, 2007
  26. Thomas GlanzmannMay 20, 2007
  27. Peter BaumannMay 21, 2007
  28. Thomas GlanzmannMay 21, 2007
  29. Shawn O. PearceMay 21, 2007
  30. Thomas GlanzmannMay 21, 2007
  31. Shawn O. PearceMay 21, 2007
  32. Thomas GlanzmannMay 21, 2007
  33. Brian GernhardtMay 21, 2007
  34. Thomas GlanzmannMay 21, 2007
  35. Frank LichtenheldMay 17, 2007
  36. Johan HerlandMay 17, 2007
  37. Kristian HøgsbergMay 17, 2007
  38. Thomas GlanzmannMay 17, 2007

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.