Re: [WIP RFC PATCH v2 4/5] clone: extract function from copy_or_link_directory
- From
Matheus Tavares Bernardino <matheus.bernardino@usp.br>
- Date
- Feb 27, 2019, 22:50 UTC
- Message-ID
- <CAHd-oW70pZaMX80TarpMd2rOtR_ONOikwUOO8n6ZD_vfKhN5yQ@mail.gmail.com>
- In-Reply-To
- <20190227224553.GS6085@hank.intra.tgummerer.com>
On Wed, Feb 27, 2019 at 7:45 PM Thomas Gummerer <t.gummerer@gmail.com> wrote:
Show 30 quoted lines
>
> On 02/27, Matheus Tavares Bernardino wrote:
> > On Tue, Feb 26, 2019 at 9:18 AM Duy Nguyen <pclouds@gmail.com> wrote:
> > >
> > > On Tue, Feb 26, 2019 at 12:18 PM Matheus Tavares
> > > <matheus.bernardino@usp.br> wrote:
> > > > + */
> > > > + struct stat st;
> > > > +
> > > > + if (mkdir(pathname, mode)) {
> > >
> > > Good opportunity to unindent this by doing
> > >
> > > if (!mkdir(...
> > > return;
> > >
> > > but it's up to you.
> > >
> >
> > Ok. But being such a small snippet, is the indentation really a code
> > smell here? (sorry, I'm still getting used to git's coding guidelines)
>
> I don't think the indentation here is too bad here, but I think the
> code is slightly easier to read with less indentation, and it's easier
> to see what's happening in the success case as well without reading
> the whole method.
>
> And since this patch is already refactoring code we could do it here.
> I don't think it's a very big deal either way, which is why Duy left
> the decision on whether to use the suggestion or not up to you.Ok, so I will do it for the next version! I just asked because it was a good chance for me to learn a bit more about git's code style :)