{"thread":{"id":"856","subject":"[PATCH] Add git-help-script","startedAt":"2005-06-07T14:19:44Z","lastAt":"2005-06-07T14:25:41Z","messageCount":2,"participants":["Jason McMullan","McMullan, Jason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4674","messageId":"20050607141944.GA14915@jmcmullan.timesys","threadId":"856","inReplyTo":null,"subject":"[PATCH] Add git-help-script","fromName":"Jason McMullan","fromEmail":"jason.mcmullan@timesys.com","sentAt":"2005-06-07T14:19:44Z","receivedAt":"2005-06-07T14:19:44Z","isPatch":true,"sender":{"key":"jason.mcmullan@timesys.com","avatar":null},"body":"Id: 13d680c11f5403f3b1b48e71416e36770cd0aecf\ntree 91e05412806336f2c9d989b8d9a2eccb21281efe\nparent e774aa5641ca2267e7aba7338da3f7e355b7fb78\nauthor Jason McMullan <jason.mcmullan@gmail.com> 1118153648 -0400\ncommitter Jason McMullan <jason.mcmullan@gmail.com> 1118153648 -0400\n\nAdd: 'git help' aka 'git-help-script', built from Documentation/* information\n\n\n======== diff against e774aa5641ca2267e7aba7338da3f7e355b7fb78 ========\ndiff --git a/Documentation/git-help-script.txt b/Documentation/git-help-script.txt\nnew file mode 100644\n--- /dev/null\n+++ b/Documentation/git-help-script.txt\n@@ -0,0 +1,29 @@\n+git-help-script(1)\n+==================\n+v0.1, May 2005\n+\n+NAME\n+----\n+git-help-script - Short help of all the git commands and scripts\n+\n+\n+SYNOPSIS\n+--------\n+'git-help-script' \n+\n+DESCRIPTION\n+-----------\n+Shows a brief summary of all the git-* commands.\n+\n+Author\n+------\n+Written by Jason McMullan <jason.mcmullan@timesys.com>\n+\n+Documentation\n+--------------\n+Documentation by Jason McMullan and the git-list <git@vger.kernel.org>.\n+\n+GIT\n+---\n+Part of the link:git.html[git] suite\n+\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -23,7 +23,7 @@ INSTALL=install\n SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \\\n \tgit-pull-script git-tag-script git-resolve-script git-whatchanged \\\n \tgit-deltafy-script git-fetch-script git-status-script git-commit-script \\\n-\tgit-log-script git-shortlog\n+\tgit-log-script git-shortlog git-help-script\n \n PROG=   git-update-cache git-diff-files git-init-db git-write-tree \\\n \tgit-read-tree git-commit-tree git-cat-file git-fsck-cache \\\n@@ -84,6 +84,26 @@ test-delta: test-delta.c diff-delta.o pa\n git-%: %.c $(LIB_FILE)\n \t$(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)\n \n+git-help-script: Makefile $(patsubst %,Documentation/%.txt,$(SCRIPTS) $(PROG))\n+\techo \"#!/bin/sh\" >git-help-script\n+\techo \"cat <<EOF\" >>git-help-script\n+\techo \"Commands:\" >>git-help-script\n+\techo >>git-help-script\n+\tfor cmd in $(sort $(SCRIPTS)) $(sort $(PROG)); do \\\n+\t  doc=\"Documentation/$$cmd.txt\"; \\\n+\t  if [ ! -e \"$$doc\" ]; then \\\n+\t    echo \"MISSING: $$doc\" 1>&2; \\\n+\t    rm -f git-help-script; \\\n+\t    exit 1; \\\n+\t  fi; \\\n+\t  desc=`grep \"^$$cmd - \" $$doc | cut -d' ' -f3-` ; \\\n+\t  desc=`echo \"$$desc\" | sed -e 's/\\(.\\{40\\}\\) /\\1\\n                        /g'` ; \\\n+\t  cmd=`echo $$cmd | sed -e 's/^git-\\(.*\\)-script$$/git \\1/'`; \\\n+\t  printf \"    %-20s%s\\n\" \"$$cmd\" \"$$desc\" >>git-help-script; \\\n+\tdone\n+\techo \"EOF\" >>git-help-script\n+\techo \"exit 1\" >>git-help-script\n+\n git-update-cache: update-cache.c\n git-diff-files: diff-files.c\n git-init-db: init-db.c\n@@ -143,7 +163,7 @@ test: all\n \t$(MAKE) -C t/ all\n \n clean:\n-\trm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE)\n+\trm -f *.o mozilla-sha1/*.o ppc/*.o $(PROG) $(LIB_FILE) git-help-script\n \t$(MAKE) -C Documentation/ clean\n \n backup: clean\ndiff --git a/git b/git\n--- a/git\n+++ b/git\n@@ -1,4 +1,8 @@\n #!/bin/sh\n-cmd=\"git-$1-script\"\n+\n+cmd=\"$1\"\n+\n+[ -z \"$cmd\" -o \"$cmd\" = \"-h\" -o \"$cmd\" = \"--help\" ] && cmd=\"help\"\n+cmd=\"git-$cmd-script\"\n shift\n exec $cmd \"$@\"\n======== end ========\n\n"},{"id":"4676","messageId":"1118154342.8970.57.camel@jmcmullan.timesys","threadId":"856","inReplyTo":"20050607141944.GA14915@jmcmullan.timesys","subject":"Re: [PATCH] Add git-help-script","fromName":"McMullan, Jason","fromEmail":"jason.mcmullan@timesys.com","sentAt":"2005-06-07T14:25:41Z","receivedAt":"2005-06-07T14:25:41Z","isPatch":true,"sender":{"key":"jason.mcmullan@timesys.com","avatar":null},"body":"NOTE: This patch requires '[PATCH] Add missing Documention/*'\n\n\nHere's the example output of 'git-help-script', which is called\nwhen the user doesn't supply any options to the 'git' script wrapper,\nor -h, or --help\n\n\n$ git \nCommands:\n\n    git                 the stupid content tracker\n    git apply-patch     Sample script to apply the diffs from git-diff-*\n    git commit          Commit working directory\n\n    git deltafy         Convery repository into delta format\n    git fetch           Fetch an object from a remote repository\n    git help            Short help of all the git commands and scripts\n    git log             \n    git merge-one-file  The standard helper program to use with\n\"git-merge-cache\"\n    git prune           Prunes all unreachable objects from the object\n                        database\n    git pull            Script used by Linus to pull and merge a\n                        remote repository\n    git resolve         Script used to merge two trees\n    git-shortlog        \n    git status          \n    git tag             An example script to create a tag object\n                        signed with GPG\n    git-whatchanged     Find out what changed\n    git-apply           Apply a patch against the current index\ncache/working\n                        directory\n    git-cat-file        Provide content or type information for\nrepository\n                        objects\n    git-check-files     Verify a list of files are up-to-date\n    git-checkout-cache  Copy files from the cache to the working\n                        directory\n    git-commit-tree     Creates a new commit object\n    git-convert-cache   Converts old-style GIT repository\n    git-diff-cache      Compares content and mode of blobs between\n                        the cache and repository\n    git-diff-files      Compares files in the working tree and the\n                        cache\n    git-diff-helper     Generates patch format output for git-diff-*\n    git-diff-tree       Compares the content and mode of blobs found\n                        via two tree objects\n    git-export          Exports each commit and a diff against each\n                        of its parents\n    git-fsck-cache      Verifies the connectivity and validity of\n                        the objects in the database\n    git-get-tar-commit-idShow the commit ID embedded in a git-tar-tree\n                        file.\n    git-http-pull       Downloads a remote GIT repository via HTTP\n    git-init-db         Creates an empty git object database\n    git-local-pull      Duplicates another GIT repository on a local\n                        system\n    git-ls-files        Information about files in the cache/working\n                        directory\n    git-ls-tree         Lists the contents of a tree object.\n    git-merge-base      Finds as good a common ancestor as possible\n                        for a merge\n    git-merge-cache     Runs a merge for files needing merging\n    git-mkdelta         Creates a delta object\n    git-mktag           Creates a tag object\n    git-read-tree       Reads tree information into the directory\n                        cache\n    git-rev-list        Lists commit objects in reverse chronological\n                        order\n    git-rev-tree        Provides the revision tree for one or more\n                        commits\n    git-ssh-pull        Pulls from a remote repository over ssh\nconnection\n    git-ssh-push        Pushes to a remote repository over ssh\nconnection\n    git-stripspace      Strip space from stdin\n    git-tar-tree        Creates a tar archive of the files in the\n                        named tree\n    git-unpack-file     Creates a temporary file with a blob's contents\n    git-update-cache    Modifies the index or directory cache\n    git-write-blob      Creates a blob from a file\n    git-write-tree      Creates a tree from the current cache\n\n-- \nJason McMullan <jason.mcmullan@timesys.com>\nTimeSys Corporation\n\n"}]}