Re: [RFC] introducing git replay

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

 



On Wed, Apr 13, 2022 at 3:27 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Edmundo Carmona Antoranz <eantoranz@xxxxxxxxx> writes:
> > +static unsigned int replay_indexof(struct commit *commit,
> > +                                struct commit_list *list)
> > +{
> > +     int res;
> > +     if (list == NULL)
> > +             return -1;
>
> We encourage to have a blank line between the end of the decls and
> the beginning of the statements.  Add one after the line that
> declares the variable "res".
>
> In an existing code that consistently uses the abbreviation, it is a
> different story, but "result" is not too long to spell out, and
> because you do not use the variable that often anyway, you would
> avoid unnecessary friction on the readers not to abbreviate it to
> "res" here.

One other minor point... in Git source code, comparison against NULL is spelled:

    if (!list)
        ...

(And the inverse case of `if (list != NULL)` would just be `if (list)`.)



[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