)]}'
{
  "commit": "dd1968bf84def5453886ab7320c44c18f4d03005",
  "tree": "8cb55315fa3a7e9162fef239fcb907ec5ce131db",
  "parents": [
    "0ae93f56ecd792d227149161b57f292a1c909d0c"
  ],
  "author": {
    "name": "Pablo Sabater",
    "email": "pabloosabaterr@gmail.com",
    "time": "Fri Jul 24 12:54:24 2026 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Jul 24 08:49:09 2026 -0700"
  },
  "message": "cat-file: make remote-object-info allow-list adapt to the server\n\nThe static allow-list in expand_atom() is hardcoded to allow only\n\"objectname\" and \"objectsize\" for remote queries. This works because,\nup to this point, servers will either support object-info with name\nand size or they do not support them at all.\n\nAs object-info gains new capabilities, we cannot expect different\nservers with different Git versions to have the same object-info\ncapabilities. Therefore, the client needs to adapt its allow-list to\nwhat the server advertises.\n\nThe client now:\n\n1. Requests the protocol option that the placeholder refers to (i.e.\n   \"size\" for \"%(objectsize)\").\n\n2. Drops any requested option that the server does not advertise in\n   fetch_object_info().\n\n3. Maps the remaining advertised options back to their placeholders and\n   populates remote_allowed_atoms.\n\n4. Uses remote_allowed_atoms in expand_atom(), preserving the previous\n   behavior for supported placeholders.\n\nFor example, if the client requests \"%(objectsize) %(objecttype)\" and\nthe server only supports \u0027size\u0027, then the client only requests \u0027size\u0027.\nThe server returns the size (i.e \"42\") \"%(objectsize)\" is expanded\nnormally while \"%(objecttype)\" expands to an empty string:\n\n\t\"42 \"\n\nNote that the empty string expansion is only for known but unsupported\nplaceholders. \"%(objectcolor)\" which doesn\u0027t exist would die().\n\nThis honors what for-each-ref does for known but inapplicable atoms\n(placeholders).\n\nMove object_info_options out of get_remote_info() so the caller which\nhas data can select what options will be requested instead of requesting\nalways size.\n\nMove batch_object_write() out so output is always produced.\nIf there are no supported attributes, the output is a blank line.\n\nInclude \"type\" in the object_info_options even though the client does\nnot yet know how to parse the server\u0027s \"type\" capability.\n\nAs a result, \"type\" is always filtered out, allowing the tests to verify\nthat known but unsupported placeholders expand to an empty string.\n\nSince the filter removes options by swapping with the last element,\nthe list is no longer kept sorted. Drop the pre-sort in\nfetch_object_info_via_pack() and use the unsorted string_list lookup\nfor the response header. This has no effect in performance as the list\ncan only be two entries long (\u0027size\u0027 and \u0027type\u0027).\n\nMentored-by: Karthik Nayak \u003ckarthik.188@gmail.com\u003e\nMentored-by: Chandra Pratap \u003cchandrapratap3519@gmail.com\u003e\nSigned-off-by: Pablo Sabater \u003cpabloosabaterr@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8994b04d15692ce7f6277fc97afc59900af072b6",
      "old_mode": 33188,
      "old_path": "builtin/cat-file.c",
      "new_id": "44a32a1df48efde623c06ac02ac768c809198354",
      "new_mode": 33188,
      "new_path": "builtin/cat-file.c"
    },
    {
      "type": "modify",
      "old_id": "30475a1e873d613527da8d1081f727c0b1bb36bd",
      "old_mode": 33188,
      "old_path": "fetch-object-info.c",
      "new_id": "ba7e179c44ee54c59910dd60d40942a31b60c916",
      "new_mode": 33188,
      "new_path": "fetch-object-info.c"
    },
    {
      "type": "modify",
      "old_id": "31aad98408a29bddfbc99cdd0b6a131bea6e913d",
      "old_mode": 33188,
      "old_path": "fetch-object-info.h",
      "new_id": "269cebb3f7df48be6081172b4a02cb801a50af76",
      "new_mode": 33188,
      "new_path": "fetch-object-info.h"
    },
    {
      "type": "modify",
      "old_id": "edc20394d81b0afc3ce5bdd063ff76b9e6065372",
      "old_mode": 33261,
      "old_path": "t/t1017-cat-file-remote-object-info.sh",
      "new_id": "116862f9d0b447a99f4271262034f9885974b8d7",
      "new_mode": 33261,
      "new_path": "t/t1017-cat-file-remote-object-info.sh"
    },
    {
      "type": "modify",
      "old_id": "93426805318e360740ffaed14453f106f8138b80",
      "old_mode": 33188,
      "old_path": "transport.c",
      "new_id": "f0a6a4554798002c3e3ae417a8a3b9a99064bcca",
      "new_mode": 33188,
      "new_path": "transport.c"
    }
  ]
}
