Add git-version-script.
Subsystems (2)
This script simply reports the version of git you have installed.
Signed-off-by Martin Atukunda <[email protected]>
---
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
Documentation/git-version-script.txt new file +36 -0
@@ -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 <[email protected]> + +Documentation +-------------- +Documentation by David Greaves, Junio C Hamano and the git-list <[email protected]>. + +GIT +--- +Part of the link:git.html[git] suite +
Makefile +7 -2
@@ -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
git-version-script.in new file +9 -0
@@ -0,0 +1,9 @@ +#!/bin/sh + +. git-sh-setup-script || die "Not a git archive" + +dryrun= +echo= + +echo git version @@VERSION@@ +
Quoted 1 line · Martin Atukunda
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.
Quoted 7 lines · Junio C Hamano
Quoted 1 line · Martin Atukunda
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
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
Makefile +2 -1
@@ -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
git.in new file +25 -0
@@ -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
Signature · 1 line
Your entire blood supply is filtered through your kidneys in four minutes.