mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
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>
This commit is contained in:
parent
07517e7f4f
commit
16e66cf194
1 changed files with 2 additions and 1 deletions
|
@ -13,7 +13,8 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
|
||||||
# Do we have an untagged version?
|
# Do we have an untagged version?
|
||||||
if git name-rev --tags HEAD | \
|
if git name-rev --tags HEAD | \
|
||||||
grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
|
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
|
fi
|
||||||
|
|
||||||
# Are there uncommitted changes?
|
# Are there uncommitted changes?
|
||||||
|
|
Loading…
Add table
Reference in a new issue