Merge branch 'jk/line-log-with-patch'
authorJunio C Hamano <gitster@pobox.com>
Tue, 9 Apr 2019 17:14:23 +0000 (02:14 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Apr 2019 17:14:23 +0000 (02:14 +0900)
"git log -L<from>,<to>:<path>" with "-s" did not suppress the patch
output as it should. This has been corrected.

* jk/line-log-with-patch:
line-log: detect unsupported formats
line-log: suppress diff output with "-s"

1  2 
revision.c
diff --combined revision.c
index eb8e51bc6302b65dfc5a921d59b2bcacd6cc19d9,fc4f33fdd5345acb703433fd2d020627f49c2f78..cb69a227d5cb9cb58c0173fac666e1ee384ba6ef
@@@ -2151,9 -2151,6 +2151,9 @@@ static int handle_revision_opt(struct r
                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;
@@@ -2650,9 -2647,6 +2650,9 @@@ int setup_revisions(int argc, const cha
        }
        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) {
        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;