Skip to content

Commit

Permalink
GIT-VERSION-GEN: detect dirty tree and mark the version accordingly.
Browse files Browse the repository at this point in the history
If we are building from a working tree with local modifications,
mark the version accordingly.

Deliberately uses '-' to prevent RPM from being built from such
a tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jan 10, 2006
1 parent 181129d commit eb858c6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions GIT-VERSION-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ VN=$(cat version) ||
VN="$DEF_VER"

VN=$(expr "$VN" : v*'\(.*\)')

dirty=$(sh -c 'git-diff-index --name-only HEAD' 2>/dev/null) || dirty=
case "$dirty" in
'')
;;
*)
VN="$VN-dirty" ;;
esac

if test -r $GVF
then
VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
Expand Down

0 comments on commit eb858c6

Please sign in to comment.