aboutsummaryrefslogtreecommitdiff
path: root/scripts/setlocalversion
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-03 09:11:13 +0100
committerIngo Molnar <mingo@elte.hu>2008-11-03 09:11:13 +0100
commit36609469c8278554b046aa4cc9a5fa9ccea35306 (patch)
treef59185b71c8059941de79143f71178453599b8f1 /scripts/setlocalversion
parentb3acf29afda06c76774dc6df6246c37ae707836b (diff)
parent45beca08dd8b6d6a65c5ffd730af2eac7a2c7a03 (diff)
Merge commit 'v2.6.28-rc3' into tracing/ftrace
Diffstat (limited to 'scripts/setlocalversion')
-rwxr-xr-xscripts/setlocalversion6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 83b75126c9f..72d233528ad 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