spielwiese
Last change
on this file since 6af0619 was
6af0619,
checked in by Oleksandr Motsak <motsak@…>, 10 years ago
|
Fixed return status for git-version-gen
|
-
Property mode set to
100755
|
File size:
505 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | GIT_WORK_TREE=`dirname "$0"` |
---|
4 | ## :'%h on %ci by %an: "%s"' --abbrev-commit | sed 's/\"/\\\"/g' |
---|
5 | if [ -d "$GIT_WORK_TREE/.git" ] && v=`git log --pretty=format:'%h' --abbrev-commit -1 2>/dev/null` |
---|
6 | then |
---|
7 | 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" ] |
---|
8 | then |
---|
9 | echo -n "$v|$dirty" |
---|
10 | else |
---|
11 | echo -n "$v" |
---|
12 | fi |
---|
13 | # exit 0 |
---|
14 | else |
---|
15 | F="$1" |
---|
16 | if [ -r "$F" ]; |
---|
17 | then |
---|
18 | cat "$F" |
---|
19 | else |
---|
20 | echo -n "UNKNOWN_GIT_VERSION" |
---|
21 | fi |
---|
22 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.