)]}'
{
  "commit": "ead4b2d7aa86fde803066f59c1dda94aefe2b9fe",
  "tree": "7f1f0792f9435263a4e85a7effd97834164de32d",
  "parents": [
    "e7cac4bca6b8e4276a5a64287653b5c56555d6f4"
  ],
  "author": {
    "name": "Gavin Mak",
    "email": "gavinmak@google.com",
    "time": "Mon Jun 15 23:23:04 2026 +0000"
  },
  "committer": {
    "name": "gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "email": "gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Jun 30 13:20:15 2026 -0700"
  },
  "message": "sync: Implement fetchcmd for standard Git layouts\n\nIntroduce support for `repo.fetchcmd` configuration, allowing users to\nspecify a custom command to fetch project data instead of\n`_RemoteFetch`.\n\nWhen `repo.fetchcmd` is specified, `repo` will execute it instead of\n`_RemoteFetch` during the network half of sync. Note that\n`repo.fetchcmd` requires `repo.uselocalgitdirs` to be enabled.\n\nThe command is executed in a subshell with project-context environment\nvariables, including the new `REPO_TREV` (target revision resolved to a\ncommit hash) and `REPO_PROJECT_FETCH_URL`.\n\nAfter execution, `repo` verifies that the target commit is available and\nthat the tracking ref and FETCH_HEAD are correctly updated.\n\nTested with:\n```\n\u003e ~/git-repo/repo init -u https://android-review.googlesource.com/platform/manifest \\\n    --repo-url file:///usr/local/google/home/gavinmak/git-repo \\\n    --groups developers \\\n    --no-repo-verify \\\n    --use-local-gitdirs\n...\n\n\u003e git config --file .repo/manifests.git/config repo.fetchcmd \u0027mkdir -p $REPO_PATH \u0026\u0026 cd $REPO_PATH \u0026\u0026 if [ ! -d .git ]; then git init \u0026\u0026 git remote add aosp $REPO_PROJECT_FETCH_URL; fi \u0026\u0026 git fetch aosp $REPO_TREV \u0026\u0026 git reset --hard $REPO_TREV \u0026\u0026 mkdir -p .git/refs/remotes/aosp \u0026\u0026 echo $REPO_TREV \u003e .git/refs/remotes/aosp/main \u0026\u0026 echo $REPO_TREV \u003e .git/FETCH_HEAD\u0027\n\n\u003e ~/git-repo/repo sync -j32\nwarning: repo is not tracking a remote branch, so it will not receive updates; run `repo init --repo-rev\u003dstable` to fix.\nYou are currently enrolled in Git submodules experiment (go/android-submodules-quickstart).  Use --no-use-superproject to override.\n\nSyncing: 100% (4/4), done in 1m15.686s\nFinalizing sync state...\nrepo sync has finished successfully.\n```\n\nBug: 513329573\nChange-Id: I754d3f3c78e86fdeee1a72115297a75b571bc497\nReviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/583883\nReviewed-by: Becky Siegel \u003cbeckysiegel@google.com\u003e\nTested-by: Gavin Mak \u003cgavinmak@google.com\u003e\nCommit-Queue: Gavin Mak \u003cgavinmak@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "32fa8d1566b81510ec9e5bd0ef3c1c6cdf1db4de",
      "new_mode": 33188,
      "new_path": "docs/fetch-cmd.md"
    },
    {
      "type": "modify",
      "old_id": "ec645bbfa2519e91703eaa71133c46f9afd79486",
      "old_mode": 33188,
      "old_path": "project.py",
      "new_id": "649196b016e4804314157a44d87a623a583a9050",
      "new_mode": 33188,
      "new_path": "project.py"
    },
    {
      "type": "modify",
      "old_id": "3973bcfec85e0a1b911ad0bd535d176abfc4c4c7",
      "old_mode": 33188,
      "old_path": "tests/test_project.py",
      "new_id": "ea7571030171e8002887847413abf5ac61d86b8b",
      "new_mode": 33188,
      "new_path": "tests/test_project.py"
    }
  ]
}
