feat: add post-create symlink hooks#58
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<primary-root>/.wt/config.toml에[[hooks.postCreate.symlinks]]설정을 추가했습니다.wt create와wt path --create가 새 worktree 생성 직후 primary repo의 파일/디렉터리를 새 worktree 안에 상대 symlink로 연결합니다.onMissingSource/onExistingTarget정책으로 제어합니다.pr-body강제 검사 job과 전용 script를 제거했습니다.User impact
<primary-root>/.wt/config.toml[[hooks.postCreate.symlinks]]wt create/wt path --create에서 새 worktree가 실제 생성될 때만 post-create symlink가 적용됩니다.premerge만 PR 필수 check로 남습니다.Behavior
예시:
source는 primary repo root 기준 상대 경로입니다.target은 새 worktree root 기준 상대 경로입니다.target을 생략하면source와 같은 상대 경로를 사용합니다.Safety
..로 root를 벗어나는 경로는 거부합니다.onExistingTarget = "fail"로 실패합니다.onExistingTarget = "skip"이면 기존 target을 덮어쓰지 않습니다.onMissingSource = "skip"이 기본값이라 로컬 secret 파일이 없는 환경에서도 worktree 생성이 막히지 않습니다.wt remove/wt cleanup --apply로 worktree를 제거해도 primary repo의 source 파일은 삭제되지 않습니다.Tests
wt run feat/create-hooks -- make fmtwt run feat/create-hooks -- make testwt run feat/create-hooks -- make checkwt run feat/create-hooks -- make premergepath feature-x --create실행 후.env.localsymlink 생성 확인E2E guide
현재 repo 기준:
임시 repo 기준:
E2E Done
wt run feat/create-hooks -- make fmtwt run feat/create-hooks -- make testcmd/wt,internal/git,internal/hosting,internal/worktree테스트 통과wt run feat/create-hooks -- make checkwt run feat/create-hooks -- make premergecreated=<repo>/.wt/feature-x,link=../../.env.localDocs
README.mddocs/spec/cli.mddocs/policy/worktree.mddocs/ux/agents.mddocs/examples/skills/wt-worktree/SKILL.mddocs/release/notes.mdRelease
CHANGELOG.md는 직접 수정하지 않았습니다.