revert: Remove sequencer state when no commits are pending

When cherry-pick or revert is called on a list of commits, and a
conflict encountered somewhere in the middle, the data in
".git/sequencer" is required to continue the operation.  However, when
a conflict is encountered in the very last commit, the user will have
to "continue" after resolving the conflict and committing just so that
the sequencer state is removed.  This is how the current "rebase -i"
script works as well.

  $ git cherry-pick foo..bar
  ... conflict encountered while picking "bar" ...
  $ echo "resolved" >problematicfile
  $ git add problematicfile
  $ git commit
  $ git cherry-pick --continue # This would be a no-op

Change this so that the sequencer state is cleared when a conflict is
encountered in the last commit.  Incidentally, this patch makes sure
that some existing tests don't break when features like "--reset" and
"--continue" are implemented later in the series.

A better way to implement this feature is to get the last "git commit"
to remove the sequencer state.  However, that requires tighter
coupling between "git commit" and the sequencer, a goal that can be
pursued once the sequencer is made more general.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 files changed
tree: 53277023e2b5fe91f4306f5cb2e74015b20036d7
  1. block-sha1/
  2. builtin/
  3. compat/
  4. contrib/
  5. Documentation/
  6. git-gui/
  7. git_remote_helpers/
  8. gitk-git/
  9. gitweb/
  10. perl/
  11. po/
  12. ppc/
  13. t/
  14. templates/
  15. vcs-svn/
  16. xdiff/
  17. .gitattributes
  18. .gitignore
  19. .mailmap
  20. abspath.c
  21. aclocal.m4
  22. advice.c
  23. advice.h
  24. alias.c
  25. alloc.c
  26. archive-tar.c
  27. archive-zip.c
  28. archive.c
  29. archive.h
  30. attr.c
  31. attr.h
  32. base85.c
  33. bisect.c
  34. bisect.h
  35. blob.c
  36. blob.h
  37. branch.c
  38. branch.h
  39. builtin.h
  40. bundle.c
  41. bundle.h
  42. cache-tree.c
  43. cache-tree.h
  44. cache.h
  45. check-builtins.sh
  46. check-racy.c
  47. check_bindir
  48. color.c
  49. color.h
  50. combine-diff.c
  51. command-list.txt
  52. commit.c
  53. commit.h
  54. config.c
  55. config.mak.in
  56. configure.ac
  57. connect.c
  58. convert.c
  59. copy.c
  60. COPYING
  61. csum-file.c
  62. csum-file.h
  63. ctype.c
  64. daemon.c
  65. date.c
  66. decorate.c
  67. decorate.h
  68. delta.h
  69. diff-delta.c
  70. diff-lib.c
  71. diff-no-index.c
  72. diff.c
  73. diff.h
  74. diffcore-break.c
  75. diffcore-delta.c
  76. diffcore-order.c
  77. diffcore-pickaxe.c
  78. diffcore-rename.c
  79. diffcore.h
  80. dir.c
  81. dir.h
  82. editor.c
  83. entry.c
  84. environment.c
  85. exec_cmd.c
  86. exec_cmd.h
  87. fast-import.c
  88. fetch-pack.h
  89. fixup-builtins
  90. fsck.c
  91. fsck.h
  92. generate-cmdlist.sh
  93. gettext.c
  94. gettext.h
  95. git-add--interactive.perl
  96. git-am.sh
  97. git-archimport.perl
  98. git-bisect.sh
  99. git-compat-util.h
  100. git-cvsexportcommit.perl
  101. git-cvsimport.perl
  102. git-cvsserver.perl
  103. git-difftool--helper.sh
  104. git-difftool.perl
  105. git-filter-branch.sh
  106. git-instaweb.sh
  107. git-lost-found.sh
  108. git-merge-octopus.sh
  109. git-merge-one-file.sh
  110. git-merge-resolve.sh
  111. git-mergetool--lib.sh
  112. git-mergetool.sh
  113. git-parse-remote.sh
  114. git-pull.sh
  115. git-quiltimport.sh
  116. git-rebase--am.sh
  117. git-rebase--interactive.sh
  118. git-rebase--merge.sh
  119. git-rebase.sh
  120. git-relink.perl
  121. git-remote-testgit.py
  122. git-repack.sh
  123. git-request-pull.sh
  124. git-send-email.perl
  125. git-sh-i18n.sh
  126. git-sh-setup.sh
  127. git-stash.sh
  128. git-submodule.sh
  129. git-svn.perl
  130. GIT-VERSION-GEN
  131. git-web--browse.sh
  132. git.c
  133. git.spec.in
  134. graph.c
  135. graph.h
  136. grep.c
  137. grep.h
  138. hash.c
  139. hash.h
  140. help.c
  141. help.h
  142. hex.c
  143. http-backend.c
  144. http-fetch.c
  145. http-push.c
  146. http-walker.c
  147. http.c
  148. http.h
  149. ident.c
  150. imap-send.c
  151. INSTALL
  152. levenshtein.c
  153. levenshtein.h
  154. LGPL-2.1
  155. list-objects.c
  156. list-objects.h
  157. ll-merge.c
  158. ll-merge.h
  159. lockfile.c
  160. log-tree.c
  161. log-tree.h
  162. mailmap.c
  163. mailmap.h
  164. Makefile
  165. match-trees.c
  166. merge-file.c
  167. merge-file.h
  168. merge-recursive.c
  169. merge-recursive.h
  170. name-hash.c
  171. notes-cache.c
  172. notes-cache.h
  173. notes-merge.c
  174. notes-merge.h
  175. notes.c
  176. notes.h
  177. object.c
  178. object.h
  179. pack-check.c
  180. pack-refs.c
  181. pack-refs.h
  182. pack-revindex.c
  183. pack-revindex.h
  184. pack-write.c
  185. pack.h
  186. pager.c
  187. parse-options.c
  188. parse-options.h
  189. patch-delta.c
  190. patch-ids.c
  191. patch-ids.h
  192. path.c
  193. pkt-line.c
  194. pkt-line.h
  195. preload-index.c
  196. pretty.c
  197. progress.c
  198. progress.h
  199. quote.c
  200. quote.h
  201. reachable.c
  202. reachable.h
  203. read-cache.c
  204. README
  205. reflog-walk.c
  206. reflog-walk.h
  207. refs.c
  208. refs.h
  209. remote-curl.c
  210. remote.c
  211. remote.h
  212. replace_object.c
  213. rerere.c
  214. rerere.h
  215. resolve-undo.c
  216. resolve-undo.h
  217. revision.c
  218. revision.h
  219. run-command.c
  220. run-command.h
  221. send-pack.h
  222. sequencer.c
  223. sequencer.h
  224. server-info.c
  225. setup.c
  226. sh-i18n--envsubst.c
  227. sha1-array.c
  228. sha1-array.h
  229. sha1-lookup.c
  230. sha1-lookup.h
  231. sha1_file.c
  232. sha1_name.c
  233. shallow.c
  234. shell.c
  235. shortlog.h
  236. show-index.c
  237. sideband.c
  238. sideband.h
  239. sigchain.c
  240. sigchain.h
  241. strbuf.c
  242. strbuf.h
  243. string-list.c
  244. string-list.h
  245. submodule.c
  246. submodule.h
  247. symlinks.c
  248. tag.c
  249. tag.h
  250. tar.h
  251. test-chmtime.c
  252. test-ctype.c
  253. test-date.c
  254. test-delta.c
  255. test-dump-cache-tree.c
  256. test-genrandom.c
  257. test-index-version.c
  258. test-line-buffer.c
  259. test-match-trees.c
  260. test-mktemp.c
  261. test-obj-pool.c
  262. test-parse-options.c
  263. test-path-utils.c
  264. test-run-command.c
  265. test-sha1.c
  266. test-sha1.sh
  267. test-sigchain.c
  268. test-string-pool.c
  269. test-subprocess.c
  270. test-svn-fe.c
  271. test-treap.c
  272. thread-utils.c
  273. thread-utils.h
  274. trace.c
  275. transport-helper.c
  276. transport.c
  277. transport.h
  278. tree-diff.c
  279. tree-walk.c
  280. tree-walk.h
  281. tree.c
  282. tree.h
  283. unimplemented.sh
  284. unpack-trees.c
  285. unpack-trees.h
  286. upload-pack.c
  287. url.c
  288. url.h
  289. usage.c
  290. userdiff.c
  291. userdiff.h
  292. utf8.c
  293. utf8.h
  294. walker.c
  295. walker.h
  296. wrap-for-bin.sh
  297. wrapper.c
  298. write_or_die.c
  299. ws.c
  300. wt-status.c
  301. wt-status.h
  302. xdiff-interface.c
  303. xdiff-interface.h
  304. zlib.c