Re: [RFC PATCH v7 10/10] diff: consult oid-only hunk providers via diff.<driver>.process
- From
Michael Montalbo <mmontalbo@gmail.com>
- Date
- Aug 4, 2026, 03:15 UTC
- Message-ID
- <CAC2QwmJbkh023AZe7fHxRVwzyVmFghvs8fuBHEAg5tdD52F0-A@mail.gmail.com>
- In-Reply-To
- <20260801174156.2998808-11-mmontalbo@gmail.com>
On Sat, Aug 1, 2026 at 10:42 AM Michael Montalbo <mmontalbo@gmail.com> wrote:
Show 14 quoted lines
>
> +static long blob_line_cap(struct repository *r, const struct object_id *oid)
> +{
> + unsigned long size;
> + struct object_info oi = OBJECT_INFO_INIT;
> +
> + oi.sizep = &size;
> + if (odb_read_object_info_extended(r->objects, oid, &oi,
> + OBJECT_INFO_SKIP_FETCH_OBJECT) < 0)
> + return -1;
> + if (size > INT32_MAX)
> + return INT32_MAX;
> + return (long)size;
> +}"unsigned long" for size breaks the build wherever size_t differs from unsigned long (32-bit platforms and 64-bit Windows):
diff-process.c:331:18: assignment to 'size_t *' {aka 'long long
unsigned int *'} from incompatible pointer type 'long unsigned int *'
[-Wincompatible-pointer-types]
331 | oi.sizep = &size;I'll fold this into a re-roll; in the meantime, squashing the following into "diff: consult oid-only hunk providers via diff.<driver>.process" on mm/diff-process-hunks resolves it.
-- >8 --
diff --git a/diff-process.c b/diff-process.c index 121903a6c8..d28f9cf973 100644 --- a/diff-process.c +++ b/diff-process.c @@ -325,7 +325,7 @@ static int validate_external_hunks(const struct xdl_hunk *hunks, size_t nr, */ static long blob_line_cap(struct repository *r, const struct object_id *oid) { - unsigned long size; + size_t size; struct object_info oi = OBJECT_INFO_INIT; oi.sizep = &size;