Skip to content

git-log: implement new --diff-merge options

Sergey Organov git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26revision: factor out parsing of diff-merge related optionsrevision.c+39 -270 replies
2/26revision: factor out setup of diff-merge related settingsrevision.c+12 -60 replies
3/26revision: factor out initialization of diff-merge related settingsrevision.c+7 -10 replies
4/26revision: provide implementation for diff merges tweaksbuiltin/log.c revision.c revision.h+22 -110 replies
5/26revision: move diff merges functions to its own diff-merges.cMakefile builtin/log.c diff-merges.c +3 more+87 -740 replies
6/26diff-merges: rename all functions to have common prefixbuiltin/log.c diff-merges.c diff-merges.h +1 more+20 -150 replies
7/26diff-merges: move checks for first_parent_only out of the modulebuiltin/log.c diff-merges.c diff-merges.h+11 -90 replies
8/26diff-merges: rename diff_merges_default_to_enable() to match semanticsbuiltin/log.c diff-merges.c diff-merges.h+4 -40 replies
9/26diff-merges: re-arrange functions to match the order they are called indiff-merges.c diff-merges.h+17 -140 replies
10/26diff-merges: new function diff_merges_suppress()builtin/merge.c diff-merges.c diff-merges.h +1 more+20 -64 replies
11/26diff-merges: new function diff_merges_set_dense_combined_if_unset()builtin/diff-files.c builtin/diff.c diff-merges.c +1 more+21 -60 replies
12/26diff-merges: introduce revs->first_parent_merges flagdiff-merges.c log-tree.c revision.h+5 -20 replies
13/26diff-merges: revise revs->diff flag handlingdiff-merges.c+2 -30 replies
14/26t4013: support test_expect_failure through ':failure' magict/t4013-diff-various.sh+6 -10 replies
15/26t4013: add tests for -m failing to override -c/--cct/t4013-diff-various.sh t/t4013/diff.log_--cc_-m_-p_master t/t4013/diff.log_-c_-m_-p_master+402 -00 replies
16/26diff-merges: fix -m to properly override -c/--ccdiff-merges.c t/t4013-diff-various.sh+3 -20 replies
17/26diff-merges: split 'ignore_merges' fielddiff-merges.c log-tree.c revision.h+22 -252 replies
18/26diff-merges: group diff-merge flags next to each other inside 'rev_info'revision.h+3 -20 replies
19/26diff-merges: get rid of now empty diff_merges_init_revs()diff-merges.c diff-merges.h revision.c+0 -61 reply
20/26diff-merges: refactor opt settings into separate functionsdiff-merges.c+37 -220 replies
21/26diff-merges: make -m/-c/--cc explicitly mutually exclusivediff-merges.c+3 -00 replies
22/26diff-merges: implement new values for --diff-mergesdiff-merges.c+16 -30 replies
23/26t4013: add test for --diff-merges=first-parentt/t4013-diff-various.sh t/t4013/diff.log_-p_--diff-merges=first-parent_master+138 -00 replies
24/26doc/git-log: describe new --diff-merges optionsDocumentation/git-log.txt+46 -330 replies
25/26doc/diff-generate-patch: mention new --diff-merges optionDocumentation/diff-generate-patch.txt+3 -30 replies
26/26doc/rev-list-options: document --first-parent implies --diff-merges=first-parentDocumentation/rev-list-options.txt+3 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/26] git-log: implement new --diff-merge options

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.

Sergey Organov (26):
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

 Documentation/diff-generate-patch.txt         |   6 +-
 Documentation/git-log.txt                     |  79 ++++---
 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 ++++++++++++
 18 files changed, 774 insertions(+), 100 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
Signature · 1 line
2.25.1