diff options
| author | Ben Dooks <ben-linux@fluff.org> | 2008-11-03 14:49:01 +0000 |
|---|---|---|
| committer | Ben Dooks <ben-linux@fluff.org> | 2008-11-03 14:49:01 +0000 |
| commit | e856359685143a2f65876e7db4e4aa0ef5dce7f0 (patch) | |
| tree | bbcafe7f23975979f7a2bc6fd1404908d5fd7bd1 /scripts/setlocalversion | |
| parent | e3bd9ec5d8bfc90f9e1bd995677829e57a404061 (diff) | |
| parent | 45beca08dd8b6d6a65c5ffd730af2eac7a2c7a03 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into s3c-moves2
Diffstat (limited to 'scripts/setlocalversion')
| -rwxr-xr-x | scripts/setlocalversion | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 83b75126c9f7..72d233528ade 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -9,11 +9,13 @@ usage() { cd "${1:-.}" || usage # Check for git and a git repo. -if head=`git rev-parse --verify HEAD 2>/dev/null`; then +if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then # Do we have an untagged version? if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then if tag=`git describe 2>/dev/null`; then echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' + else + printf '%s%s' -g $head fi fi @@ -55,7 +57,7 @@ if rev=`svn info 2>/dev/null | grep '^Revision'`; then # Are there uncommitted changes? if [ $changes != 0 ]; then - printf -- '-svn%s%s%s' "$rev" -dirty "$changes" + printf -- '-svn%s%s' "$rev" -dirty else printf -- '-svn%s' "$rev" fi |
