git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jason McMullan <jason.mcmullan@timesys.com>
To: torvalds@osdl.org, git@vger.kernel.org
Subject: [PATCH] Add git-help-script
Date: Tue, 7 Jun 2005 10:19:44 -0400	[thread overview]
Message-ID: <20050607141944.GA14915@jmcmullan.timesys> (raw)

Id: 13d680c11f5403f3b1b48e71416e36770cd0aecf
tree 91e05412806336f2c9d989b8d9a2eccb21281efe
parent e774aa5641ca2267e7aba7338da3f7e355b7fb78
author Jason McMullan <jason.mcmullan@gmail.com> 1118153648 -0400
committer Jason McMullan <jason.mcmullan@gmail.com> 1118153648 -0400

Add: 'git help' aka 'git-help-script', built from Documentation/* information


======== diff against e774aa5641ca2267e7aba7338da3f7e355b7fb78 ========
diff --git a/Documentation/git-help-script.txt b/Documentation/git-help-script.txt
new file mode 100644
--- /dev/null
+++ b/Documentation/git-help-script.txt
@@ -0,0 +1,29 @@
+git-help-script(1)
+==================
+v0.1, May 2005
+
+NAME
+----
+git-help-script - Short help of all the git commands and scripts
+
+
+SYNOPSIS
+--------
+'git-help-script' 
+
+DESCRIPTION
+-----------
+Shows a brief summary of all the git-* commands.
+
+Author
+------
+Written by Jason McMullan <jason.mcmullan@timesys.com>
+
+Documentation
+--------------
+Documentation by Jason McMullan 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
@@ -23,7 +23,7 @@ INSTALL=install
 SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
 	git-pull-script git-tag-script git-resolve-script git-whatchanged \
 	git-deltafy-script git-fetch-script git-status-script git-commit-script \
-	git-log-script git-shortlog
+	git-log-script git-shortlog git-help-script
 
 PROG=   git-update-cache git-diff-files git-init-db git-write-tree \
 	git-read-tree git-commit-tree git-cat-file git-fsck-cache \
@@ -84,6 +84,26 @@ test-delta: test-delta.c diff-delta.o pa
 git-%: %.c $(LIB_FILE)
 	$(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
 
+git-help-script: Makefile $(patsubst %,Documentation/%.txt,$(SCRIPTS) $(PROG))
+	echo "#!/bin/sh" >git-help-script
+	echo "cat <<EOF" >>git-help-script
+	echo "Commands:" >>git-help-script
+	echo >>git-help-script
+	for cmd in $(sort $(SCRIPTS)) $(sort $(PROG)); do \
+	  doc="Documentation/$$cmd.txt"; \
+	  if [ ! -e "$$doc" ]; then \
+	    echo "MISSING: $$doc" 1>&2; \
+	    rm -f git-help-script; \
+	    exit 1; \
+	  fi; \
+	  desc=`grep "^$$cmd - " $$doc | cut -d' ' -f3-` ; \
+	  desc=`echo "$$desc" | sed -e 's/\(.\{40\}\) /\1\n                        /g'` ; \
+	  cmd=`echo $$cmd | sed -e 's/^git-\(.*\)-script$$/git \1/'`; \
+	  printf "    %-20s%s\n" "$$cmd" "$$desc" >>git-help-script; \
+	done
+	echo "EOF" >>git-help-script
+	echo "exit 1" >>git-help-script
+
 git-update-cache: update-cache.c
 git-diff-files: diff-files.c
 git-init-db: init-db.c
@@ -143,7 +163,7 @@ test: all
 	$(MAKE) -C t/ all
 
 clean:
-	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)
+	rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE) git-help-script
 	$(MAKE) -C Documentation/ clean
 
 backup: clean
diff --git a/git b/git
--- a/git
+++ b/git
@@ -1,4 +1,8 @@
 #!/bin/sh
-cmd="git-$1-script"
+
+cmd="$1"
+
+[ -z "$cmd" -o "$cmd" = "-h" -o "$cmd" = "--help" ] && cmd="help"
+cmd="git-$cmd-script"
 shift
 exec $cmd "$@"
======== end ========


             reply	other threads:[~2005-06-07 14:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-07 14:19 Jason McMullan [this message]
2005-06-07 14:25 ` [PATCH] Add git-help-script McMullan, Jason

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20050607141944.GA14915@jmcmullan.timesys \
    --to=jason.mcmullan@timesys.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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.
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).