git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Karthik Nayak <karthik.188@gmail.com>
Cc: Arnav Bhate <bhatearnav@gmail.com>,  git@vger.kernel.org
Subject: Re: [GSoC PATCH] pathspec: fix sign comparison warnings
Date: Thu, 13 Mar 2025 08:33:59 -0700	[thread overview]
Message-ID: <xmqqcyelq714.fsf@gitster.g> (raw)
In-Reply-To: <CAOLa=ZRNJD7NqceGQ4B8ox+50m2q1nU1t29x7O0roc=-_4ww0w@mail.gmail.com> (Karthik Nayak's message of "Thu, 13 Mar 2025 08:52:58 -0400")

Karthik Nayak <karthik.188@gmail.com> writes:

> Also a bigger question is, shouldn't the type of `pathspec.nr` and
> 'istate.cache_nr' be the actual change required? Shouldn't they be set
> to 'size_t'?

Please do not blindly advocate the idea that size_t is always the
right type for any countables.  It is not.  

Platform natural way to count things is either "unsigned int", if
you are only counting, or "int", if you need to be able to signal an
unusual state other than "here is now many we have in the set", like
how index related functions uses (-pos-1) to signal a location in
the same range with different meanings.

  parent reply	other threads:[~2025-03-13 15:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 20:20 [GSoC PATCH] pathspec: fix sign comparison warnings Arnav Bhate
2025-03-13 12:52 ` Karthik Nayak
2025-03-13 14:20   ` Arnav Bhate
2025-03-13 14:44     ` Karthik Nayak
2025-03-13 15:33   ` Junio C Hamano [this message]
2025-03-13 15:50     ` Karthik Nayak
2025-03-16 10:14     ` Arnav Bhate
2025-03-29  6:17 ` [GSoC PATCH v2] " Arnav Bhate
2025-03-29  6:18   ` Arnav Bhate
2025-03-29 18:36   ` Junio C Hamano
2025-03-30 17:45     ` [GSoC PATCH v3] " Arnav Bhate

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=xmqqcyelq714.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bhatearnav@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.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).