Re: [PATCH 6/6] sequencer: Remove sequencer state after final commit
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 11, 2011, 20:17 UTC
- Message-ID
- <20110811201755.GJ2277@elie.gateway.2wire.net>
- In-Reply-To
- <1313088705-32222-7-git-send-email-artagnon@gmail.com>
Hi,
Ramkumar Ramachandra wrote:
Show 21 quoted lines
> --- 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.