)]}'
{
  "commit": "a468ea7752cddd67fa2242ef038ac96f53c35a6a",
  "tree": "42dd5085036f44d3559a992ee12b465850e5c095",
  "parents": [
    "c2c330ba4a92c915f0180457f0d7ee29031bb253"
  ],
  "author": {
    "name": "Gavin Mak",
    "email": "gavinmak@google.com",
    "time": "Thu Sep 03 22:55:57 2026 +0000"
  },
  "committer": {
    "name": "gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "email": "gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Sep 15 12:53:01 2026 -0700"
  },
  "message": "sync: implement reprojectcmd for the local half\n\nAdd `repo.reprojectcmd`, the checkout counterpart to `repo.fetchcmd`.\nWhen set, `repo sync` runs this command instead of Git to materialize a\nproject\u0027s index and worktree at the target tree, while `repo` handles\nref updates directly via `git update-ref`.\n\nThis replaces Git\u0027s tree materialization steps: detaching HEAD,\nfast-forwarding, and hard-resetting. Rebasing is not delegated, and the\ncommand is skipped if HEAD is already at the target, if HEAD is ahead of\nthe target during fast-forward, or for MetaProjects.\n\nThe command runs in a subshell with project environment variables (such\nas `REPO_TREV`). Before running, `repo` ensures no operation is in\nprogress and no staged changes exist. Worktree collision detection is\ndelegated to the command (preserving benign unstaged/untracked edits).\nAfterward, `repo` verifies that HEAD was untouched and that the index\nmatches the target tree.\n\nLike `repo.fetchcmd`, this requires `repo.uselocalgitdirs`. Nested\nprojects and submodules are unsupported; `repo sync` fails if the\nmanifest contains any while `repo.reprojectcmd` is enabled.\n\nVerified end-to-end with repo init using local-gitdirs, repo.fetchcmd,\nand repo.reprojectcmd (\u0027git -C $REPO_PATH read-tree -m -u $REPO_TREV\u0027):\n  * Verified detached HEAD checkout and correct reflog generation across\n    projects.\n  * Verified benign unstaged edits and untracked files survive checkout.\n  * Verified conflicting untracked files fail with exit 128 without\n    clobbering worktree.\n  * Verified staged changes fail upfront before reprojectcmd is executed.\n\nBug: 513329573\nChange-Id: I964d24d22dccffc05a9b991ad69f3a7e93268c01\nReviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/626281\nTested-by: Gavin Mak \u003cgavinmak@google.com\u003e\nReviewed-by: Brian Gan \u003cbrgan@google.com\u003e\nCommit-Queue: Gavin Mak \u003cgavinmak@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "32fa8d1566b81510ec9e5bd0ef3c1c6cdf1db4de",
      "old_mode": 33188,
      "old_path": "docs/fetch-cmd.md",
      "new_id": "b125ed3440c30a65725a75cbc9a3b656000406e0",
      "new_mode": 33188,
      "new_path": "docs/fetch-cmd.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "76e1de8221a3b463c7a440fe72b78f57ac316670",
      "new_mode": 33188,
      "new_path": "docs/reproject-cmd.md"
    },
    {
      "type": "modify",
      "old_id": "a084d8db8f5688b0851c1bae9bdddfe1dc211401",
      "old_mode": 33188,
      "old_path": "project.py",
      "new_id": "783aead06fe0a949cec805005a475b8c98cc8ffa",
      "new_mode": 33188,
      "new_path": "project.py"
    },
    {
      "type": "modify",
      "old_id": "d88ec883e7e98ec6a703ce1e1bd0213dbfae265b",
      "old_mode": 33188,
      "old_path": "subcmds/sync.py",
      "new_id": "c51ecf38594eff3f16f46877741b0723ca3c271d",
      "new_mode": 33188,
      "new_path": "subcmds/sync.py"
    },
    {
      "type": "modify",
      "old_id": "911bf72854e0e55f8950c4b72b677cbbf45dde36",
      "old_mode": 33188,
      "old_path": "tests/test_project.py",
      "new_id": "764fbc469d95dc6d7dbbc6d2d5475da4f7fad644",
      "new_mode": 33188,
      "new_path": "tests/test_project.py"
    },
    {
      "type": "modify",
      "old_id": "e929f22b9eb5ca6697e0a10257f182ebd73f5927",
      "old_mode": 33188,
      "old_path": "tests/test_subcmds_sync.py",
      "new_id": "39d9f03b1951b005c9f485f5ebaff6313b9202f7",
      "new_mode": 33188,
      "new_path": "tests/test_subcmds_sync.py"
    }
  ]
}
