Revision 0c5e11f67ef050ccd28acec5dc47d0249ecd11e7 authored by Hans Schoenemann on 17 November 2016, 10:51:59 UTC, committed by Hans Schoenemann on 17 November 2016, 10:51:59 UTC
1 parent 063ba10
git-version-gen
#!/bin/bash
export GIT_WORK_TREE=`dirname "$0"`
export GIT_DIR="$GIT_WORK_TREE/.git"
## :'%h on %ci by %an: "%s"' --abbrev-commit | sed 's/\"/\\\"/g'
if [ -d "$GIT_WORK_TREE/.git" ] && v=`git log --pretty=format:'%h' --abbrev-commit -1 2>/dev/null` ;
then
if dirty=`sh -c "git diff-index --name-status HEAD 2>/dev/null | sed -e 's|^\([A-Z]\).*|\1|g' | tr -d '\012'"` && [ -n "$dirty" ];
then
echo -n "$v|$dirty"
else
echo -n "$v"
fi
# exit 0
else
F="$1"
if [ -r "$F" ];
then
cat "$F"
else
echo -n "UNKNOWN_GIT_VERSION"
fi
fi
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...