merge-ort: add implementation of checkout()

Since merge-ort creates a tree for its output, when there are no
conflicts, updating the working tree and index is as simple as using the
unpack_trees() machinery with a twoway_merge (i.e. doing the equivalent
of a "checkout" operation).

If there were conflicts in the merge, then since the tree we created
included all the conflict markers, then using the unpack_trees machinery
in this manner will still update the working tree correctly.  Further,
all index entries corresponding to cleanly merged files will also be
updated correctly by this procedure.  Index entries corresponding to
conflicted entries will appear as though the user had run "git add -u"
after the merge to accept all files as-is with conflict markers.

Thus, after running unpack_trees(), there needs to be a separate step
for updating the entries in the index corresponding to conflicted files.
This will be the job for the function record_conflicted_index_entris(),
which will be implemented in a subsequent commit.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 file changed
tree: 7fef8227e9700f01008f2d680e49691979c76d3f
  1. .github/
  2. block-sha1/
  3. builtin/
  4. ci/
  5. compat/
  6. contrib/
  7. Documentation/
  8. ewah/
  9. git-gui/
  10. gitk-git/
  11. gitweb/
  12. mergetools/
  13. negotiator/
  14. perl/
  15. po/
  16. ppc/
  17. refs/
  18. sha1dc/
  19. sha256/
  20. t/
  21. templates/
  22. trace2/
  23. vcs-svn/
  24. xdiff/
  25. .cirrus.yml
  26. .clang-format
  27. .editorconfig
  28. .gitattributes
  29. .gitignore
  30. .gitmodules
  31. .mailmap
  32. .travis.yml
  33. .tsan-suppressions
  34. abspath.c
  35. aclocal.m4
  36. add-interactive.c
  37. add-interactive.h
  38. add-patch.c
  39. advice.c
  40. advice.h
  41. alias.c
  42. alias.h
  43. alloc.c
  44. alloc.h
  45. apply.c
  46. apply.h
  47. archive-tar.c
  48. archive-zip.c
  49. archive.c
  50. archive.h
  51. attr.c
  52. attr.h
  53. banned.h
  54. base85.c
  55. bisect.c
  56. bisect.h
  57. blame.c
  58. blame.h
  59. blob.c
  60. blob.h
  61. bloom.c
  62. bloom.h
  63. branch.c
  64. branch.h
  65. builtin.h
  66. bulk-checkin.c
  67. bulk-checkin.h
  68. bundle.c
  69. bundle.h
  70. cache-tree.c
  71. cache-tree.h
  72. cache.h
  73. chdir-notify.c
  74. chdir-notify.h
  75. check-builtins.sh
  76. check_bindir
  77. checkout.c
  78. checkout.h
  79. CODE_OF_CONDUCT.md
  80. color.c
  81. color.h
  82. column.c
  83. column.h
  84. combine-diff.c
  85. command-list.txt
  86. commit-graph.c
  87. commit-graph.h
  88. commit-reach.c
  89. commit-reach.h
  90. commit-slab-decl.h
  91. commit-slab-impl.h
  92. commit-slab.h
  93. commit.c
  94. commit.h
  95. common-main.c
  96. config.c
  97. config.h
  98. config.mak.dev
  99. config.mak.in
  100. config.mak.uname
  101. configure.ac
  102. connect.c
  103. connect.h
  104. connected.c
  105. connected.h
  106. convert.c
  107. convert.h
  108. copy.c
  109. COPYING
  110. credential.c
  111. credential.h
  112. csum-file.c
  113. csum-file.h
  114. ctype.c
  115. daemon.c
  116. date.c
  117. decorate.c
  118. decorate.h
  119. delta-islands.c
  120. delta-islands.h
  121. delta.h
  122. detect-compiler
  123. diff-delta.c
  124. diff-lib.c
  125. diff-no-index.c
  126. diff.c
  127. diff.h
  128. diffcore-break.c
  129. diffcore-delta.c
  130. diffcore-order.c
  131. diffcore-pickaxe.c
  132. diffcore-rename.c
  133. diffcore.h
  134. dir-iterator.c
  135. dir-iterator.h
  136. dir.c
  137. dir.h
  138. editor.c
  139. entry.c
  140. environment.c
  141. exec-cmd.c
  142. exec-cmd.h
  143. fetch-negotiator.c
  144. fetch-negotiator.h
  145. fetch-pack.c
  146. fetch-pack.h
  147. fmt-merge-msg.c
  148. fmt-merge-msg.h
  149. fsck.c
  150. fsck.h
  151. fsmonitor.c
  152. fsmonitor.h
  153. fuzz-commit-graph.c
  154. fuzz-pack-headers.c
  155. fuzz-pack-idx.c
  156. generate-cmdlist.sh
  157. generate-configlist.sh
  158. gettext.c
  159. gettext.h
  160. git-add--interactive.perl
  161. git-archimport.perl
  162. git-bisect.sh
  163. git-compat-util.h
  164. git-cvsexportcommit.perl
  165. git-cvsimport.perl
  166. git-cvsserver.perl
  167. git-difftool--helper.sh
  168. git-filter-branch.sh
  169. git-instaweb.sh
  170. git-merge-octopus.sh
  171. git-merge-one-file.sh
  172. git-merge-resolve.sh
  173. git-mergetool--lib.sh
  174. git-mergetool.sh
  175. git-p4.py
  176. git-parse-remote.sh
  177. git-quiltimport.sh
  178. git-rebase--preserve-merges.sh
  179. git-request-pull.sh
  180. git-send-email.perl
  181. git-sh-i18n.sh
  182. git-sh-setup.sh
  183. git-submodule.sh
  184. git-svn.perl
  185. GIT-VERSION-GEN
  186. git-web--browse.sh
  187. git.c
  188. git.rc
  189. gpg-interface.c
  190. gpg-interface.h
  191. graph.c
  192. graph.h
  193. grep.c
  194. grep.h
  195. hash.h
  196. hashmap.c
  197. hashmap.h
  198. help.c
  199. help.h
  200. hex.c
  201. http-backend.c
  202. http-fetch.c
  203. http-push.c
  204. http-walker.c
  205. http.c
  206. http.h
  207. ident.c
  208. imap-send.c
  209. INSTALL
  210. iterator.h
  211. json-writer.c
  212. json-writer.h
  213. khash.h
  214. kwset.c
  215. kwset.h
  216. levenshtein.c
  217. levenshtein.h
  218. LGPL-2.1
  219. line-log.c
  220. line-log.h
  221. line-range.c
  222. line-range.h
  223. linear-assignment.c
  224. linear-assignment.h
  225. list-objects-filter-options.c
  226. list-objects-filter-options.h
  227. list-objects-filter.c
  228. list-objects-filter.h
  229. list-objects.c
  230. list-objects.h
  231. list.h
  232. ll-merge.c
  233. ll-merge.h
  234. lockfile.c
  235. lockfile.h
  236. log-tree.c
  237. log-tree.h
  238. ls-refs.c
  239. ls-refs.h
  240. mailinfo.c
  241. mailinfo.h
  242. mailmap.c
  243. mailmap.h
  244. Makefile
  245. match-trees.c
  246. mem-pool.c
  247. mem-pool.h
  248. merge-blobs.c
  249. merge-blobs.h
  250. merge-ort-wrappers.c
  251. merge-ort-wrappers.h
  252. merge-ort.c
  253. merge-ort.h
  254. merge-recursive.c
  255. merge-recursive.h
  256. merge.c
  257. mergesort.c
  258. mergesort.h
  259. midx.c
  260. midx.h
  261. name-hash.c
  262. notes-cache.c
  263. notes-cache.h
  264. notes-merge.c
  265. notes-merge.h
  266. notes-utils.c
  267. notes-utils.h
  268. notes.c
  269. notes.h
  270. object-store.h
  271. object.c
  272. object.h
  273. oid-array.c
  274. oid-array.h
  275. oidmap.c
  276. oidmap.h
  277. oidset.c
  278. oidset.h
  279. pack-bitmap-write.c
  280. pack-bitmap.c
  281. pack-bitmap.h
  282. pack-check.c
  283. pack-objects.c
  284. pack-objects.h
  285. pack-revindex.c
  286. pack-revindex.h
  287. pack-write.c
  288. pack.h
  289. packfile.c
  290. packfile.h
  291. pager.c
  292. parse-options-cb.c
  293. parse-options.c
  294. parse-options.h
  295. patch-delta.c
  296. patch-ids.c
  297. patch-ids.h
  298. path.c
  299. path.h
  300. pathspec.c
  301. pathspec.h
  302. pkt-line.c
  303. pkt-line.h
  304. preload-index.c
  305. pretty.c
  306. pretty.h
  307. prio-queue.c
  308. prio-queue.h
  309. progress.c
  310. progress.h
  311. promisor-remote.c
  312. promisor-remote.h
  313. prompt.c
  314. prompt.h
  315. protocol.c
  316. protocol.h
  317. prune-packed.c
  318. prune-packed.h
  319. quote.c
  320. quote.h
  321. range-diff.c
  322. range-diff.h
  323. reachable.c
  324. reachable.h
  325. read-cache.c
  326. README.md
  327. rebase-interactive.c
  328. rebase-interactive.h
  329. rebase.c
  330. rebase.h
  331. ref-filter.c
  332. ref-filter.h
  333. reflog-walk.c
  334. reflog-walk.h
  335. refs.c
  336. refs.h
  337. refspec.c
  338. refspec.h
  339. remote-curl.c
  340. remote.c
  341. remote.h
  342. replace-object.c
  343. replace-object.h
  344. repo-settings.c
  345. repository.c
  346. repository.h
  347. rerere.c
  348. rerere.h
  349. reset.c
  350. reset.h
  351. resolve-undo.c
  352. resolve-undo.h
  353. revision.c
  354. revision.h
  355. run-command.c
  356. run-command.h
  357. send-pack.c
  358. send-pack.h
  359. sequencer.c
  360. sequencer.h
  361. serve.c
  362. serve.h
  363. server-info.c
  364. setup.c
  365. sh-i18n--envsubst.c
  366. sha1-file.c
  367. sha1-lookup.c
  368. sha1-lookup.h
  369. sha1-name.c
  370. sha1dc_git.c
  371. sha1dc_git.h
  372. shallow.c
  373. shallow.h
  374. shell.c
  375. shortlog.h
  376. sideband.c
  377. sideband.h
  378. sigchain.c
  379. sigchain.h
  380. split-index.c
  381. split-index.h
  382. stable-qsort.c
  383. strbuf.c
  384. strbuf.h
  385. streaming.c
  386. streaming.h
  387. string-list.c
  388. string-list.h
  389. strmap.c
  390. strmap.h
  391. strvec.c
  392. strvec.h
  393. sub-process.c
  394. sub-process.h
  395. submodule-config.c
  396. submodule-config.h
  397. submodule.c
  398. submodule.h
  399. symlinks.c
  400. tag.c
  401. tag.h
  402. tar.h
  403. tempfile.c
  404. tempfile.h
  405. thread-utils.c
  406. thread-utils.h
  407. tmp-objdir.c
  408. tmp-objdir.h
  409. trace.c
  410. trace.h
  411. trace2.c
  412. trace2.h
  413. trailer.c
  414. trailer.h
  415. transport-helper.c
  416. transport-internal.h
  417. transport.c
  418. transport.h
  419. tree-diff.c
  420. tree-walk.c
  421. tree-walk.h
  422. tree.c
  423. tree.h
  424. unicode-width.h
  425. unimplemented.sh
  426. unix-socket.c
  427. unix-socket.h
  428. unpack-trees.c
  429. unpack-trees.h
  430. upload-pack.c
  431. upload-pack.h
  432. url.c
  433. url.h
  434. urlmatch.c
  435. urlmatch.h
  436. usage.c
  437. userdiff.c
  438. userdiff.h
  439. utf8.c
  440. utf8.h
  441. varint.c
  442. varint.h
  443. version.c
  444. version.h
  445. versioncmp.c
  446. walker.c
  447. walker.h
  448. wildmatch.c
  449. wildmatch.h
  450. worktree.c
  451. worktree.h
  452. wrap-for-bin.sh
  453. wrapper.c
  454. write-or-die.c
  455. ws.c
  456. wt-status.c
  457. wt-status.h
  458. xdiff-interface.c
  459. xdiff-interface.h
  460. zlib.c
