From: Scott Chacon <schacon@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH] Modified the default git help message to be grouped by topic
Date: Mon, 1 Dec 2008 09:30:37 -0800 [thread overview]
Message-ID: <20081201173037.GA41967@agadorsparticus> (raw)
It's difficult to process 21 commands (which is what is output
by default for git when no command is given). I've re-grouped
them into 4 groups of 5 or 6 commands each, which I think is
clearer and easier for new users to process.
As discussed at the GitTogether.
Signed-off-by: Scott Chacon <schacon@gmail.com>
---
This makes the 'git' (with no arguments) command look like this:
http://gist.github.com/20553
This won't automatically update with the common-commands.txt file,
but I think it is easier to parse for the command you may be looking
for.
builtin-help.c | 42 +++++++++++++++++++++++++++++-------------
1 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/builtin-help.c b/builtin-help.c
index f076efa..562d5d1 100644
--- a/builtin-help.c
+++ b/builtin-help.c
@@ -277,19 +277,35 @@ static struct cmdnames main_cmds, other_cmds;
void list_common_cmds_help(void)
{
- int i, longest = 0;
-
- for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
- if (longest < strlen(common_cmds[i].name))
- longest = strlen(common_cmds[i].name);
- }
-
- puts("The most commonly used git commands are:");
- for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
- printf(" %s ", common_cmds[i].name);
- mput_char(' ', longest - strlen(common_cmds[i].name));
- puts(common_cmds[i].help);
- }
+ puts("The most commonly used git commands are:\n\
+\n\
+Basic Commands\n\
+ init Create an empty git repository or reinitialize an existing one\n\
+ add Add file contents to the staging area\n\
+ status Show the working tree and staging area status\n\
+ commit Record changes in the staging area to the repository\n\
+ rm Remove files from the working tree and from the index\n\
+ mv Move or rename a file, a directory, or a symlink\n\
+\n\
+History Commands\n\
+ log Show commit log history\n\
+ diff Show changes between commits, commit and working tree, etc\n\
+ grep Print lines in git tracked files matching a pattern\n\
+ reset Reset current HEAD to the specified state\n\
+ show Show various types of objects\n\
+\n\
+Branch Commands\n\
+ checkout Checkout a branch or paths to the working tree\n\
+ branch List, create, or delete branches\n\
+ merge Join two or more development histories together\n\
+ rebase Apply changes introduced in one branch onto another\n\
+ tag Create, list, delete or verify a tag object signed with GPG\n\
+\n\
+Remote Commands\n\
+ clone Clone a repository into a new directory\n\
+ fetch Download objects and refs from another repository\n\
+ pull Fetch from and merge with another repository or a local branch\n\
+ push Update remote refs along with associated objects");
}
static int is_git_command(const char *s)
--
1.6.0.8.gc9c8
next reply other threads:[~2008-12-01 17:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 17:30 Scott Chacon [this message]
2008-12-01 18:32 ` [PATCH] Modified the default git help message to be grouped by topic Jeff King
2008-12-02 1:45 ` Junio C Hamano
2008-12-02 6:10 ` Scott Chacon
2008-12-02 20:11 ` James Pickens
2008-12-02 21:33 ` Boyd Stephen Smith Jr.
2008-12-02 22:55 ` Johannes Schindelin
2008-12-02 23:30 ` Jeff King
2008-12-02 23:39 ` Scott Chacon
2008-12-03 0:10 ` Junio C Hamano
2008-12-03 0:37 ` Jeff King
2008-12-03 0:47 ` Jakub Narebski
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=20081201173037.GA41967@agadorsparticus \
--to=schacon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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 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).