Re: Commit ID in exported Tar Ball

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On May 21, 2007, at 2:37 AM, Thomas Glanzmann wrote:

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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux