git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Modified the default git help message to be grouped by topic
@ 2008-12-01 17:30 Scott Chacon
  2008-12-01 18:32 ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Scott Chacon @ 2008-12-01 17:30 UTC (permalink / raw)
  To: git; +Cc: gitster

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

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

end of thread, other threads:[~2008-12-03  0:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-01 17:30 [PATCH] Modified the default git help message to be grouped by topic Scott Chacon
2008-12-01 18:32 ` 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

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).