Skip to content

Instantly share code, notes, and snippets.

@jaimegago
Created October 15, 2012 22:38
Show Gist options
  • Save jaimegago/3896119 to your computer and use it in GitHub Desktop.
Save jaimegago/3896119 to your computer and use it in GitHub Desktop.
one liner we use for release rpm tag
git log -1 --pretty=format:"%ad %h" --date=short|sed s/'[[:space:]]'/."$(git log --oneline|wc -l)"git/|sed s/-//g
YYYYMMDD.$NUMBER_OF_COMMITS.git$COMMIT_HASH_SHORT
example output: 20121015.722git48b7147
We use this to package our JAVA based snapshot as an extension of http://fedoraproject.org/wiki/Packaging:NamingGuidelines#Snapshot_packages .
Adding the number of commits before the "git" allows proper ordering of packages in yum database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment