nix-prefetch-git: print commit date (close #6522)

The commit date can be used as a version number in packages that don't
have proper releases.
This commit is contained in:
Bjørn Forsman 2015-02-22 20:05:57 +01:00 committed by Vladimír Čunát
parent 030eed8307
commit 06f5651ef5

View file

@ -254,6 +254,7 @@ clone_user_rev() {
local full_revision=$(cd $dir && (git rev-parse $rev 2> /dev/null || git rev-parse refs/heads/fetchgit) | tail -n1)
echo "git revision is $full_revision"
echo "git human-readable version is $(cd $dir && (git describe $full_revision 2> /dev/null || git describe --tags $full_revision 2> /dev/null || echo -- none --))" >&2
echo "Commit date is $(cd $dir && git show --no-patch --pretty=%ci $full_revision)"
# Allow doing additional processing before .git removal
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK"