Log message printout cleanups (#3): fix --pretty=oneline
[git.git] / revision.c
index bdf8005..5abec18 100644 (file)
@@ -380,6 +380,9 @@ static void add_parents_to_list(struct rev_info *revs, struct commit *commit, st
        if (revs->prune_fn)
                revs->prune_fn(revs, commit);
 
+       if (revs->no_walk)
+               return;
+
        parent = commit->parents;
        while (parent) {
                struct commit *p = parent->item;
@@ -475,11 +478,9 @@ static void handle_all(struct rev_info *revs, unsigned flags)
 
 void init_revisions(struct rev_info *revs)
 {
-       unsigned abbrev = revs->abbrev;
-
        memset(revs, 0, sizeof(*revs));
 
-       revs->abbrev = abbrev;
+       revs->abbrev = DEFAULT_ABBREV;
        revs->ignore_merges = 1;
        revs->pruning.recursive = 1;
        revs->pruning.add_remove = file_add_remove;
@@ -497,7 +498,6 @@ void init_revisions(struct rev_info *revs)
        revs->topo_setter = topo_sort_default_setter;
        revs->topo_getter = topo_sort_default_getter;
 
-       revs->header_prefix = "";
        revs->commit_format = CMIT_FMT_DEFAULT;
 
        diff_setup(&revs->diffopt);
@@ -516,8 +516,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
        const char **unrecognized = argv + 1;
        int left = 1;
 
-       init_revisions(revs);
-
        /* First, search for "--" */
        seen_dashdash = 0;
        for (i = 1; i < argc; i++) {
@@ -676,12 +674,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                        }
                        if (!strcmp(arg, "-v")) {
                                revs->verbose_header = 1;
-                               revs->header_prefix = "diff-tree ";
                                continue;
                        }
                        if (!strncmp(arg, "--pretty", 8)) {
                                revs->verbose_header = 1;
-                               revs->header_prefix = "diff-tree ";
                                revs->commit_format = get_commit_format(arg+8);
                                continue;
                        }
@@ -820,6 +816,8 @@ void prepare_revision_walk(struct rev_info *revs)
                list = list->next;
        }
 
+       if (revs->no_walk)
+               return;
        if (revs->limited)
                limit_list(revs);
        if (revs->topo_order)