From: Jonathan Nieder Date: Wed, 27 Jul 2011 05:11:15 GMT Subject: Re: [PATCH 14/18] revert: Introduce --reset to remove sequencer state Message-ID: <20110727051115.GI18470@elie> In-Reply-To: <1311736755-24205-15-git-send-email-artagnon@gmail.com> Ramkumar Ramachandra wrote: > --- /dev/null > +++ b/Documentation/sequencer.txt > @@ -0,0 +1,4 @@ > +--reset:: > + Forget about the current operation in progress. Can be used > + to clear the sequencer state after a failed cherry-pick or > + revert. Probably worth mentioning that the index, HEAD, and worktree are left alone. > +++ b/builtin/revert.c [...] > @@ -886,17 +906,22 @@ static int pick_revisions(struct replay_opts *opts) [...] > + if (opts->subcommand == REPLAY_RESET) { > + remove_sequencer_state(1); > + return 0; > + } else { > + /* Start a new cherry-pick/ revert sequence */ Can un-indent by dropping the "else": if (opts->subcommand == REPLAY_RESET) { ... return 0; } /* Start a new cherry-pick or revert. */ ... [...] > --- a/t/t3510-cherry-pick-sequence.sh > +++ b/t/t3510-cherry-pick-sequence.sh > @@ -37,7 +37,7 @@ test_expect_success 'cherry-pick persists data on failure' ' > test_path_is_file .git/sequencer/head && > test_path_is_file .git/sequencer/todo && > test_path_is_file .git/sequencer/opts && > - rm -rf .git/sequencer > + git cherry-pick --reset > ' This is not about this patch, but ideally the cleanup would come at the beginning of the next test, so if one test fails it does not take down all the tests that come after it.