)]}'
{
  "commit": "0ae93f56ecd792d227149161b57f292a1c909d0c",
  "tree": "bf0f1ce0a6ac3554a0ac8af811d180c609c1b4eb",
  "parents": [
    "12a19eec1d7c0121e0c82c95a2300fdbad1f18f2"
  ],
  "author": {
    "name": "Eric Ju",
    "email": "eric.peijian@gmail.com",
    "time": "Fri Jul 24 12:54:23 2026 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Jul 24 08:49:09 2026 -0700"
  },
  "message": "cat-file: add remote-object-info to batch-command\n\nSince the info command in cat-file --batch-command prints object\ninfo for a given object, it is natural to add another command in\ncat-file --batch-command to print object info for a given object\nfrom a remote.\n\nAdd remote-object-info command to cat-file --batch-command.\n\nWhile info takes object ids one at a time, this creates overhead when\nmaking requests to a server. So remote-object-info instead can take\nmultiple object ids at once.\n\nThe cat-file --batch-command command is generally implemented in the\nfollowing manner:\n\n - Receive and parse input from user\n - Call respective function attached to command\n - Get object info, print object info\n\nIn --buffer mode, this changes to:\n\n - Receive and parse input from user\n - Store respective function attached to command in a queue\n - After flush, loop through commands in queue\n    - Call respective function attached to command\n    - Get object info, print object info\n\nNotice how the getting and printing of object info is accomplished one\nat a time. As described above, this creates a problem for making\nrequests to a server. Therefore, remote-object-info is implemented in\nthe following manner:\n\n - Receive and parse input from user\n If command is remote-object-info:\n    - Get object info from remote\n    - Loop through and print each object info\n Else:\n    - Call respective function attached to command\n    - Parse input, get object info, print object info\n\nAnd finally for --buffer mode remote-object-info:\n - Receive and parse input from user\n - Store respective function attached to command in a queue\n - After flush, loop through commands in queue:\n    If command is remote-object-info:\n        - Get object info from remote\n        - Loop through and print each object info\n    Else:\n        - Call respective function attached to command\n        - Get object info, print object info\n\nTo summarize, remote-object-info gets object info from the remote and\nthen loops through the object info passed in, printing the info.\n\nIn order for remote-object-info to avoid remote communication\noverhead in the non-buffer mode, the objects are passed in as such:\n\nremote-object-info \u003cremote\u003e \u003coid\u003e \u003coid\u003e ... \u003coid\u003e\n\nrather than\n\nremote-object-info \u003cremote\u003e \u003coid\u003e\nremote-object-info \u003cremote\u003e \u003coid\u003e\n...\nremote-object-info \u003cremote\u003e \u003coid\u003e\n\nPlaceholders in the format are validated against an allow-list of the\natoms the remote path supports: \"objectname\" and \"objectsize\".\nUnsupported atoms expand to an empty string, honoring how for-each-ref\nhandles known but inapplicable atoms.\nWithout this, atoms like %(objecttype) would mark data-\u003einfo.typep and\nbecause the server only sends size, type_name() would later crash.\nAs extra safety, even outside of the remote path, initialize\nexpand_data\u0027s type to OBJ_BAD and handle type_name() returning NULL.\n\nHelped-by: Jonathan Tan \u003cjonathantanmy@google.com\u003e\nHelped-by: Christian Couder \u003cchriscool@tuxfamily.org\u003e\nMentored-by: Karthik Nayak \u003ckarthik.188@gmail.com\u003e\nMentored-by: Chandra Pratap \u003cchandrapratap3519@gmail.com\u003e\nSigned-off-by: Calvin Wan \u003ccalvinwan@google.com\u003e\nSigned-off-by: Eric Ju \u003ceric.peijian@gmail.com\u003e\n[pablo: added the atom allow-list validation]\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": "86b9181599317ec5fd6c4d8ef24079f29ad168ab",
      "old_mode": 33188,
      "old_path": "Documentation/git-cat-file.adoc",
      "new_id": "ac3b528c6f00f6de7db8102594c1469d590cfc44",
      "new_mode": 33188,
      "new_path": "Documentation/git-cat-file.adoc"
    },
    {
      "type": "modify",
      "old_id": "03afc44c5ed4824bf747ef338b88a2d6358fc580",
      "old_mode": 33188,
      "old_path": "builtin/cat-file.c",
      "new_id": "8994b04d15692ce7f6277fc97afc59900af072b6",
      "new_mode": 33188,
      "new_path": "builtin/cat-file.c"
    },
    {
      "type": "modify",
      "old_id": "93602f8c50a8589cb1c3839af460d469bc11c2b1",
      "old_mode": 33188,
      "old_path": "object-file.c",
      "new_id": "121416c37c6709d36d85d08888d162e05d4adf46",
      "new_mode": 33188,
      "new_path": "object-file.c"
    },
    {
      "type": "modify",
      "old_id": "88a37febbfa479b858f48aa99b657dea7f555383",
      "old_mode": 33188,
      "old_path": "odb.h",
      "new_id": "92fa414e2c66d6205ae52cb0d9e8c72dd7f670b6",
      "new_mode": 33188,
      "new_path": "odb.h"
    },
    {
      "type": "modify",
      "old_id": "8ae6ab6c5fe1e2f994a9e4ab124784be43bcaba9",
      "old_mode": 33188,
      "old_path": "t/meson.build",
      "new_id": "10241e3dccb785d94dde13918ee6fdc70c4f41d0",
      "new_mode": 33188,
      "new_path": "t/meson.build"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "edc20394d81b0afc3ce5bdd063ff76b9e6065372",
      "new_mode": 33261,
      "new_path": "t/t1017-cat-file-remote-object-info.sh"
    }
  ]
}
