diff options
author | Sebastian Siewior <lkml@ml.breakpoint.cc> | 2008-07-01 18:18:08 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2008-07-25 16:12:53 -0400 |
commit | 56b2f0706d82535fd8d85503f2dcc0be40c8e55d (patch) | |
tree | d9c4aa91569291eebf119e953abb9b3452e36943 | |
parent | 12d2b8f951063076c7e0acdff7ae1fecd54920a0 (diff) |
setlocalversion: do not describe if there is nothing to describe
Jan Engelhardt wrote:
> Just a note that when you run git-describe, you should probably quiten it.
>
> fatal: cannot describe 'bd7364a0fd5a4a2878fe4a224be1b142a4e6698e'
>
> This happens when tags are not present, which can happen if Linus's tree
> is sent upwards again, IOW:
>
> machine1$ git-clone torvalds/linux-2.6.git
> machine1$ git push elsewhere master
>
> machine2$ git-clone elsewhere:/linux
> machine2$ git-describe HEAD
> fatal: cannot describe that
Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
Acked-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rwxr-xr-x | scripts/setlocalversion | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 1c1bdaf7348a..83b75126c9f7 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -12,7 +12,9 @@ cd "${1:-.}" || usage | |||
12 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then | 12 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then |
13 | # Do we have an untagged version? | 13 | # Do we have an untagged version? |
14 | if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then | 14 | if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then |
15 | git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' | 15 | if tag=`git describe 2>/dev/null`; then |
16 | echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' | ||
17 | fi | ||
16 | fi | 18 | fi |
17 | 19 | ||
18 | # Are there uncommitted changes? | 20 | # Are there uncommitted changes? |