diff options
| author | 2010-04-11 17:11:08 +0200 | |
|---|---|---|
| committer | 2010-04-11 17:18:50 +0200 | |
| commit | 3066c08a0db54729af639e128b4e9fe4fdc8c008 (patch) | |
| tree | d1917b1b8ea7783bf4b566129088bab2258ef3cc /Modules/describe.sh | |
| parent | 34524ac4e8075f0fc330759fd42b4d4873f27019 (diff) | |
| download | usbmuxd-3066c08a0db54729af639e128b4e9fe4fdc8c008.tar.gz usbmuxd-3066c08a0db54729af639e128b4e9fe4fdc8c008.tar.bz2 | |
Add automatic git versioning and tag for archives
Diffstat (limited to 'Modules/describe.sh')
| -rwxr-xr-x | Modules/describe.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/describe.sh b/Modules/describe.sh new file mode 100755 index 0000000..91730b8 --- /dev/null +++ b/Modules/describe.sh | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # Check for git and a git repo. | ||
| 4 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then | ||
| 5 | echo -n `git describe` | ||
| 6 | |||
| 7 | # Are there uncommitted changes? | ||
| 8 | git update-index --refresh --unmerged > /dev/null | ||
| 9 | git diff-index --quiet HEAD || echo -n -dirty | ||
| 10 | else | ||
| 11 | # Check for version tag | ||
| 12 | if [ -e version.tag ]; then | ||
| 13 | echo -n `cat version.tag` | ||
| 14 | fi | ||
| 15 | fi | ||
| 16 | |||
| 17 | echo | ||
