]> git.ipfire.org Git - thirdparty/git.git/blobdiff - revision.c
Merge branch 'en/merge-directory-renames'
[thirdparty/git.git] / revision.c
index 9265200b7a0c507da3bd008d3b7195560a44770f..d4aaf0ef257943029923f741b4ae383bb00d7f5f 100644 (file)
@@ -1883,7 +1883,7 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi
        return 0;
 }
 
-static void read_pathspec_from_stdin(struct rev_info *revs, struct strbuf *sb,
+static void read_pathspec_from_stdin(struct strbuf *sb,
                                     struct argv_array *prune)
 {
        while (strbuf_getline(sb, stdin) != EOF)
@@ -1917,7 +1917,7 @@ static void read_revisions_from_stdin(struct rev_info *revs,
                        die("bad revision '%s'", sb.buf);
        }
        if (seen_dashdash)
-               read_pathspec_from_stdin(revs, &sb, prune);
+               read_pathspec_from_stdin(&sb, prune);
 
        strbuf_release(&sb);
        warn_on_object_refname_ambiguity = save_warning;
@@ -2140,6 +2140,9 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
                revs->diff = 1;
                revs->dense_combined_merges = 0;
                revs->combine_merges = 1;
+       } else if (!strcmp(arg, "--combined-all-paths")) {
+               revs->diff = 1;
+               revs->combined_all_paths = 1;
        } else if (!strcmp(arg, "--cc")) {
                revs->diff = 1;
                revs->dense_combined_merges = 1;
@@ -2636,6 +2639,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
        }
        if (revs->combine_merges)
                revs->ignore_merges = 0;
+       if (revs->combined_all_paths && !revs->combine_merges)
+               die("--combined-all-paths makes no sense without -c or --cc");
+
        revs->diffopt.abbrev = revs->abbrev;
 
        if (revs->line_level_traverse) {
@@ -2672,6 +2678,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
        if (revs->first_parent_only && revs->bisect)
                die(_("--first-parent is incompatible with --bisect"));
 
+       if (revs->line_level_traverse &&
+           (revs->diffopt.output_format & ~(DIFF_FORMAT_PATCH | DIFF_FORMAT_NO_OUTPUT)))
+               die(_("-L does not yet support diff formats besides -p and -s"));
+
        if (revs->expand_tabs_in_log < 0)
                revs->expand_tabs_in_log = revs->expand_tabs_in_log_default;
 
@@ -2731,7 +2741,7 @@ static struct merge_simplify_state *locate_simplify_state(struct rev_info *revs,
        return st;
 }
 
-static int mark_redundant_parents(struct rev_info *revs, struct commit *commit)
+static int mark_redundant_parents(struct commit *commit)
 {
        struct commit_list *h = reduce_heads(commit->parents);
        int i = 0, marked = 0;
@@ -2767,7 +2777,7 @@ static int mark_redundant_parents(struct rev_info *revs, struct commit *commit)
        return marked;
 }
 
-static int mark_treesame_root_parents(struct rev_info *revs, struct commit *commit)
+static int mark_treesame_root_parents(struct commit *commit)
 {
        struct commit_list *p;
        int marked = 0;
@@ -2959,8 +2969,8 @@ static struct commit_list **simplify_one(struct rev_info *revs, struct commit *c
         * Detect and simplify both cases.
         */
        if (1 < cnt) {
-               int marked = mark_redundant_parents(revs, commit);
-               marked += mark_treesame_root_parents(revs, commit);
+               int marked = mark_redundant_parents(commit);
+               marked += mark_treesame_root_parents(commit);
                if (marked)
                        marked -= leave_one_treesame_to_parent(revs, commit);
                if (marked)