README.md

Build status

Git - fast, scalable, distributed revision control system

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Git is an Open Source project covered by the GNU General Public License version 2 (some parts of it are under different licenses, compatible with the GPLv2). It was originally written by Linus Torvalds with help of a group of hackers around the net.

Please read the file INSTALL for installation instructions.

Many Git online resources are accessible from https://git-scm.com/ including full documentation and Git related tools.

See Documentation/gittutorial.txt to get started, then see Documentation/giteveryday.txt for a useful minimum set of commands, and Documentation/git-<commandname>.txt for documentation of each command. If git has been correctly installed, then the tutorial can also be read with man gittutorial or git help tutorial, and the documentation of each command with man git-<commandname> or git help <commandname>.

CVS users may also want to read Documentation/gitcvs-migration.txt (man gitcvs-migration or git help cvs-migration if git is installed).

The user discussion and development of Git take place on the Git mailing list -- everyone is welcome to post bug reports, feature requests, comments and patches to git@vger.kernel.org (read Documentation/SubmittingPatches for instructions on patch submission). To subscribe to the list, send an email with just “subscribe git” in the body to majordomo@vger.kernel.org. The mailing list archives are available at https://lore.kernel.org/git/, http://marc.info/?l=git and other archival sites.

Issues which are security relevant should be disclosed privately to the Git Security mailing list git-security@googlegroups.com.

The maintainer frequently sends the “What's cooking” reports that list the current status of various development topics to the mailing list. The discussion following them give a good reference for project status, development direction and remaining tasks.

The name “git” was given by Linus Torvalds when he wrote the very first version. He described the tool as “the stupid content tracker” and the name as (depending on your mood):

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of “get” may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • “global information tracker”: you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • “goddamn idiotic truckload of sh*t”: when it breaks