git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Add git-version-script.
@ 2005-09-05 15:02 Martin Atukunda
  2005-09-08  1:11 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Atukunda @ 2005-09-05 15:02 UTC (permalink / raw)
  To: git
  Cc: "Subject:[PATCH]", Add, the,
	"git-version-script.", Martin Atukunda

This script simply reports the version of git you have installed.

Signed-off-by: Martin Atukunda <matlads@dsmagic.com>

---

 Documentation/git-version-script.txt |   36 ++++++++++++++++++++++++++++++++++
 Makefile                             |    9 +++++++--
 git-version-script.in                |    9 +++++++++
 3 files changed, 52 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/git-version-script.txt
 create mode 100644 git-version-script.in

df6687167001a93528876d5f36a2fc61eb1829fd
diff --git a/Documentation/git-version-script.txt b/Documentation/git-version-script.txt
new file mode 100644
--- /dev/null
+++ b/Documentation/git-version-script.txt
@@ -0,0 +1,36 @@
+git-version-script(1)
+===================
+v0.99.5, Aug 2005
+
+NAME
+----
+git-version-script - Prints the current version of git
+
+
+SYNOPSIS
+--------
+'git-version-script'
+
+DESCRIPTION
+-----------
+
+This simple script simply prints the version of git you are currently
+running. The version is generated at release time, and stored in the script
+for later use.
+
+OPTIONS
+-------
+This program takes no options
+
+Author
+------
+Written by Martin Atukunda <matlads@dsmagic.com>
+
+Documentation
+--------------
+Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
+
+GIT
+---
+Part of the link:git.html[git] suite
+
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -66,7 +66,7 @@ SCRIPTS=git git-merge-one-file-script gi
 	git-format-patch-script git-sh-setup-script git-push-script \
 	git-branch-script git-parse-remote-script git-verify-tag-script \
 	git-ls-remote-script git-clone-dumb-http git-rename-script \
-	git-request-pull-script git-bisect-script
+	git-request-pull-script git-bisect-script git-version-script
 
 SCRIPTS += git-count-objects-script
 SCRIPTS += git-revert-script
@@ -230,8 +230,12 @@ install-doc:
 git-core.spec: git-core.spec.in Makefile
 	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
 
+git-version-script: git-version-script.in Makefile
+	sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@
+	chmod +x $@
+
 GIT_TARNAME=git-core-$(GIT_VERSION)
-dist: git-core.spec git-tar-tree
+dist: git-core.spec git-version-script git-tar-tree
 	./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
 	@mkdir -p $(GIT_TARNAME)
 	@cp git-core.spec $(GIT_TARNAME)
@@ -253,6 +257,7 @@ deb: dist
 clean:
 	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
 	rm -f git-core.spec
+	rm -f git-version-script
 	rm -rf $(GIT_TARNAME)
 	rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
 	rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc
diff --git a/git-version-script.in b/git-version-script.in
new file mode 100644
--- /dev/null
+++ b/git-version-script.in
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+. git-sh-setup-script || die "Not a git archive"
+
+dryrun=
+echo=
+
+echo git version @@VERSION@@
+

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Add git-version-script.
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2005-09-08  1:11 UTC (permalink / raw)
  To: Martin Atukunda; +Cc: git

Martin Atukunda <matlads@dsmagic.com> writes:

> This script simply reports the version of git you have installed.

I wanted to ahve some way of recording the git version, but I am
wondering if 'git' without parameter telling the version number
would be good enough without introducing yet another script.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Add git-version-script.
  2005-09-08  1:11 ` Junio C Hamano
@ 2005-09-08  2:08   ` A Large Angry SCM
  2005-09-08  2:35     ` [PATCH] " Martin Atukunda
  0 siblings, 1 reply; 4+ messages in thread
From: A Large Angry SCM @ 2005-09-08  2:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Martin Atukunda, git

Junio C Hamano wrote:
> Martin Atukunda <matlads@dsmagic.com> writes:
> 
>>This script simply reports the version of git you have installed.
> 
> I wanted to ahve some way of recording the git version, but I am
> wondering if 'git' without parameter telling the version number
> would be good enough without introducing yet another script.

git --version

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Re: Add git-version-script.
  2005-09-08  2:08   ` A Large Angry SCM
@ 2005-09-08  2:35     ` Martin Atukunda
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Atukunda @ 2005-09-08  2:35 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, A Large Angry SCM

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-08  2:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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     ` [PATCH] " Martin Atukunda

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).