Re: [PATCH 1/3] pull: cleanup autostash check

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

 



Carlo Arenas wrote:
> On Sat, Jun 12, 2021 at 10:11 PM Felipe Contreras <
> felipe.contreras@xxxxxxxxx> wrote:
> 
> > -       autostash = config_autostash;
> >         if (opt_rebase) {
> > +               int autostash = config_autostash;
> >                 if (opt_autostash != -1)
> >                         autostash = opt_autostash;
> >
> 
> since you are reducing the scope of the autostash variable anyway, why
> not refactor it additionally for clarity with (something like):
> 
>   int autostash = (opt_autostash != -1) ? opt_autostash : config_autostash;

Because I had like 15 branches on top of this, and wanted 1) to minimize
modifications, and 2) to minimize the chance of the patch being
rejected, and this is how the code was before f15e7cf5cc (pull: ff
--rebase --autostash works in dirty repo, 2017-06-01), so in theory
nobody could object.

But yeah, that version makes sense, and in fact I probably had such
cleanup in some branch.

-- 
Felipe Contreras



[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