Repository navigation
Conversation
This branch has not been deployed
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.
무엇을 바꾸나
여러 OMK 세션이 같은 저장소에서 작업할 때, 터미널에서 직접
git commit해도 다른 세션이 점유(lease)한 경로가 커밋되지 않게 한다.scripts/check-scope-lease.mjs:<git-common-dir>/omk-leases/*.json리스를 읽어 스테이지된 경로와 비교한다. 살아 있는 다른 세션이 점유한 경로가 있으면 exit 1로 커밋을 거부하고 세션·브랜치·워크트리·PID를 보여준다.OMK_LEASE_AS=<세션 접두사> git commit .....husky/pre-commit: 첫 단계로 위 검사를 실행한다.scripts/test/check-scope-lease.test.mjs: 충돌 판정 단위 테스트와 실제 저장소에서의 스크립트 실행 테스트. 훅이 내보내는GIT_*를 제거해 바깥 저장소에 쓰지 않는다(git-env-isolation규칙).리스 파일은 사용자 전역 확장
scope-lease가 만든다. 이 PR은 그 리스를 커밋 단계에서도 지키게 하는 쪽만 다룬다.검증
npm run check전체: 이 커밋의 husky pre-commit에서 통과(✅ All pre-commit checks passed!).node --test scripts/test/check-scope-lease.test.mjs: 6/6. 자기 세션 예외를 지우면 2개가 실패해 그 경로를 잡는다.GIT_DIR/GIT_INDEX_FILE을 노출한 상태로 테스트를 돌려도 바깥 저장소 HEAD와 인덱스 불변.git commit: 살아 있는 다른 세션이 점유한 파일을 스테이지하면 husky가 exit 1로 막고 점유자를 표시.OMK_LEASE_AS를 주면 점유 검사를 통과.미검증·한계
.husky/_가 없는 체크아웃(npm install 전)에서는 훅이 돌지 않는다./proc이 없으면ps로 부모 PID를 찾는다. Windows는 Git Bash에서만 확인 가능하며 이번에 확인하지 않았다.