git.txt: update description of the configuration mechanism
[git.git] / help.c
diff --git a/help.c b/help.c
index 2a42ec6d1f312b573d7b1da1a15471d21efc5b4d..1dfa0b05827e6e75dc463092b2838cd1c991623c 100644 (file)
--- a/help.c
+++ b/help.c
@@ -223,6 +223,23 @@ void list_commands(unsigned int colopts,
        }
 }
 
+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));
+       }
+}
+
 int is_in_cmdlist(struct cmdnames *c, const char *s)
 {
        int i;