rebase: implement --merge via the interactive machinery

As part of an ongoing effort to make rebase have more uniform behavior,
modify the merge backend to behave like the interactive one, by
re-implementing it on top of the latter.

Interactive rebases are implemented in terms of cherry-pick rather than
the merge-recursive builtin, but cherry-pick also calls into the
recursive merge machinery by default and can accept special merge
strategies and/or special strategy options.  As such, there really is
not any need for having both git-rebase--merge and
git-rebase--interactive anymore.  Delete git-rebase--merge.sh and
instead implement it in builtin/rebase.c.

This results in a few deliberate but small user-visible changes:
  * The progress output is modified (see t3406 and t3420 for examples)
  * A few known test failures are now fixed (see t3421)
  * bash-prompt during a rebase --merge is now REBASE-i instead of
    REBASE-m.  Reason: The prompt is a reflection of the backend in use;
    this allows users to report an issue to the git mailing list with
    the appropriate backend information, and allows advanced users to
    know where to search for relevant control files.  (see t9903)

testcase modification notes:
  t3406: --interactive and --merge had slightly different progress output
         while running; adjust a test to match the new expectation
  t3420: these test precise output while running, but rebase--am,
         rebase--merge, and rebase--interactive all were built on very
         different commands (am, merge-recursive, cherry-pick), so the
         tests expected different output for each type.  Now we expect
         --merge and --interactive to have the same output.
  t3421: --interactive fixes some bugs in --merge!  Wahoo!
  t9903: --merge uses the interactive backend so the prompt expected is
         now REBASE-i.

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

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-.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://public-inbox.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