Thread (30 messages) flat view 30 messages, 3 authors, 2016-06-15

Re: [PATCH 6/6] sequencer: Remove sequencer state after final commit

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:51:47

Hi,

Ramkumar Ramachandra wrote:
quoted hunk ↗ jump to hunk
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -26,6 +26,7 @@
 #include "unpack-trees.h"
 #include "quote.h"
 #include "submodule.h"
+#include "sequencer.h"
 
 static const char * const builtin_commit_usage[] = {
 	"git commit [options] [--] <filepattern>...",
@@ -1521,7 +1522,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 	unlink(git_path("MERGE_MODE"));
 	unlink(git_path("SQUASH_MSG"));
 
-	if (commit_index_files())
+	/* Remove sequencer state if we just finished the last insn */
+	if (sequencer_count_todo() == 1)
+		remove_sequencer_state(1);
+
+       if (commit_index_files())
 		die (_("Repository has been updated, but unable to write\n"
Whitespace damage?

I think even this is too much knowledge of sequencer details on "git
commit"'s part.  It should be enough to say

	Dear sequencer, I'm commiting!

and let the sequencer take care of the rest.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help