git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add help details to git help command.
@ 2005-04-18  4:42 Steven Cole
  2005-04-18 10:24 ` Petr Baudis
  0 siblings, 1 reply; 16+ messages in thread
From: Steven Cole @ 2005-04-18  4:42 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

There's a patch at the bottom of this, so please look at that first before
my reading my whining immediately below.

I'm having some troubles with git pull, so this is just an ordinary diff.
Otherwise, I would have used the in-house diff command.

<troubles>
patch: **** Only garbage was found in the patch input.
</troubles>
<more troubles>
Tracked branch, applying changes...
error: bad signature
error: verify header failed
read_cache: Invalid argument
error: bad signature
error: verify header failed
error: bad signature
error: verify header failed
</more troubles>

Anyway, it's late, and I'm sure there is an easy fix to the above.

Here is a patch which provides the comment lines in the associated
script files when the git help command is invoked with an argument
thusly:

[steven@spc git-pasky-new]$ ./git help merge

 Merge a branch to the current tree.
 Copyright (c) Petr Baudis, 2005

 Takes a parameter identifying the branch to be merged.
 Optional "-b base_commit" parameter specifies the base for the
 merge. "-a" parameter may come first to tell git merge
 to check out the full tree to the merge tree.

 It creates a new ,,merge/ directory, which is git-controlled
 but has only the changed files checked out. You then have to
 examine it and then do git commit, which will also automatically
 bring your working tree up-to-date.

---------
This patch will provide the comment lines in the shell script associated
with the command, cleaned up a bit for presentation.

BUGS: This will also print any comments in the entire file, which may
not be desired.  If a command name and shell script filename
do not follow the usual convention, this won't work, e.g. ci for commit.

Signed-off-by: Steven Cole <elenstev@mesatop.com>

--- gp-newest-orig/git	2005-04-17 22:16:55.000000000 -0600
+++ gp-newest/git	2005-04-17 22:19:49.000000000 -0600
@@ -19,6 +19,11 @@
 
 
 help () {
+
+command=$1
+scriptfile=git$command.sh
+
+if [ ! $command ]; then
 	cat <<__END__
 The GIT scripted toolkit  $(gitversion.sh)
 
@@ -48,7 +53,10 @@
 	update		COMMIT_ID
 	version
 
+Additional help is available with: git help COMMAND
+
 Note that these expressions can be used interchangably as "ID"s:
+
 	empty string (current HEAD)
 	local (the local branch if tracking a remote one)
 	remote name (as registered with git addremote)
@@ -57,6 +65,10 @@
 	commit object hash (as returned by commit-id)
 	tree object hash (accepted only by some commands)
 __END__
+fi
+if [ ! $scriptfile = "git.sh" ]; then
+grep ^# $scriptfile | grep -v "!/bin" | cut -c 2-
+fi
 }
 
 

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

end of thread, other threads:[~2005-04-23 23:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-18  4:42 [PATCH] Add help details to git help command Steven Cole
2005-04-18 10:24 ` Petr Baudis
2005-04-18 16:59   ` Steven Cole
2005-04-19  1:40     ` [RFC] Another way to provide help details. (was Re: [PATCH] Add help details to git help command.) Steven Cole
2005-04-19  1:51       ` Petr Baudis
2005-04-19 14:41         ` David Greaves
2005-04-19 16:03           ` Steven Cole
2005-04-19 17:32           ` Petr Baudis
2005-04-19 17:35   ` [PATCH] Add help details to git help command. (This time with Perl) Steven Cole
2005-04-19 17:50     ` Petr Baudis
2005-04-19 19:04       ` David Greaves
2005-04-19 20:34         ` Steven Cole
2005-04-19 20:45           ` David Greaves
2005-04-20 23:34         ` Petr Baudis
2005-04-21  9:29           ` David Greaves
2005-04-23 23:41             ` Petr Baudis

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 NNTP newsgroup(s).