Skip to content

Commit 56b2f07

Browse files
Sebastian Siewiorsravnborg
authored andcommitted
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 <[email protected]> Acked-by: Jan Engelhardt <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
1 parent 12d2b8f commit 56b2f07

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/setlocalversion

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ cd "${1:-.}" || usage
1212
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
1313
# Do we have an untagged version?
1414
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
1618
fi
1719

1820
# Are there uncommitted changes?

0 commit comments

Comments
 (0)