From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Eugenio Gigante <giganteeugenio2@gmail.com>,
git@vger.kernel.org, sunshine@sunshineco.com
Subject: Re: [GSoC][PATCH 1/1] add: use unsigned type for collection of bits
Date: Mon, 26 Feb 2024 14:58:39 -0800 [thread overview]
Message-ID: <xmqqsf1ekf34.fsf@gitster.g> (raw)
In-Reply-To: <CAP8UFD3qR8E0gvUQtzzkLPWv4Db45kFS4pEqHKQr5siciVJ-zQ@mail.gmail.com> (Christian Couder's message of "Mon, 26 Feb 2024 10:59:05 +0100")
Christian Couder <christian.couder@gmail.com> writes:
> On Sat, Feb 24, 2024 at 12:28 PM Eugenio Gigante
> <giganteeugenio2@gmail.com> wrote:
>>
>> The function 'refresh' in 'builtin/add.c' declares 'flags' as
>> signed, while the function 'refresh_index' defined in
>> 'read-cache-ll.h' expects an unsigned value.
>
> It's not clear from the patch that refresh() passes 'flags' as an
> argument to refresh_index(), so it might help reviewers a bit if you
> could tell that.
Perhaps.
>> Since in this case 'flags' represents a bag of bits, whose MSB is
>> not used in special ways, this commit changes the type of 'flags'
>> to unsigned.
>
> We prefer to use "let's change this and that" or just "change this and
> that" rather than "this commit changes this and that", see
> https://git-scm.com/docs/SubmittingPatches/#imperative-mood.
Very true.
> It might help if you could add a bit more explanation about why it's a
> good thing to use an unsigned variable instead of a signed one. For
> example you could say that it documents that we are not doing anything
> funny with the MSB.
But doesn't the proposed log message already say so?
In any case, it would very much help to fold long lines and have a
blank line in between paragraphs to make the log message more
readable.
Thanks, both.
>
>> Signed-off-by: Eugenio Gigante <giganteeugenio2@gmail.com>
>> ---
>> builtin/add.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> The patch looks correct, thanks!
next prev parent reply other threads:[~2024-02-26 22:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-24 11:26 [GSoC][PATCH 0/1] Use unsigned integral type for collection of bits Eugenio Gigante
2024-02-24 11:26 ` [GSoC][PATCH 1/1] add: use unsigned " Eugenio Gigante
2024-02-26 9:59 ` Christian Couder
2024-02-26 22:58 ` Junio C Hamano [this message]
2024-02-29 19:44 ` [GSoC][PATCH v2 0/1] Use unsigned integral " Eugenio Gigante
2024-02-29 19:44 ` [PATCH v2 1/1] add: use unsigned " Eugenio Gigante
2024-02-29 19:52 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqsf1ekf34.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=giganteeugenio2@gmail.com \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.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.
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 NNTP newsgroup(s).