Add test case for update hooks in receive-pack.
[gitweb.git] / builtin-rev-list.c
index 0900737f40c5d079140f3e3d2835b8d884753a06..1bb3a06680194ce5855185ad1a1c7e39eeebba94 100644 (file)
@@ -54,6 +54,12 @@ static void show_commit(struct commit *commit)
                fputs(header_prefix, stdout);
        if (commit->object.flags & BOUNDARY)
                putchar('-');
+       else if (revs.left_right) {
+               if (commit->object.flags & SYMMETRIC_LEFT)
+                       putchar('<');
+               else
+                       putchar('>');
+       }
        if (revs.abbrev_commit && revs.abbrev)
                fputs(find_unique_abbrev(commit->object.sha1, revs.abbrev),
                      stdout);
@@ -114,6 +120,11 @@ static void show_object(struct object_array_entry *p)
                printf("%s %s\n", sha1_to_hex(p->item->sha1), p->name);
 }
 
+static void show_edge(struct commit *commit)
+{
+       printf("-%s\n", sha1_to_hex(commit->object.sha1));
+}
+
 /*
  * This is a truly stupid algorithm, but it's only
  * used for bisection, and we just don't care enough.
@@ -192,35 +203,6 @@ static struct commit_list *find_bisection(struct commit_list *list)
        return best;
 }
 
-static void mark_edge_parents_uninteresting(struct commit *commit)
-{
-       struct commit_list *parents;
-
-       for (parents = commit->parents; parents; parents = parents->next) {
-               struct commit *parent = parents->item;
-               if (!(parent->object.flags & UNINTERESTING))
-                       continue;
-               mark_tree_uninteresting(parent->tree);
-               if (revs.edge_hint && !(parent->object.flags & SHOWN)) {
-                       parent->object.flags |= SHOWN;
-                       printf("-%s\n", sha1_to_hex(parent->object.sha1));
-               }
-       }
-}
-
-static void mark_edges_uninteresting(struct commit_list *list)
-{
-       for ( ; list; list = list->next) {
-               struct commit *commit = list->item;
-
-               if (commit->object.flags & UNINTERESTING) {
-                       mark_tree_uninteresting(commit->tree);
-                       continue;
-               }
-               mark_edge_parents_uninteresting(commit);
-       }
-}
-
 static void read_revisions_from_stdin(struct rev_info *revs)
 {
        char line[1000];
@@ -293,14 +275,14 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
            revs.diff)
                usage(rev_list_usage);
 
-       save_commit_buffer = revs.verbose_header;
+       save_commit_buffer = revs.verbose_header || revs.grep_filter;
        track_object_refs = 0;
        if (bisect_list)
                revs.limited = 1;
 
        prepare_revision_walk(&revs);
        if (revs.tree_objects)
-               mark_edges_uninteresting(revs.commits);
+               mark_edges_uninteresting(revs.commits, &revs, show_edge);
 
        if (bisect_list)
                revs.commits = find_bisection(revs.commits);