Re: [PATCH] commit: correct advice about aborting a cherry-pick

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

 



On Mon, Jul 29, 2013 at 08:18:45AM -0700, Junio C Hamano wrote:

> >  	if (file_exists(git_path("MERGE_HEAD")))
> >  		whence = FROM_MERGE;
> > -	else if (file_exists(git_path("CHERRY_PICK_HEAD")))
> > +	else if (file_exists(git_path("CHERRY_PICK_HEAD"))) {
> >  		whence = FROM_CHERRY_PICK;
> > +		if (file_exists(git_path("sequencer")))
> > +			sequencer_in_use = 1;
> 
> Should this be
> 
> 	sequencer_in_use = file_exists(...)
> 
> so readers do not have to wonder what the variable is initialized
> to?

Yeah, I think that is a readability improvement. I suppose the use-site
could also just run "file_exists" itself, but I wanted to keep the
filesystem-reading "magic name" bits together.

I had also originally considered adding new states to "whence" to cover
these cases (i.e., FROM_CHERRY_PICK_MULTI), but there are fallouts all
over the place for call sites that do not care whether we are in the
single- or multi-commit mode.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]