Re: [RFC PATCH v7 10/10] diff: consult oid-only hunk providers via diff.<driver>.process

Michael Montalbo <[email protected]> Mon, 3 Aug 2026 20:15:16 -0700
Newsgroups org.kernel.vger.git
Message-ID <CAC2QwmJbkh023AZe7fHxRVwzyVmFghvs8fuBHEAg5tdD52F0-A@mail.gmail.com>
On Sat, Aug 1, 2026 at 10:42=E2=80=AFAM Michael Montalbo <[email protected]=
om> wrote:
>
> +static long blob_line_cap(struct repository *r, const struct object_id *=
oid)
> +{
> +       unsigned long size;
> +       struct object_info oi =3D OBJECT_INFO_INIT;
> +
> +       oi.sizep =3D &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 =3D &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 *oi=
d)
 {
-    unsigned long size;
+    size_t size;
     struct object_info oi =3D OBJECT_INFO_INIT;

     oi.sizep =3D &size;