These patch series implement new set of options governing the diff output of merge commits, all under the umbrella of the single --diff-merges=<mode> option. Most of the new options being synonyms for -m/-c/--cc options, there is also additional functionality provided, allowing to get the format of "-p --first-parent" without change in history traversal that --first-parent option causes. The net result of these series are the following new options: --diff-merges= | old equivalent -----------------+---------------- first-parent | --first-parent (only format implications) separate | -m combined | -c dense-combined | --cc The series also cleanup logic of handling of diff merges options and fix an issue found in the original implementation where logically mutually exclusive options -m/-c/--cc failed to actually override each other. The series start with the set of pure refactoring commits that are expected to introduce no functional changes. These are all commits up to and including: "diff-merges: revise revs->diff flag handling" The aim of these commits is to isolate options handling for diff merges so that it could be easily understood and tweaked to ease introduction of the new options. Then the fix of -m/-c/-cc overriding issue follows, starting with a failing test and followed by the fix. Then follows a little bit of additional refactoring in order to prepare for introduction of the new options, and finally the series are finished by the implementation, testing, and documentation update for the new options. Updates in v1: * Added documentation fix for git-show to include --diff-merges. * Fixed typos in commit messages noticed by Philip Oakley. Sergey Organov (27): revision: factor out parsing of diff-merge related options revision: factor out setup of diff-merge related settings revision: factor out initialization of diff-merge related settings revision: provide implementation for diff merges tweaks revision: move diff merges functions to its own diff-merges.c diff-merges: rename all functions to have common prefix diff-merges: move checks for first_parent_only out of the module diff-merges: rename diff_merges_default_to_enable() to match semantics diff-merges: re-arrange functions to match the order they are called in diff-merges: new function diff_merges_suppress() diff-merges: new function diff_merges_set_dense_combined_if_unset() diff-merges: introduce revs->first_parent_merges flag diff-merges: revise revs->diff flag handling t4013: support test_expect_failure through ':failure' magic t4013: add tests for -m failing to override -c/--cc diff-merges: fix -m to properly override -c/--cc diff-merges: split 'ignore_merges' field diff-merges: group diff-merge flags next to each other inside 'rev_info' diff-merges: get rid of now empty diff_merges_init_revs() diff-merges: refactor opt settings into separate functions diff-merges: make -m/-c/--cc explicitly mutually exclusive diff-merges: implement new values for --diff-merges t4013: add test for --diff-merges=first-parent doc/git-log: describe new --diff-merges options doc/diff-generate-patch: mention new --diff-merges option doc/rev-list-options: document --first-parent implies --diff-merges=first-parent doc/git-show: include --diff-merges description Documentation/diff-generate-patch.txt | 6 +- Documentation/diff-options.txt | 54 +++++ Documentation/git-log.txt | 39 ---- Documentation/git-show.txt | 8 +- Documentation/rev-list-options.txt | 3 + Makefile | 1 + builtin/diff-files.c | 5 +- builtin/diff.c | 9 +- builtin/log.c | 18 +- builtin/merge.c | 3 +- diff-merges.c | 120 +++++++++++ diff-merges.h | 18 ++ fmt-merge-msg.c | 3 +- log-tree.c | 17 +- revision.c | 38 +--- revision.h | 7 +- t/t4013-diff-various.sh | 10 +- t/t4013/diff.log_--cc_-m_-p_master | 200 ++++++++++++++++++ t/t4013/diff.log_-c_-m_-p_master | 200 ++++++++++++++++++ ...f.log_-p_--diff-merges=first-parent_master | 137 ++++++++++++ 20 files changed, 788 insertions(+), 108 deletions(-) create mode 100644 diff-merges.c create mode 100644 diff-merges.h create mode 100644 t/t4013/diff.log_--cc_-m_-p_master create mode 100644 t/t4013/diff.log_-c_-m_-p_master create mode 100644 t/t4013/diff.log_-p_--diff-merges=first-parent_master -- 2.25.1