From: Ramkumar Ramachandra Date: Wed, 27 Jul 2011 10:12:24 GMT Subject: Re: [PATCH 14/18] revert: Introduce --reset to remove sequencer state Message-ID: In-Reply-To: <20110727051115.GI18470@elie> Hi, Jonathan Nieder writes: > 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. Fixed, thanks. >> +++ 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": Actually this was intentional; if we un-indent this now, there'll be a diff indenting it when '--reset' and '--continue' are introduced which turns out to be especially ugly :) >> --- 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. Good point. Fixed all, thanks. -- Ram