Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15
DORMANTno replies

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

From: Martin Atukunda <hidden>
Date: 2016-06-15 22:42:05
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

Add version string to git.

Signed-off-by: Martin Atukunda <redacted>

---

 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help