Code

git-config.txt: fix a typo
[git.git] / builtin-rev-list.c
index 54b6672969bdcd6f5bf48922f180883b35a5041e..facaff288dba2789f0637c4554bd130440e2a3da 100644 (file)
@@ -17,7 +17,7 @@
 #define COUNTED                (1u<<16)
 
 static const char rev_list_usage[] =
-"git-rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
+"git rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
 "  limiting output:\n"
 "    --max-count=nr\n"
 "    --max-age=epoch\n"
@@ -37,6 +37,7 @@ static const char rev_list_usage[] =
 "    --reverse\n"
 "  formatting output:\n"
 "    --parents\n"
+"    --children\n"
 "    --objects | --objects-edge\n"
 "    --unpacked\n"
 "    --header | --pretty\n"
@@ -90,6 +91,15 @@ static void show_commit(struct commit *commit)
                        parents = parents->next;
                }
        }
+       if (revs.children.name) {
+               struct commit_list *children;
+
+               children = lookup_decoration(&revs.children, &commit->object);
+               while (children) {
+                       printf(" %s", sha1_to_hex(children->item->object.sha1));
+                       children = children->next;
+               }
+       }
        show_decorations(commit);
        if (revs.commit_format == CMIT_FMT_ONELINE)
                putchar(' ');
@@ -168,7 +178,7 @@ static void finish_object(struct object_array_entry *p)
 static void show_object(struct object_array_entry *p)
 {
        /* An object with name "foo\n0000000..." can be used to
-        * confuse downstream git-pack-objects very badly.
+        * confuse downstream "git pack-objects" very badly.
         */
        const char *ep = strchr(p->name, '\n');
 
@@ -580,6 +590,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
        revs.commit_format = CMIT_FMT_UNSPECIFIED;
        argc = setup_revisions(argc, argv, &revs, NULL);
 
+       quiet = DIFF_OPT_TST(&revs.diffopt, QUIET);
        for (i = 1 ; i < argc; i++) {
                const char *arg = argv[i];
 
@@ -611,10 +622,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
                        read_revisions_from_stdin(&revs);
                        continue;
                }
-               if (!strcmp(arg, "--quiet")) {
-                       quiet = 1;
-                       continue;
-               }
                usage(rev_list_usage);
 
        }
@@ -638,7 +645,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
            revs.diff)
                usage(rev_list_usage);
 
-       save_commit_buffer = revs.verbose_header || revs.grep_filter;
+       save_commit_buffer = revs.verbose_header ||
+               revs.grep_filter.pattern_list;
        if (bisect_list)
                revs.limited = 1;