merge-recursive: leave unmerged entries in the index.

This does two things.

 - When one branch renamed and the other branch did not, the
   resulting half-merged file in the working tree used to swap
   branches around and showed as if renaming side was "ours".
   This was confusing and inconsistent (even though the conflict
   markers were marked with branch names, it was not a good
   enough excuse).  This changes the order of arguments to
   mergeFile in such a case to make sure we always see "our"
   change between <<< and ===, and "their" change between ===
   and >>>.

 - When both branches renamed to the same path, and when one
   branch renamed and the other branch did not, we attempt
   mergeFile.  When this automerge conflicted, we used to
   collapse the index.  Now we use update-index --index-info
   to inject higher stage entries to leave the index in unmerged
   state for these two cases.

What this still does _not_ do is to inject unmerged state into
the index when the structural changes conflict.  I have not
thought things through what to do in each case yet, but the
cases this commit cover are the most common ones, so this would
be a good start.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 file changed
tree: 28aa147dac290ddb52840277fc4f42a597585125
  1. arm/
  2. compat/
  3. debian/
  4. Documentation/
  5. mozilla-sha1/
  6. ppc/
  7. t/
  8. templates/
  9. .gitignore
  10. apply.c
  11. blob.c
  12. blob.h
  13. cache.h
  14. cat-file.c
  15. check-ref-format.c
  16. checkout-index.c
  17. clone-pack.c
  18. cmd-rename.sh
  19. commit-tree.c
  20. commit.c
  21. commit.h
  22. config.c
  23. connect.c
  24. convert-objects.c
  25. copy.c
  26. COPYING
  27. count-delta.c
  28. count-delta.h
  29. csum-file.c
  30. csum-file.h
  31. ctype.c
  32. daemon.c
  33. date.c
  34. delta.h
  35. diff-delta.c
  36. diff-files.c
  37. diff-index.c
  38. diff-stages.c
  39. diff-tree.c
  40. diff.c
  41. diff.h
  42. diffcore-break.c
  43. diffcore-order.c
  44. diffcore-pathspec.c
  45. diffcore-pickaxe.c
  46. diffcore-rename.c
  47. diffcore.h
  48. entry.c
  49. environment.c
  50. epoch.c
  51. epoch.h
  52. fetch-pack.c
  53. fetch.c
  54. fetch.h
  55. fsck-objects.c
  56. get-tar-commit-id.c
  57. git-add.sh
  58. git-am.sh
  59. git-applymbox.sh
  60. git-applypatch.sh
  61. git-archimport.perl
  62. git-bisect.sh
  63. git-branch.sh
  64. git-checkout.sh
  65. git-cherry.sh
  66. git-clone.sh
  67. git-commit.sh
  68. git-compat-util.h
  69. git-count-objects.sh
  70. git-cvsexportcommit.perl
  71. git-cvsimport.perl
  72. git-diff.sh
  73. git-fetch.sh
  74. git-fmt-merge-msg.perl
  75. git-format-patch.sh
  76. git-grep.sh
  77. git-log.sh
  78. git-lost-found.sh
  79. git-ls-remote.sh
  80. git-merge-octopus.sh
  81. git-merge-one-file.sh
  82. git-merge-ours.sh
  83. git-merge-recursive.py
  84. git-merge-resolve.sh
  85. git-merge-stupid.sh
  86. git-merge.sh
  87. git-mv.perl
  88. git-octopus.sh
  89. git-parse-remote.sh
  90. git-prune.sh
  91. git-pull.sh
  92. git-push.sh
  93. git-rebase.sh
  94. git-relink.perl
  95. git-repack.sh
  96. git-request-pull.sh
  97. git-reset.sh
  98. git-resolve.sh
  99. git-revert.sh
  100. git-send-email.perl
  101. git-sh-setup.sh
  102. git-shortlog.perl
  103. git-status.sh
  104. git-svnimport.perl
  105. git-tag.sh
  106. git-verify-tag.sh
  107. git-whatchanged.sh
  108. git.c
  109. git.spec.in
  110. gitk
  111. gitMergeCommon.py
  112. hash-object.c
  113. http-fetch.c
  114. http-push.c
  115. http.c
  116. http.h
  117. ident.c
  118. index-pack.c
  119. index.c
  120. init-db.c
  121. INSTALL
  122. local-fetch.c
  123. ls-files.c
  124. ls-tree.c
  125. mailinfo.c
  126. mailsplit.c
  127. Makefile
  128. merge-base.c
  129. merge-index.c
  130. mktag.c
  131. name-rev.c
  132. object.c
  133. object.h
  134. pack-check.c
  135. pack-objects.c
  136. pack-redundant.c
  137. pack.h
  138. patch-delta.c
  139. patch-id.c
  140. path.c
  141. peek-remote.c
  142. pkt-line.c
  143. pkt-line.h
  144. prune-packed.c
  145. quote.c
  146. quote.h
  147. read-cache.c
  148. read-tree.c
  149. README
  150. receive-pack.c
  151. refs.c
  152. refs.h
  153. repo-config.c
  154. rev-list.c
  155. rev-parse.c
  156. rsh.c
  157. rsh.h
  158. run-command.c
  159. run-command.h
  160. send-pack.c
  161. server-info.c
  162. setup.c
  163. sha1_file.c
  164. sha1_name.c
  165. shell.c
  166. show-branch.c
  167. show-index.c
  168. ssh-fetch.c
  169. ssh-pull.c
  170. ssh-push.c
  171. ssh-upload.c
  172. strbuf.c
  173. strbuf.h
  174. stripspace.c
  175. symbolic-ref.c
  176. tag.c
  177. tag.h
  178. tar-tree.c
  179. test-date.c
  180. test-delta.c
  181. tree-diff.c
  182. tree.c
  183. tree.h
  184. unpack-file.c
  185. unpack-objects.c
  186. update-index.c
  187. update-ref.c
  188. update-server-info.c
  189. upload-pack.c
  190. usage.c
  191. var.c
  192. verify-pack.c
  193. write-tree.c