All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Generic conflict style fixes
@ 2021-06-22  0:27 Felipe Contreras
  2021-06-22  0:27 ` [PATCH v2 1/4] test: add merge style config test Felipe Contreras
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Felipe Contreras @ 2021-06-22  0:27 UTC (permalink / raw)
  To: git; +Cc: Phillip Wood, Eric Sunshine, Felipe Contreras

The switch to diff3 by default got stuck on a tar pit, however that's no
reason not to improve the merge.conflictStyle handling.

I dropped all the controversial changes and focused only on the obvious
improvements.

I switched to from the custom fill function to test_write_lines as Eric
Sunshine suggested, and used a simpler and stricter grep regex for diff3
markers as Phillip Wood prompted.

Felipe Contreras (4):
  test: add merge style config test
  merge-tree: fix merge.conflictstyle handling
  notes: fix merge.conflictstyle handling
  test: document broken merge.conflictStyle handling

 builtin/merge-tree.c               |   4 +
 builtin/notes.c                    |   3 +-
 t/t6440-config-conflict-markers.sh | 116 +++++++++++++++++++++++++++++
 3 files changed, 122 insertions(+), 1 deletion(-)
 create mode 100755 t/t6440-config-conflict-markers.sh

Range-diff against v1:
1:  118388c313 ! 1:  51351f1a77 test: add merge style config test
    @@ t/t6440-config-conflict-markers.sh (new)
     +
     +. ./test-lib.sh
     +
    -+fill () {
    -+	for i
    -+	do
    -+		echo "$i"
    -+	done
    -+}
    -+
     +test_expect_success 'merge' '
     +	test_create_repo merge &&
     +	(
     +		cd merge &&
     +
    -+		fill 1 2 3 >content &&
    ++		test_write_lines 1 2 3 >content &&
     +		git add content &&
     +		git commit -m base &&
     +
    @@ t/t6440-config-conflict-markers.sh (new)
     +		git commit -a -m left &&
     +
     +		test_must_fail git merge r &&
    -+		! grep -E "\|+" content &&
    ++		! grep "^|||||||" content &&
     +
     +		git reset --hard &&
     +		test_must_fail git -c merge.conflictstyle=diff3 merge r &&
    -+		grep -E "\|+" content &&
    ++		grep "^|||||||" content &&
     +
     +		git reset --hard &&
     +		test_must_fail git -c merge.conflictstyle=merge merge r &&
    -+		! grep -E "\|+" content
    ++		! grep "^|||||||" content
     +	)
     +'
     +
2:  697f2a2a5c ! 2:  1fccf561ed merge-tree: fix merge.conflictstyle handling
    @@ t/t6440-config-conflict-markers.sh: test_expect_success 'merge' '
     +		test_commit l content l &&
     +
     +		git merge-tree initial r l >actual &&
    -+		! grep -E "\|+" actual &&
    ++		! grep "^+|||||||" content &&
     +
     +		git -c merge.conflictstyle=diff3 merge-tree initial r l >actual &&
    -+		grep -E "\|+" actual &&
    ++		grep "^+|||||||" actual &&
     +
     +		git -c merge.conflictstyle=merge merge-tree initial r l >actual &&
    -+		! grep -E "\|+" actual
    ++		! grep "^+|||||||" content
     +	)
     +'
     +
3:  56a20f41a4 ! 3:  3bb872e3cd notes: fix merge.conflictstyle handling
    @@ t/t6440-config-conflict-markers.sh: test_expect_success 'merge-tree' '
     +		git notes add -f -m l initial &&
     +
     +		test_must_fail git notes merge r &&
    -+		! grep -E "\|+" .git/NOTES_MERGE_WORKTREE/* &&
    ++		! grep "^|||||||" .git/NOTES_MERGE_WORKTREE/* &&
     +
     +		git notes merge --abort &&
     +		test_must_fail git -c merge.conflictstyle=diff3 notes merge r &&
    -+		grep -E "\|+" .git/NOTES_MERGE_WORKTREE/* &&
    ++		grep "^|||||||" .git/NOTES_MERGE_WORKTREE/* &&
     +
     +		git notes merge --abort &&
     +		test_must_fail git -c merge.conflictstyle=merge notes merge r &&
    -+		! grep -E "\|+" .git/NOTES_MERGE_WORKTREE/*
    ++		! grep "^|||||||" .git/NOTES_MERGE_WORKTREE/*
     +	)
     +'
     +
4:  adce598754 < -:  ---------- checkout: fix merge.conflictstyle handling
5:  a4ddbbc44a < -:  ---------- xdiff: rename XDL_MERGE_STYLE_DIFF3
6:  c3e0940dab < -:  ---------- xdiff: simplify style assignments
7:  6415e53345 < -:  ---------- xdiff: make diff3 the default conflictStyle
-:  ---------- > 4:  a767bc68e6 test: document broken merge.conflictStyle handling
-- 
2.32.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-22  0:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22  0:27 [PATCH v2 0/4] Generic conflict style fixes Felipe Contreras
2021-06-22  0:27 ` [PATCH v2 1/4] test: add merge style config test Felipe Contreras
2021-06-22  0:27 ` [PATCH v2 2/4] merge-tree: fix merge.conflictstyle handling Felipe Contreras
2021-06-22  0:27 ` [PATCH v2 3/4] notes: " Felipe Contreras
2021-06-22  0:27 ` [PATCH v2 4/4] test: document broken merge.conflictStyle handling Felipe Contreras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.