Ticket #537 (closed bug: fixed)
svnversion fails to determine revision of git repos for revison.cpp
| Reported by: | insaneinside | Owned by: | insaneinside |
|---|---|---|---|
| Priority: | trivial | Milestone: | Infrastructure Improvements |
| Component: | build and packaging | Version: | |
| Keywords: | Makefile.am git svn svnversion configure.ac | Cc: |
Description
We currently use svnversion to determine the source revision to place in revision.cpp. Unfortunately, this doesn't work with git!
If the repository is at a tagged commit, the following shell command will fetch the tag name:
git-log -1 | sed -e '1!D;s/commit\x20//' | git-name-rev --stdin --tags | sed -e 's/.*(tags\/\(.*\))/\1/'
If there's a more direct way, I'm all for pointless efficiency tweaks. :)
BrainDamage says that for a repo that's on a commit more recent than the latest tag, the above will output the commit hash. Commit hashes aren't very pretty -- it'd be nice if we could get something like 0.0.1.10263+3 for the third commit after 0.0.1.10263.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
