git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/9] "git apply --3way"

From
Junio C Hamano <gitster@pobox.com>
Date
May 10, 2012, 22:32 UTC
Message-ID
<1336689173-15822-1-git-send-email-gitster@pobox.com>
Here is its second round.  Changes from the previous one are:
 - The series has been reordered to have refactoring patches early.
 - The option name is corrected to "--3way" and also takes short-and-sweet
   "-3" to parallel "am".
 - An invocation to ask "--3way" together with "--reject" is rejected.
 - The rerere machinery is given a chance to work on the resulting
   conflicts.
 - The option is now documented.

There are minor things that I still find suboptimal, but as a standalone new feature, I consider it more or less good to go otherwise.

Here are some things people might be interested in enhancing (hint, hint):
 - Buffer error() messages from the first pass (i.e. attempting to apply
   to your current version) if the command is running under --3way mode,
   and show them if it turns out that we cannot fall back to the three-way
   logic (e.g. when the preimage on which the patch was allegedly based is
   not available, or the patch fails to apply to such a preimage).
   Otherwise discard the error messages from the first pass and show only
   the messages from the three-way merge phase.
 - Probably support add/add conflicts.  Note that this is prevented much
   earlier in the codepath and some surgery is needed to allow us to skip
   the first pass and go directly to the three-way codepath.
 - Similarly, a patch that attempts to delete a path that you no longer
   have is rejected early in the codepath. I have a hunch that it is not
   worth worrying about, because we do not know what we removed and cannot
   tell if what they removed is compatible with our earlier removal.
Junio C Hamano (9):
  apply: clear_image() clears things a bit more
  apply: refactor read_file_or_gitlink()
  apply: split load_preimage() helper function out
  apply: accept -3/--3way command line option
  apply: fall back on three-way merge
  apply: plug the three-way merge logic in
  apply: register conflicted stages to the index
  apply: allow rerere() upon --3way results
  apply: document --3way option
 Documentation/git-apply.txt |  10 ++-
 builtin/apply.c             | 202 +++++++++++++++++++++++++++++++++++++++-----
 t/t4108-apply-threeway.sh   | 103 ++++++++++++++++++++++
 t/t4117-apply-reject.sh     |   8 ++
 4 files changed, 303 insertions(+), 20 deletions(-)
 create mode 100755 t/t4108-apply-threeway.sh
-- 
1.7.10.1.574.g840b38f
Next: Junio C Hamano
Message 1 of 10 in “"git apply --3way"”
  1. 0/9 "git apply --3way"Junio C Hamano, May 10, 2012
  2. 1/9 apply: clear_image() clears things a bit moreJunio C Hamano, May 10, 2012
  3. 2/9 apply: refactor read_file_or_gitlink()Junio C Hamano, May 10, 2012
  4. 3/9 apply: split load_preimage() helper function outJunio C Hamano, May 10, 2012
  5. 4/9 apply: accept -3/--3way command line optionJunio C Hamano, May 10, 2012
  6. 5/9 apply: fall back on three-way mergeJunio C Hamano, May 10, 2012
  7. 6/9 apply: plug the three-way merge logic inJunio C Hamano, May 10, 2012
  8. 7/9 apply: register conflicted stages to the indexJunio C Hamano, May 10, 2012
  9. 8/9 apply: allow rerere() upon --3way resultsJunio C Hamano, May 10, 2012
  10. 9/9 apply: document --3way optionJunio C Hamano, May 10, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.