Skip to content

Commit 8c6da01

Browse files
committed
WIP: remerge-diff: suppress conflict marker labels
TODO: Deliberate whether this makes sense only optionally, e.g. with `range-diff --diff-merges=remerge`. If so: How to do that? Do we need to avoid the spawned `git log` calls in `range-diff.c` for that, in which case we face a then-again-premature optimization again that I fixed in ab75a56 (log: --remerge-diff needs to keep around commit parents, 2024-11-08). Besides, that would need to be refactored into its own patch as it would otherwise over-extend the scope. TODO: add a test case that demonstrates how this is useful. TODO: explain in the commit message why this is useful. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent eeca09d commit 8c6da01

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

log-tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ static int do_remerge_diff(struct rev_info *opt,
10251025
init_ui_merge_options(&o, the_repository);
10261026
o.show_rename_progress = 0;
10271027
o.record_conflict_msgs_as_headers = 1;
1028+
o.suppress_conflict_labels = 1;
10281029
o.msg_header_prefix = "remerge";
10291030

10301031
ctx.abbrev = DEFAULT_ABBREV;

merge-ort.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,11 @@ static int merge_3way(struct merge_options *opt,
20852085
}
20862086

20872087
assert(pathnames[0] && pathnames[1] && pathnames[2] && opt->ancestor);
2088-
if (pathnames[0] == pathnames[1] && pathnames[1] == pathnames[2]) {
2088+
if (opt->suppress_conflict_labels) {
2089+
base = xstrdup("");
2090+
name1 = xstrdup("");
2091+
name2 = xstrdup("");
2092+
} else if (pathnames[0] == pathnames[1] && pathnames[1] == pathnames[2]) {
20892093
base = mkpathdup("%s", opt->ancestor);
20902094
name1 = mkpathdup("%s", opt->branch1);
20912095
name2 = mkpathdup("%s", opt->branch2);

merge-recursive.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct merge_options {
4848
const char *subtree_shift;
4949
unsigned renormalize : 1;
5050
unsigned record_conflict_msgs_as_headers : 1;
51+
unsigned suppress_conflict_labels : 1;
5152
const char *msg_header_prefix;
5253

5354
/* internal fields used by the implementation */

0 commit comments

Comments
 (0)