aboutsummaryrefslogtreecommitdiff
path: root/scripts/setlocalversion
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-10-31 16:18:02 +0900
committerPaul Mundt <lethal@linux-sh.org>2008-10-31 16:18:02 +0900
commit0803d540db06f53acd2fabf1347d5b665218f14a (patch)
treef5f8e5510a76bb59d3583478961daf5afc32df08 /scripts/setlocalversion
parenta8884e3415c29c58a5875d54c109c4a7fcaa6fb4 (diff)
parent721d5dfe7e516954c501d5e9d0dfab379cf4241a (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
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