Re: [PATCH 14/18] revert: Introduce --reset to remove sequencer state
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jul 27, 2011, 10:12 UTC
- Message-ID
- <CALkWK0k7SvjJ8duNscnwjn4JOjSDqfHN1qH9rnoz5w8TjHgKgA@mail.gmail.com>
- In-Reply-To
- <20110727051115.GI18470@elie>
Hi,
Jonathan Nieder writes:
Show 11 quoted lines
> 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.
Show 11 quoted lines
>> +++ 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 :)
Show 13 quoted lines
>> --- 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