From: James Purser <purserj@winnsw.com.au>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Adding Correct Useage Notification and -h Help flag
Date: Wed, 15 Jun 2005 07:49:36 +1000 [thread overview]
Message-ID: <1118785776.3068.4.camel@kryten> (raw)
In-Reply-To: <7vmzptbrsg.fsf@assigned-by-dhcp.cox.net>
[-- Attachment #1: Type: text/plain, Size: 2751 bytes --]
Heres the revised patch along the lines you recommended yesterday. I am
still working on some of the command descriptions.
On the git-update-cache question, I think having a flag [-u] or
something like that in git commit would allow the user to decide to run
git-update-cache on only the files specified in the git commit command.
Signed-off-by: James Purser <purserj@k-sit.com>
On Tue, 2005-06-14 at 12:23, Junio C Hamano wrote:
> >>Added a couple of lines to the git wrapper. Includes Correct
> >>Useage and available scripts
>
> I like the general direction of making "git" wrapper novice
> friendly, but have some suggestions to the implementation.
>
> (0) Do not mention that only certain subset is accessible.
> Just saying "Available commands are:" would be enough, and
> would not leave the end user wondering what he is missing.
>
> (1) Instead of explicitly checking for -h, you may want to
> structure it like this:
>
> #!/bin/sh
>
> cmd="git-$1-script";
> shift;
> exec $cmd "$@";
> echo "Usage: git <subcommand> [<param>...]"
> echo 'Available commands are:"
> git bar
> git foo
> ...
> '
> exit 1
>
> Alternatively, you could say:
>
> #!/bin/sh
>
> case "$1" in
> -h)
> echo "Usage: git <subcommand> [<param>...]"
> echo 'Available commands are:
> git bar
> git foo
> ...
> '
> exit 0 ;;
> esac
>
> cmd="git-$1-script";
> shift;
> exec $cmd "$@";
> git -h
> exit 1
>
> (2) Maintaining the list of commands by hand in git script
> itself have an advantage that you _could_ describe the
> options and parameters they take, but you are not doing
> that in your patch (hint, hint).
>
> If all you give is the list of subcommand names, have
> git.in as a source file, and create the "list of available
> commands" from the Makefile, like this:
>
> === Makefile ===
> ...
> git : git.in
> /bin/sh ls -1 git-*-script | \
> sed -e 's/git-\(.*\)-script/git \1/' >.git-cmd-list
> sed -e '/@@LIST_OF_COMMANDS@@/{s/.*//;r .git-cmd-list;}' <$@.in >$@
> rm -f .git-cmd-list
>
> === git.in ===
> #!/bin/sh
>
> cmd="git-$1-script";
> shift;
> exec $cmd "$@";
> echo "Usage: git <subcommand> [<param>...]"
> echo 'Available commands are:
> @@LIST_OF_COMMANDS@@
> '
>
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: git_patch --]
[-- Type: text/plain, Size: 1835 bytes --]
Make the git wrapper a little bit more newbie friendly, when called on its own or with the -h flag will return a list of the commands available
---
commit 2ad499f75f0982953e43904085bd1b48dd821c4d
tree f137c4f3f5ee027b8b4d25a0434929e12eb7c51c
parent de4971b50076b5ef901c2ae0bbee9dd2c14f06ea
parent de4971b50076b5ef901c2ae0bbee9dd2c14f06ea
author James Purser <purserj@k-sit.com> Wed, 15 Jun 2005 07:43:20
committer James Purser <purserj@k-sit.com> Wed, 15 Jun 2005 07:43:20
git | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/git b/git
--- a/git
+++ b/git
@@ -1,4 +1,56 @@
#!/bin/sh
-cmd="git-$1-script"
-shift
-exec $cmd "$@"
+
+case "$1" in
+-h|"")
+ echo "Useage: git <subcommand> [<param 1>, <param 2> ...]"
+ echo "Available commands are:
+
+git apply-patch <patch file>
+
+ Applies patch file to local files
+
+git commit <file 1> <file 2> ...
+
+ Commits local changes to the cache. Before running this script you will need to run git-update-cache on the files you wish to commit.
+
+ Will accept wildcards ie git commit git-*-scripts
+
+git cvsimport [-v] [-z fuzz] <cvsroot> <module>
+
+ CVS to Git import tool. Relies on the cvsps package at least 2.1
+
+ -v Verbose output
+ -z
+ <cvsroot> Path to CVS Repository
+ <module> Module you want to import into git
+
+git deltafy:
+
+git diff [<File 1>, <File 2>, ...]
+
+ Diffs between the git cache and specified files. If no files are specified then creates a Diff between contents of the cache and all current files.
+
+git fetch:
+
+git log:
+
+git merge-one-file:
+
+git prune:
+
+git pull:
+
+git status:
+
+git tag:
+"
+ exit 0 ;;
+esac
+
+cmd="git-$1-script";
+shift;
+exec $cmd "$@";
+git -h
+exit 1
+
+
prev parent reply other threads:[~2005-06-14 21:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-14 1:47 [PATCH] Adding Correct Useage Notification and -h Help flag James Purser
2005-06-14 2:23 ` Junio C Hamano
2005-06-14 2:28 ` James Purser
2005-06-14 5:25 ` James Purser
2005-06-14 5:52 ` Junio C Hamano
2005-06-14 21:49 ` James Purser [this message]
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=1118785776.3068.4.camel@kryten \
--to=purserj@winnsw.com.au \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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).