Hi Junio

I am sorry, I missed to reply to these.

On 2019-06-13 17:56 UTC Junio C Hamano <gits...@pobox.com> wrote:
>
> > +int sequencer_skip(struct repository *r, struct replay_opts *opts)
> > +{
> > +   enum replay_action action = -1;
> > +   sequencer_get_last_command(r, &action);
> > +
> > +   switch (opts->action) {
> > +   case REPLAY_REVERT:
> > +           if (!file_exists(git_path_revert_head(r))) {
> > +                   if (action == REPLAY_REVERT) {
> > +                           if (!rollback_is_safe())
> > +                                   goto give_advice;
> > +                           else
> > +                                   break;
> > +                   }
> > +                   return error(_("no revert in progress"));
> > +           }
> 
> This part probably deserves a bit of in-code comment.
> 
>     The Git subcommand (i.e. opts->action) tells us that we are
>     asked to "git revert --skip".  When REVERT_HEAD is not there, we
>     look at the last command of the sequencer state and make sure it
>     is 'revert'; all other cases we barf.
> 
> That much we can read from the code.  But what are "all other cases"?
> Do we cover a single-revert case (i.e. "git revert <commit>" got
> conflict and the user is saying "git revert --skip")?

Yes, we actually cover the single-revert case. Let's say there were
some conflicts then either .git/REVERT_HEAD will exist allowing
`git revert --skip` it's way or the user has already dealt with it
and committed his way in which case .git/REVERT_HEAD will be removed
and reverting ends (as it should).

> Was the user
> in the middle of "git rebase -i" and the last command before we gave
> the control back was 'pick'?

rebase -i creates different directories so, we are sure that --skip
does not skip in middle of a rebase. Am I right?

Hope these answers your questions
-- Rohit

Reply via email to