From: Steven Cole <elenstev@mesatop.com>
To: Petr Baudis <pasky@ucw.cz>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Add help details to git help command.
Date: Mon, 18 Apr 2005 10:59:46 -0600 [thread overview]
Message-ID: <4263E782.6040608@mesatop.com> (raw)
In-Reply-To: <20050418102412.GJ1461@pasky.ji.cz>
Petr Baudis wrote:
> Dear diary, on Mon, Apr 18, 2005 at 06:42:26AM CEST, I got a letter
> where Steven Cole <elenstev@mesatop.com> told me that...
[snippage]
>
>>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.
>
>
> Hey, those BUGS are the only slightly non-trivial thing on the whole
> thing! I could do this patch myself... ;-) Also, you don't want to print
> the first newline and the Copyright notices.
>
Fixed extra vertical whitespace, Copyright notice problems, and issue
with git help ci.
Here's a better version. Didn't fix the more interesting bugs, as I'm
pressed for time (aren't we all). Perhaps someone can polish this up.
Anyway, I think it's pretty useful in its present form.
Thanks,
Steven
---------
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.
git: b648169640025bd68d1b27a0fcc85b65d85e4440
--- git
+++ git 2005-04-18 10:34:17.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 @@
track [RNAME]
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,14 @@
commit object hash (as returned by commit-id)
tree object hash (accepted only by some commands)
__END__
+fi
+if [ $scriptfile = "gitci.sh" ]; then
+ scriptfile="gitcommit.sh"
+fi
+if [ ! $scriptfile = "git.sh" ]; then
+ grep ^# $scriptfile | grep -v "!/bin" | grep -v "(c)" \
+ | cut -c 2- | grep ^.
+fi
}
next prev parent reply other threads:[~2005-04-18 16:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4263E782.6040608@mesatop.com \
--to=elenstev@mesatop.com \
--cc=git@vger.kernel.org \
--cc=pasky@ucw.cz \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.