git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Make GIT-VERSION-GEN tolerate missing git describe command again

From
UZUwe Zeisberger <uwe_zeisberger@digi.com>
Date
Jan 26, 2006, 16:39 UTC
Message-ID
<1138293567831-git-send-email-Uwe_Zeisberger@digi.com>
In-Reply-To
<20060126134521.GA11570@informatik.uni-freiburg.de>

Commit 5c7d3c95 broke that by making the git-describe command part of a pipe.

Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
---
 GIT-VERSION-GEN |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
b5763601050151e944cb58b3b0fe6f4aee88b47f
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index e3cd9fa..72201be 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -5,9 +5,11 @@ DEF_VER=v1.1.GIT
 
 # First try git-describe, then see if there is a version file
 # (included in release tarballs), then default
-VN=$(git-describe --abbrev=4 HEAD 2>/dev/null | sed -e 's/-/./g') ||
-VN=$(cat version) ||
-VN="$DEF_VER"
+if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then
+	VN=$(echo "$VN" | sed -e 's/-/./g');
+else
+	VN=$(cat version) || VN="$DEF_VER"
+fi
 
 VN=$(expr "$VN" : v*'\(.*\)')
 
-- 
1.1.4-g9acfd
Previous: Uwe Zeisberger
Message 2 of 2 in “5c7d3c95 broke 026351a”
  1. Uwe ZeisbergerJan 26, 2006
  2. Make GIT-VERSION-GEN tolerate missing git describe command againUwe Zeisberger, Jan 26, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.