dherreraj
5c3c47ebea
fix(hooks): run the rebuild from the checkout's top level ( #3258 )
...
The rebuild bodies read graphify-out/ and its .graphify_root relative to
the cwd, but git does not always start hooks at the top level. With
GIT_DIR exported and no GIT_WORK_TREE (a nested git call from another
hook or tool), git takes the caller's cwd as the work tree and
`git rev-parse --show-toplevel` echoes that subdirectory. A stray
graphify-out/ left there by an earlier run then roots the rebuild at the
subdirectory; for .claude/worktrees/ that walks every linked worktree.
The #3265 guard rejects a `..` marker, but its fallback is the same cwd.
Add a shared _TOPLEVEL_ANCHOR snippet right after _WORKTREE_GUARD in all
four hooks. In the standard layout it cds to the parent of the absolute
common .git dir; with GIT_WORK_TREE or a separate git dir it keeps git's
own --show-toplevel. GIT_DIR is rewritten to its absolute form so later
git calls still resolve. The block already runs in a subshell, so the cd
does not leak into chained hooks.
(cherry picked from commit e6193ab816 )
2026-10-23 16:11:08 +01:00
..
2026-10-13 10:27:02 +01:00
2026-10-23 16:11:06 +01:00
2026-10-20 10:35:23 +01:00
2026-10-16 17:10:31 +01:00
2026-10-16 17:10:31 +01:00
2026-10-12 14:49:28 +01:00
2026-10-16 18:25:28 +01:00
2026-10-12 23:02:50 +01:00
2026-10-13 22:21:43 +01:00
2026-10-12 14:49:28 +01:00
2026-10-16 18:25:28 +01:00
2026-10-22 13:16:25 +01:00
2026-10-16 17:14:07 +01:00
2026-10-13 11:14:16 +01:00
2026-10-23 16:11:07 +01:00
2026-10-20 10:35:24 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 11:14:16 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:48 +01:00
2026-10-13 22:21:43 +01:00
2026-10-12 14:50:32 +01:00
2026-10-13 22:21:48 +01:00
2026-10-12 22:37:55 +01:00
2026-10-16 18:21:28 +01:00
2026-10-13 22:21:43 +01:00
2026-10-20 11:28:07 +01:00
2026-10-12 22:58:40 +01:00
2026-10-20 10:50:37 +01:00
2026-10-14 22:53:26 +01:00
2026-10-22 13:46:54 +01:00
2026-10-23 15:38:48 +01:00
2026-10-16 18:21:28 +01:00
2026-10-14 22:31:57 +01:00
2026-10-13 22:53:44 +01:00
2026-10-12 22:37:54 +01:00
2026-10-13 11:14:22 +01:00
2026-10-16 17:12:53 +01:00
2026-10-22 13:46:54 +01:00
2026-10-13 10:26:57 +01:00
2026-10-13 10:26:57 +01:00
2026-10-16 17:10:31 +01:00
2026-10-23 16:11:08 +01:00
2026-10-12 14:49:28 +01:00
2026-10-13 11:14:16 +01:00
2026-10-14 22:31:57 +01:00
2026-10-22 13:12:56 +01:00
2026-10-12 22:37:54 +01:00
2026-10-12 22:37:54 +01:00
2026-10-22 13:12:56 +01:00
2026-10-12 23:02:44 +01:00
2026-10-12 23:02:50 +01:00
2026-10-16 17:10:31 +01:00
2026-10-21 19:33:01 +01:00
2026-10-16 17:11:41 +01:00
2026-10-21 19:33:10 +01:00
2026-10-13 11:14:16 +01:00
2026-10-20 10:35:23 +01:00
2026-10-20 10:35:22 +01:00
2026-10-23 15:51:09 +01:00
2026-10-20 10:35:22 +01:00
2026-10-20 11:28:04 +01:00
2026-10-16 17:10:31 +01:00
2026-10-20 14:57:06 +01:00
2026-10-12 22:58:40 +01:00
2026-10-23 15:51:09 +01:00
2026-10-22 13:46:52 +01:00
2026-10-13 22:53:44 +01:00
2026-10-22 13:48:14 +01:00
2026-10-23 16:11:06 +01:00
2026-10-13 11:16:15 +01:00
2026-10-22 13:46:53 +01:00
2026-10-22 13:13:03 +01:00
2026-10-13 11:14:16 +01:00
2026-10-14 22:53:26 +01:00
2026-10-14 22:53:26 +01:00
2026-10-20 11:28:03 +01:00
2026-10-23 15:51:09 +01:00
2026-10-22 13:46:54 +01:00
2026-10-20 11:28:05 +01:00
2026-10-12 14:49:34 +01:00
2026-10-22 13:46:54 +01:00
2026-10-13 11:14:30 +01:00
2026-10-13 10:27:02 +01:00
2026-10-20 10:50:36 +01:00
2026-10-12 22:37:54 +01:00
2026-10-12 22:37:55 +01:00
2026-10-20 10:55:51 +01:00
2026-10-12 13:02:22 +01:00
2026-10-16 17:11:42 +01:00
2026-10-12 22:37:54 +01:00
2026-10-16 17:11:41 +01:00
2026-10-13 22:53:44 +01:00
2026-10-12 22:58:40 +01:00
2026-10-20 10:53:04 +01:00
2026-10-16 17:12:53 +01:00
2026-10-20 10:35:37 +01:00
2026-10-13 11:14:16 +01:00
2026-10-21 19:32:46 +01:00
2026-10-22 13:12:57 +01:00
2026-10-22 13:47:04 +01:00
2026-10-20 11:28:03 +01:00
2026-10-16 17:13:49 +01:00
2026-10-20 16:56:09 +01:00
2026-10-16 17:13:54 +01:00
2026-10-12 14:49:29 +01:00
2026-10-20 16:56:09 +01:00
2026-10-20 15:40:39 +01:00
2026-10-16 17:12:42 +01:00
2026-10-22 13:49:38 +01:00
2026-10-22 13:48:29 +01:00
2026-10-22 13:47:26 +01:00
2026-10-13 11:14:16 +01:00
2026-10-20 10:35:25 +01:00
2026-10-13 11:14:16 +01:00
2026-10-12 22:37:54 +01:00
2026-10-22 13:46:54 +01:00
2026-10-12 23:02:50 +01:00
2026-10-14 22:53:26 +01:00
2026-10-12 22:58:40 +01:00
2026-10-23 15:54:58 +01:00