From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Edmundo Carmona Antoranz <eantoranz@gmail.com>,
Git List <git@vger.kernel.org>
Subject: Re: [RFC] introducing git replay
Date: Wed, 13 Apr 2022 16:06:35 -0400 [thread overview]
Message-ID: <CAPig+cRztjLPNOr0Fqm2NnRAGQ8kJDK5-WNWAMYhzG23uHp99Q@mail.gmail.com> (raw)
In-Reply-To: <xmqqlew898n3.fsf@gitster.g>
On Wed, Apr 13, 2022 at 3:27 PM Junio C Hamano <gitster@pobox.com> wrote:
> Edmundo Carmona Antoranz <eantoranz@gmail.com> 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)`.)
prev parent reply other threads:[~2022-04-13 20:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 16:43 [RFC] introducing git replay Edmundo Carmona Antoranz
2022-04-13 17:05 ` Junio C Hamano
2022-04-15 18:46 ` Edmundo Carmona Antoranz
2022-04-15 20:33 ` Junio C Hamano
2022-04-16 5:35 ` Edmundo Carmona Antoranz
2022-04-16 6:39 ` Junio C Hamano
2022-04-16 7:02 ` Edmundo Carmona Antoranz
2022-04-17 5:05 ` Elijah Newren
2022-04-17 5:37 ` Edmundo Carmona Antoranz
2022-04-17 17:22 ` Martin von Zweigbergk
2022-04-18 7:04 ` Edmundo Carmona Antoranz
2022-04-18 7:29 ` Sergey Organov
2022-04-18 16:27 ` Elijah Newren
2022-04-18 17:33 ` Sergey Organov
2022-04-20 11:27 ` Tao Klerks
2022-04-21 2:33 ` Elijah Newren
2022-04-13 17:26 ` rsbecker
2022-04-13 17:30 ` Edmundo Carmona Antoranz
2022-04-13 17:44 ` Edmundo Carmona Antoranz
2022-04-13 17:44 ` Phillip Susi
2022-04-13 17:49 ` Edmundo Carmona Antoranz
2022-04-13 19:07 ` Ævar Arnfjörð Bjarmason
2022-04-13 17:48 ` Junio C Hamano
2022-04-13 17:56 ` Edmundo Carmona Antoranz
2022-04-13 20:06 ` Eric Sunshine [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cRztjLPNOr0Fqm2NnRAGQ8kJDK5-WNWAMYhzG23uHp99Q@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=eantoranz@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).