{"thread":{"id":"1936","subject":"[PATCH] Finish documenting trivial merge rules","startedAt":"2005-09-25T03:50:04Z","lastAt":"2005-09-25T03:50:04Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9249","messageId":"Pine.LNX.4.63.0509242349270.23242@iabervon.org","threadId":"1936","inReplyTo":null,"subject":"[PATCH] Finish documenting trivial merge rules","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-09-25T03:50:04Z","receivedAt":"2005-09-25T03:50:04Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"Fix missing symbol explanations, a few incorrect cases, and add\ntwo-way merge rules.\n\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n\n---\n\n Documentation/technical/trivial-merge.txt |   49 +++++++++++++++++++++++------\n 1 files changed, 39 insertions(+), 10 deletions(-)\n\nad07d5f3075c8749ec16559566fa338c1be1b873\ndiff --git a/Documentation/technical/trivial-merge.txt b/Documentation/technical/trivial-merge.txt\n--- a/Documentation/technical/trivial-merge.txt\n+++ b/Documentation/technical/trivial-merge.txt\n@@ -10,6 +10,9 @@ This replaces the index with a different\n for entries that don't change, and allowing -u to make the minimum\n required changes to the working tree to have it match.\n \n+Entries marked '+' have stat information. Spaces marked '*' don't\n+affect the result.\n+\n    index   tree    result\n    -----------------------\n    *       (empty) (empty)\n@@ -20,7 +23,30 @@ required changes to the working tree to \n Two-way merge\n -------------\n \n+It is permitted for the index to lack an entry; this does not prevent\n+any case from applying.\n+\n+If the index exists, it is an error for it not to match either the old\n+or the result.\n+\n+If multiple cases apply, the one used is listed first.\n+\n+A result which changes the index is an error if the index is not empty\n+and not up-to-date.\n+\n+Entries marked '+' have stat information. Spaces marked '*' don't\n+affect the result.\n \n+ case  index   old     new     result\n+ -------------------------------------\n+ 0/2   (empty) *       (empty) (empty)\n+ 1/3   (empty) *       new     new\n+ 4/5   index+  (empty) (empty) index+\n+ 6/7   index+  (empty) index   index+\n+ 10    index+  index   (empty) (empty)\n+ 14/15 index+  old     old     index+\n+ 18/19 index+  old     index   index+\n+ 20    index+  index   new     new\n \n Three-way merge\n ---------------\n@@ -44,30 +70,28 @@ up-to-date.\n *empty* means that the tree must not have a directory-file conflict\n  with the entry.\n \n-For multiple ancestors or remotes, a '+' means that this case applies\n-even if only one ancestor or remote fits; normally, all of the\n-ancestors or remotes must be the same.\n+For multiple ancestors, a '+' means that this case applies even if\n+only one ancestor or remote fits; a '^' means all of the ancestors\n+must be the same.\n \n case  ancest    head    remote    result\n ----------------------------------------\n 1     (empty)+  (empty) (empty)   (empty)\n 2ALT  (empty)+  *empty* remote    remote\n-2ALT  (empty)+  *empty* remote    remote\n 2     (empty)^  (empty) remote    no merge\n 3ALT  (empty)+  head    *empty*   head\n 3     (empty)^  head    (empty)   no merge\n 4     (empty)^  head    remote    no merge\n 5ALT  *         head    head      head\n-6     ancest^   (empty) (empty)   no merge\n-8ALT  ancest    (empty) ancest    (empty)\n+6     ancest+   (empty) (empty)   no merge\n+8     ancest^   (empty) ancest    no merge\n 7     ancest+   (empty) remote    no merge\n+10    ancest^   ancest  (empty)   no merge\n 9     ancest+   head    (empty)   no merge\n-10ALT ancest    ancest  (empty)   (empty)\n-11    ancest+   head    remote    no merge\n 16    anc1/anc2 anc1    anc2      no merge\n 13    ancest+   head    ancest    head\n 14    ancest+   ancest  remote    remote\n-14ALT ancest+   ancest  remote    remote\n+11    ancest+   head    remote    no merge\n \n Only #2ALT and #3ALT use *empty*, because these are the only cases\n where there can be conflicts that didn't exist before. Note that we\n@@ -89,4 +113,9 @@ right. This is a case of a reverted patc\n multiple times), and the right answer depends on looking at crossings\n of history or common ancestors of the ancestors.\n \n-The status as of Sep 5 is that multiple remotes are not supported\n\\ No newline at end of file\n+Note that, between #6, #7, #9, and #11, all cases not otherwise\n+covered are handled in this table.\n+\n+For #8 and #10, there is alternative behavior, not currently\n+implemented, where the result is (empty). As currently implemented,\n+the automatic merge will generally give this effect.\n"}]}