diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-08-17 17:02:49 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-17 17:02:49 -0700 |
commit | eca8c62a50e033ce6a4f4e065bb507ca3d98e75c (patch) | |
tree | f36173d168e17cd1ac0ce95daa3c7351db14260e /builtin/log.c | |
parent | Merge branch 'ma/stop-progress-null-fix' (diff) | |
parent | doc/git-log: clarify handling of merge commit diffs (diff) | |
download | tgif-eca8c62a50e033ce6a4f4e065bb507ca3d98e75c.tar.xz |
Merge branch 'jk/log-fp-implies-m'
"git log --first-parent -p" showed patches only for single-parent
commits on the first-parent chain; the "--first-parent" option has
been made to imply "-m". Use "--no-diff-merges" to restore the
previous behaviour to omit patches for merge commits.
* jk/log-fp-implies-m:
doc/git-log: clarify handling of merge commit diffs
doc/git-log: move "-t" into diff-options list
doc/git-log: drop "-r" diff option
doc/git-log: move "Diff Formatting" from rev-list-options
log: enable "-m" automatically with "--first-parent"
revision: add "--no-diff-merges" option to counteract "-m"
log: drop "--cc implies -m" logic
Diffstat (limited to 'builtin/log.c')
-rw-r--r-- | builtin/log.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/log.c b/builtin/log.c index 33528fefa9..b58f8da09e 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -599,8 +599,8 @@ static int show_tree_object(const struct object_id *oid, static void show_setup_revisions_tweak(struct rev_info *rev, struct setup_revision_opt *opt) { - if (rev->ignore_merges) { - /* There was no "-m" on the command line */ + if (rev->ignore_merges < 0) { + /* There was no "-m" variant on the command line */ rev->ignore_merges = 0; if (!rev->first_parent_only && !rev->combine_merges) { /* No "--first-parent", "-c", or "--cc" */ @@ -732,8 +732,7 @@ static void log_setup_revisions_tweak(struct rev_info *rev, if (!rev->diffopt.output_format && rev->combine_merges) rev->diffopt.output_format = DIFF_FORMAT_PATCH; - /* Turn -m on when --cc/-c was given */ - if (rev->combine_merges) + if (rev->first_parent_only && rev->ignore_merges < 0) rev->ignore_merges = 0; } |