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

[PATCH] Re: Add git-version-script.

From
MAMartin Atukunda <matlads@dsmagic.com>
Date
Sep 8, 2005, 02:35 UTC
Message-ID
<20050908023525.GA14179@igloo.ds.co.ug>
In-Reply-To
<431F9D0F.8070301@gmail.com>
Add version string to git.
Signed-off-by: Martin Atukunda <matlads@dsmagic.com>
---
 Makefile |    3 ++-
 git.in   |   25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletions(-)
 create mode 100755 git.in
6a9edfa27c41b7845bfd519e275c24d7e36ad702
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -218,7 +218,8 @@ $(LIB_FILE): $(LIB_OBJS)
 doc:
 	$(MAKE) -C Documentation all
 
-
+git: git.in Makefile
+	sed 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
 
 ### Testing rules
 
diff --git a/git.in b/git.in
new file mode 100755
--- /dev/null
+++ b/git.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+cmd=
+path=$(dirname $0)
+case "$#" in
+0)	;;
+*)	cmd="$1"
+	shift
+	if [ "$cmd" == "--version" ]; then
+		echo "git version @@VERSION@@"
+		exit 0
+	fi
+	test -x $path/git-$cmd-script && exec $path/git-$cmd-script "$@"
+	test -x $path/git-$cmd && exec $path/git-$cmd "$@" ;;
+esac
+
+echo "git version @@VERSION@@"
+echo "Usage: git COMMAND [OPTIONS] [TARGET]"
+if [ -n "$cmd" ]; then
+    echo " git command '$cmd' not found: commands are:"
+else
+    echo " git commands are:"
+fi
+
+ls $path | sed -ne 's/^git-\(.*\)-script/  \1/p' | fmt
-- 
Your entire blood supply is filtered through your kidneys in four minutes.
Previous: A Large Angry SCM
Message 4 of 4 in “Add git-version-script.”
  1. Martin AtukundaSep 5, 2005
  2. Junio C HamanoSep 8, 2005
  3. A Large Angry SCMSep 8, 2005
  4. Re: Add git-version-script.Martin Atukunda, Sep 8, 2005

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.