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