git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH RFC 2/5] fetch-object-info: add enum for fetch_object_info() statuses

From
Pablo Sabater <pabloosabaterr@gmail.com>
Date
Sep 30, 2026, 11:59 UTC
Message-ID
<DLSMTVIXW120.3F87OEHJW1LEC@gmail.com>
In-Reply-To
<CAOLa=ZQ8hvAxpU6SQ-KvN4eK5xMtJh4PoLXfDiNPmG89GQkMYQ@mail.gmail.com>
On Wed Sep 30, 2026 at 11:56 AM WEST, Karthik Nayak wrote:
Show 18 quoted lines
> Pablo Sabater <pabloosabaterr@gmail.com> writes:
>
>> fetch_object_info() dies when the server does not advertise the
>> object-info capability. That is fine for git cat-file
>> remote-object-info command, which cannot work without it. However
>> a subsequent commit needs fetch_object_info() to not die, to be
>> able to fallback.
>>
>
> Nit: The last sentence reads a little weird, perhaps:
>
>   However a subsequent commit uses fetch_object_info() optionally and
>   requires it to not die.
>
> Or something?
>
> But I think we should just squash this into the next commit. It doesn't
> really need to standout on its own.

Okay, squashing them makes sense. I only split them to avoid having the enum buried among the signature changes.

Will fix, thanks.
Show 29 quoted lines
>
>> Add "enum fetch_object_info_status" so that fetch_object_info() can
>> report this case to its callers. It is used in a subsequent commit.
>>
>> Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com>
>> ---
>>  fetch-object-info.h | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/fetch-object-info.h b/fetch-object-info.h
>> index 2fba96c6f7..663a7f3ae7 100644
>> --- a/fetch-object-info.h
>> +++ b/fetch-object-info.h
>> @@ -16,6 +16,12 @@ struct fetch_object_info_results {
>>
>>  #define FETCH_OBJECT_INFO_RESULTS_INIT { 0 }
>>
>> +enum fetch_object_info_status {
>> +	FETCH_OBJECT_INFO_OK = 0,
>> +	FETCH_OBJECT_INFO_ERR = -1,
>> +	FETCH_OBJECT_INFO_NOT_ENABLED = -2,
>> +};
>> +
>>  struct oid_array;
>>  /*
>>   * Sends git-cat-file object-info command into the request buf and reads the
>>
>> --
>> 2.54.0
Previous: Karthik NayakNext: Pablo Sabater
Message 5 of 18 in “Add --dry-run option to git-backfill(1)”
  1. 0/5 Add --dry-run option to git-backfill(1)Pablo Sabater, Sep 30, 2026
  2. 1/5 transport-internal: update fetch_object_info commentPablo Sabater, Sep 30, 2026
  3. 2/5 fetch-object-info: add enum for fetch_object_info() statusesPablo Sabater, Sep 30, 2026
  4. Karthik NayakSep 30, 2026
  5. Pablo SabaterSep 30, 2026
  6. 3/5 fetch-object-info: return a status instead of dyingPablo Sabater, Sep 30, 2026
  7. Junio C HamanoSep 30, 2026
  8. Pablo SabaterSep 30, 2026
  9. Junio C HamanoSep 30, 2026
  10. 4/5 backfill: add --dry-run optionPablo Sabater, Sep 30, 2026
  11. Karthik NayakSep 30, 2026
  12. Pablo SabaterSep 30, 2026
  13. 5/5 backfill: report total size of missing blobs in --dry-runPablo Sabater, Sep 30, 2026
  14. Junio C HamanoSep 30, 2026
  15. Pablo SabaterSep 30, 2026
  16. Derrick StoleeSep 30, 2026
  17. Pablo SabaterSep 30, 2026
  18. Junio C HamanoSep 30, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.