]> Kevux Git Server - rit/commit
am: switch from merge_recursive_generic() to merge_ort_generic()
authorElijah Newren <newren@gmail.com>
Thu, 13 Mar 2025 02:46:41 +0000 (02:46 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Mar 2025 16:49:08 +0000 (09:49 -0700)
commit947e219fb6b1acc3d276d0b50ebf411c252a40bd
treecaea9188d862ebdb8a19ab8c58f2fafc961015c3
parenta16e8efe5c2bf7317f17b049bd654b6993ddefec
am: switch from merge_recursive_generic() to merge_ort_generic()

Switch from merge-recursive to merge-ort.  Adjust the following
testcases due to the switch:

* t4151: This test left an untracked file in the way of the merge.
  merge-recursive could only sometimes tell when untracked files were
  in the way, and by the time it discovers others, it has already made
  too many changes to back out of the merge.  So, instead of writing the
  results to e.g. 'file1' it would instead write them to
  'file1~branch1'.  This is confusing for users, because they might not
  notice 'file1~branch1' and accidentally add and commit 'file1'.
  In contrast, merge-ort correctly notices the file in the way before
  making any changes and aborts.  Since this test didn't care about the
  file in the way, just remove it before calling git-am.

* t4255: Usage of merge-ort allows us to change two known failures into
  successes.

* t6427: As noted a few commits ago, the choice of conflict label for
  diff3 markers for the ancestor commit was previously handled by
  merge-recursive.c rather than by callers.  Since that has now changed,
  `git am` needs to specify that label.  Although the previous conflict
  label ("constructed merge base") was already fairly somewhat slanted
  towards `git am`, let's use wording more along the lines of the
  related command-line flag from `git apply` and function involved to
  tie it more closely to `git am`.

Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c
t/t4151-am-abort.sh
t/t4255-am-submodule.sh
t/t6427-diff3-conflict-markers.sh