Re: [PATCH v2 03/10] commit-graph: fix type for some write options
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 7, 2025, 07:07 UTC
- Message-ID
- <aJRQuqzdoiQyYiHe@pks.im>
- In-Reply-To
- <xmqqa54cwj9r.fsf@gitster.g>
On Wed, Aug 06, 2025 at 08:40:32AM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes: > > > On Wed, Aug 06, 2025 at 02:00:08PM +0200, Patrick Steinhardt wrote: > >>+ OPT_UNSIGNED(0, "max-commits", &write_opts.max_commits, > >> > >>+ size_t max_commits; > >> > > dunno, this really seems to be crying for OPT_SIZE_T being split off. > > Or just use "unsigned int".
We don't need `OPT_SIZE_T` because `OPT_UNSIGNED()` knows to handle unsigned integers of arbitrary widths. It does a `sizeof()` of the value and passes that as precision to the parsing code.
> Really, what does NUMBER OF commits we will handle have anything to > do with how many bytes of core we ask to grab from the system? > > This "we count things in size_t" is a superstition we should stop.
Will adapt to use `unsigned`.
Patrick