Repository navigation
Conversation
…로 보지 않는다 (#80) track 이 파일마다 고친 worktree 루트를 세션 파일(s.roots)에 남기고, Stop · SessionEnd 는 지금 체크아웃의 루트에서 고친 파일만 막고 커밋한다. 루트 기록이 없는 예전 항목은 예전처럼 다룬다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011H9PaWE4qiwEKAf5b31vKQ
Owner
Author
|
v7.1.0(#104)에 v7.1 원본에 맞춰 옮겨 반영했습니다 — 이 PR 은 옛 기점(v7.0.x 이전)이라 닫습니다. |
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.
Fixes #80
원인
세션 파일은 공통 git 디렉터리(
<common>/harness/sessions/<sid>.json)에 세션마다 하나입니다.track.js는 이 파일에 고친 파일의 저장소 상대 경로만 더합니다.stop.js·session-end.js는 이 목록 전체를 지금 cwd 의 체크아웃(info.root) 기준으로uncommittedOf합니다. 그래서 다음 순서로 문제가 생겼습니다.a.js를 고치고 레인 브랜치에 커밋합니다.a.js가 있습니다.a.js를 「이 세션이 고친 미커밋 파일」로 보고 막습니다. 차단 상한(MAX_BLOCKS)을 넘기면stop-fallback이 그 파일을wip(session …)로 메인 브랜치에 커밋합니다. 이슈의last_commit.by=stop-fallback과 같습니다.수정
track.js: 파일마다 고친 worktree 루트(info.root)를s.roots[파일]에 더합니다. 이 기능 전에 루트 없이 기록된 파일은'*'로 표시합니다. 이런 파일은 예전처럼 어느 체크아웃에서든 이 세션의 것으로 봅니다._common.js:filesIn(sess, root)를 추가했습니다. 이 함수는 그 루트에서 고친 파일과 루트 기록이 없는 파일만 돌려줍니다. 비교할 때 Windows 에서는 대소문자를 가리지 않습니다(keyOf).stop.js·session-end.js:sess.files대신C.filesIn(sess, info.root)로 막고 커밋합니다. session-end 가 기록을 비울 때는roots도 지웁니다.files형식은 그대로입니다. 그래서files를 읽는 guard(남의 파일 경고) · board · status 는 바뀌지 않습니다.재현 테스트
tests/unit/test_v5_hooks.js의[lane] (#80)3개입니다. 실제 hook 프로세스와 실제 git 을 씁니다. 순서는 다음과 같습니다. 세션 XWT1 이 레인에서a.js를 고치고 커밋합니다. 메인 체크아웃에는 다른 사람의 미커밋a.js가 있습니다. 메인 cwd 에서 Stop 을 세 번 부릅니다(stop_hook_activefalse → true → true).harness/를 stash 로 되돌려 확인): 첫 Stop 이`a.js` — 이 세션이 고친 파일이 커밋되지 않았습니다로 막습니다. 이어서 fallback 이 다른 사람의a.js를 main 에 커밋합니다. 3개 중 2개가 실패합니다.a.js는 미커밋으로 남습니다. 메인에서 이 세션이 고친d.js는 여전히 그 파일만 막습니다. session-end 도d.js만 커밋합니다.검증
node tests/run.js→ 1105 PASS / 0 FAIL, 종료 코드 0(main 1102 + 3). 이 클라우드 환경에서는GH_TOKEN/GITHUB_TOKEN을 지우고 돌렸습니다(BR-15·16 이 로그인 없음을 가정합니다).적대적 검토
roots가 없습니다. 이때filesIn은files를 그대로 돌려줍니다. 업그레이드 중에 이미 기록된 파일을 다시 고치면'*'가 붙습니다. 어느 경우에도 예전보다 덜 커밋하는 일은 없습니다. 새로 기록된 파일만 루트로 거릅니다.repoInfo(git rev-parse --show-toplevel→path.resolve)에서 옵니다. 하위 폴더에서 시작한 세션도 같은 루트를 씁니다. Windows 는 대소문자를 접어 비교합니다. 셸 · CRLF 와는 관계가 없습니다.Generated by Claude Code