summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-09-20 14:36:18 -0400
committerWolfgang Denk <wd@denx.de>2010-09-21 21:33:16 +0200
commit16e66cf194f6d4c748f3c02689e6cd1aa4440c0e (patch)
tree1c94a5ac41898d21e8d144ca27bdbb9d857e7ab4 /tools
parent07517e7f4f582d1607adbc444bab75af3ac4a7f9 (diff)
downloadu-boot-16e66cf194f6d4c748f3c02689e6cd1aa4440c0e.tar.gz
u-boot-16e66cf194f6d4c748f3c02689e6cd1aa4440c0e.tar.xz
u-boot-16e66cf194f6d4c748f3c02689e6cd1aa4440c0e.zip
setlocalversion: add some more fallbacks for git describe
If working out of a custom git tree that lacks annotated tags, the 'git describe' operation spews "fatal: cannot describe" errors all over the place. So add some fallback code in case the best naming was unable to locate something useful. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/setlocalversion3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/setlocalversion b/tools/setlocalversion
index b3f5f2824b..e11f54f55a 100755
--- a/tools/setlocalversion
+++ b/tools/setlocalversion
@@ -13,7 +13,8 @@ if head=`git rev-parse --verify 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
- git describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+ (git describe || git describe --tags || git describe --all --long) \
+ 2>/dev/null | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
fi
# Are there uncommitted changes?