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

[PATCH] do not cat version file if it does not exist

From
AWAmos Waterland <apw@us.ibm.com>
Date
Feb 3, 2006, 10:11 UTC
Message-ID
<20060203101152.GA11233@kvasir.watson.ibm.com>
The build process currently produces this ugly message:
 $ make
 cat: version: No such file or directory
 GIT_VERSION = 1.1.GIT
 cat: version: No such file or directory

This patch make GIT-VERSION-GEN check that a file named `version' exists before trying to cat it.

Signed-off-by: Amos Waterland <apw@us.ibm.com>
---
 GIT-VERSION-GEN |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

applies-to: 2b022b9b34b375afff456e7527a3d89a56ce8abf eff0a8f6c905b3112538f30fb5a9ce09d4e18e72

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 72201be..fbaa397 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -7,8 +7,10 @@ DEF_VER=v1.1.GIT
 # (included in release tarballs), then default
 if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then
 	VN=$(echo "$VN" | sed -e 's/-/./g');
+elif test -f version; then
+	VN=$(cat version);
 else
-	VN=$(cat version) || VN="$DEF_VER"
+	VN="$DEF_VER";
 fi
 
 VN=$(expr "$VN" : v*'\(.*\)')
---
0.99.9.GIT
Message 1 of 1 in “do not cat version file if it does not exist”
  1. do not cat version file if it does not existAmos Waterland, Feb 3, 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.