Re: [PATCH v3 2/2] rebase -i: introduce the 'break' command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,

On Fri, 12 Oct 2018, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@xxxxxxxxx>
> writes:
> 
> > @@ -3293,6 +3312,9 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
> >  			unlink(rebase_path_stopped_sha());
> >  			unlink(rebase_path_amend());
> >  			delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
> > +
> > +			if (item->command == TODO_BREAK)
> > +				return stopped_at_head();
> >  		}
> 
> The earlier one had "break;" here, which broke out of the while()
> loop, let the control reach "if (is_reabse_i(opts)) {" block after
> the loop, and the block would have noticed that current < nr and
> returned 0.  So from the point of view of the overall control flow
> of the caller of this function, there is no change relative to v2.
> The only difference in v3 is that stopped_at_head() gives a useful
> message.

Well, I should have called out this `break;` -> `return 0;` change, too,
as I think it makes the code flow *a lot* more obvious. As you say, I
relied earlier on the next loop to return early, but that is not what the
`edit` command does: it returns out of the first loop, too.

> 
> Good.

Thanks,
Dscho
> 
> 



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux