@matheusbsbs / matheus-bagliano / commits / 6a2e50f9df
Fork 0

git --version tells which version of git you have.

Originally from Martin Atukunda <matlads@dsmagic.com> but adjusted for post-rename code. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Sep 7, 2005 at 21:26 UTC 6a2e50f9dfdca7ac572bbe30dd0efdf19ca250f6
2 files changed +13 -2
Makefile
+8 -2
@@ -183,11 +183,17 @@ SCRIPTS = $(SCRIPT_SH) $(SCRIPT_PERL) gitk
183
184 ### Build rules
185
186 -all: $(PROGRAMS)
186 +all: $(PROGRAMS) git.sh
187
188 all:
189 $(MAKE) -C templates
190
191 +git.sh: git.sh.in Makefile
192 + rm -f $@+ $@
193 + sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.in >$@+
194 + chmod +x $@+
195 + mv $@+ $@
196 +
197 %.o: %.c
198 $(CC) -o $*.o -c $(ALL_CFLAGS) $<
199 %.o: %.S
@@ -293,7 +299,7 @@ deb: dist
299
300 clean:
301 rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROGRAMS) $(LIB_FILE)
296 - rm -f git-core.spec
302 + rm -f git-core.spec git.sh
303 rm -rf $(GIT_TARNAME)
304 rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
305 rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc
git.sh.in renamed
+5
@@ -6,6 +6,11 @@ case "$#" in
6 0) ;;
7 *) cmd="$1"
8 shift
9 + case "$cmd" in
10 + -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
11 + echo "git version @@GIT_VERSION@@"
12 + exit 0 ;;
13 + esac
14 test -x $path/git-$cmd && exec $path/git-$cmd "$@" ;;
15 esac
16