Up: building   [Index]


B.1 Package revision in the banner

When running vicare in a terminal, it prints a banner showing the revision number:

$ vicare
Vicare Scheme version 0.1d0+ \
  (revision master/21da24720f161708372756e1324c230bd5ff6ac9, \
   build 2010-05-01)
Copyright (c) 2006-2010 Abdulaziz Ghuloum

The revision specification shows the branch name and the commit hash; they are read from the file ./scheme/last-revision, which is generated by the following chunk of code in the .git/hooks/post-commit script:

LAST_REVISION_FILE=./scheme/last-revision
BRANCH_NAME=$(git branch 2>/dev/null | \
                sed -e '/^[^*]/d' -e 's/^* //')
COMMIT_HASH=$(git show | head -1 | cut -d' ' -f2)
echo "$BRANCH_NAME/$COMMIT_HASH" >$LAST_REVISION_FILE