)]}'
{
  "commit": "b894a45c9d0c84a32f6b1d4f6333c708efccb0f8",
  "tree": "9d5504eebdec2ae353e8d8d317157019d2eb2d87",
  "parents": [
    "e9019fcafe0040228b8631c30f97ae1adb61bcdc"
  ],
  "author": {
    "name": "Igor Wiedler",
    "email": "iwiedler@gitlab.com",
    "time": "Mon Oct 19 13:09:17 2026 +0200"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Mon Oct 19 16:07:05 2026 -0700"
  },
  "message": "connected: negate alternate refs in deepening fetches too\n\nThe connectivity check spawned by check_connected() uses\n\n  git rev-list --objects --stdin --not --all --quiet --alternate-refs\n\nwhere 39b44ba771 (check_everything_connected: assume alternate ref\ntips are valid, 2019-07-01) added \"--alternate-refs\" so that the walk\nfrom the fetched tips stops at the refs of any alternate object store,\non the assumption that the alternate is already fully connected.\n\nThat only works because \"--alternate-refs\" comes after \"--not\".\ncf1e7c0770 (fetch-pack: write shallow, then check connectivity,\n2018-07-02) drops \"--not --all\" for deepening fetches, since those\nneed to verify the whole chain up to the new shallow boundary rather\nthan stopping at refs we already had. For such fetches we therefore\nrun\n\n  git --shallow-file ... rev-list --objects --stdin --quiet --alternate-refs\n\nwith the alternate\u0027s refs as positive revisions, and rev-list\nenumerates every object reachable from them. Unless one of those refs\nhappens to lie inside the newly fetched shallow range, where the\ngrafts cut the walk short, that is the alternate\u0027s entire history.\n\nThis is slow for setups that attach a large alternate to a fresh\nrepository and then do a shallow fetch of a ref that is a few commits\nahead of the alternate, which is how CI runners share a clone of a\nbig repository between jobs. With a 7M-object alternate (a bare clone\nof gitlab-org/gitlab), \"git fetch --depth 1\" transfers an empty pack\nin under a second and the connectivity check then takes 227s. With\nthe alternate\u0027s refs negated the same rev-list finishes in 0.0s.\n\nPass \"--not\" in both cases, before the branch that adds \"--all\" for\nnon-deepening fetches, so that \"--alternate-refs\" is negated for\ndeepening fetches as well. Such a fetch still has to reach the new\nshallow boundary from the fetched tips without stopping at our own\nrefs, which is what cf1e7c0770 wanted. It stops at the alternate\u0027s\nrefs, as every other fetch already does. Move \"--alternate-refs\" up\nnext to \"--all\" so that the arguments that bound the walk are in one\nplace.\n\nAdd tests to t5618 that check the arguments of the rev-list child via\nGIT_TRACE2_EVENT for a regular and for a deepening fetch. The result\nof the check is the same either way for a complete alternate, so\nthere is no behavioural difference to assert on. The difference is\nonly in which objects are walked.\n\nHelped-by: Patrick Steinhardt \u003cps@pks.im\u003e\nHelped-by: Junio C Hamano \u003cgitster@pobox.com\u003e\nSigned-off-by: Igor Wiedler \u003ciwiedler@gitlab.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7e269768327238edceabb43a94884c2c42423c1c",
      "old_mode": 33188,
      "old_path": "connected.c",
      "new_id": "cf2647c94244b6d63d61ed89fe87af6d491f8a6d",
      "new_mode": 33188,
      "new_path": "connected.c"
    },
    {
      "type": "modify",
      "old_id": "2fb6d549d394ee5cde5b154bc35da72c269fa9ed",
      "old_mode": 33261,
      "old_path": "t/t5618-alternate-refs.sh",
      "new_id": "3c5fbef463eb01ae9a9ff0c53303d52c303995ff",
      "new_mode": 33261,
      "new_path": "t/t5618-alternate-refs.sh"
    }
  ]
}
