git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Atukunda <matlads@dsmagic.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>, A Large Angry SCM <gitzilla@gmail.com>
Subject: [PATCH] Re: Add git-version-script.
Date: Thu, 8 Sep 2005 05:35:25 +0300	[thread overview]
Message-ID: <20050908023525.GA14179@igloo.ds.co.ug> (raw)
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.

      reply	other threads:[~2005-09-08  2:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-05 15:02 Add git-version-script Martin Atukunda
2005-09-08  1:11 ` Junio C Hamano
2005-09-08  2:08   ` A Large Angry SCM
2005-09-08  2:35     ` Martin Atukunda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050908023525.GA14179@igloo.ds.co.ug \
    --to=matlads@dsmagic.com \
    --cc=git@vger.kernel.org \
    --cc=gitzilla@gmail.com \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).