Add version string to git.

Signed-off-by: Martin Atukunda <[EMAIL PROTECTED]>

---

 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.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to