All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] setlocalversion: add some more fallbacks for git describe
@ 2010-09-20 18:36 Mike Frysinger
  2010-09-21 19:33 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2010-09-20 18:36 UTC (permalink / raw)
  To: u-boot

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>
---
 tools/setlocalversion |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/setlocalversion b/tools/setlocalversion
index b3f5f28..e11f54f 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?
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] setlocalversion: add some more fallbacks for git describe
  2010-09-20 18:36 [U-Boot] [PATCH] setlocalversion: add some more fallbacks for git describe Mike Frysinger
@ 2010-09-21 19:33 ` Wolfgang Denk
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2010-09-21 19:33 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <1285007778-22418-1-git-send-email-vapier@gentoo.org> you wrote:
> 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>
> ---
>  tools/setlocalversion |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Who alone has reason to *lie  himself  out*  of  actuality?  He  who
*suffers* from it."                             - Friedrich Nietzsche

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-21 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-20 18:36 [U-Boot] [PATCH] setlocalversion: add some more fallbacks for git describe Mike Frysinger
2010-09-21 19:33 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.