Re: [GSoC][PATCH v2 6/7] rebase -i: rewrite setup_reflog_action() in C

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

 



Hi Junio,

On Tue, 3 Jul 2018, Junio C Hamano wrote:

> Alban Gruin <alban.gruin@xxxxxxxxx> writes:
> 
> > +static int run_git_checkout(struct replay_opts *opts, const char *commit,
> > +				int verbose, const char *action)
> > +{
> > +	struct child_process cmd = CHILD_PROCESS_INIT;
> > +
> > +	cmd.git_cmd = 1;
> > +
> > +	argv_array_push(&cmd.args, "checkout");
> > +	argv_array_push(&cmd.args, commit);
> > +	argv_array_pushf(&cmd.env_array, GIT_REFLOG_ACTION "=%s", action);
> > +
> > +	if (verbose)
> > +		return run_command(&cmd);
> > +	return run_command_silent_on_success(&cmd);
> 
> I thought we made this into
> 
> 	if verbose
> 		return run_command
> 	else
> 		return run_command_silently
> 
> to help readers in the previous round already.

FWIW we had quite a couple of reviews in the recent years which pointed
out "unnecessary else" after returning or die()ing. Maybe we should make
up our minds, and set a consistent rule to follow.

Ciao,
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