fix(jj): enable unchanged-context expansion - #890
Conversation
|
@samuela is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
|
PR author is not in the allowed authors list. |
|
Awesome thank you! |
1743fe4 to
b9d9005
Compare
|
@benvinegar thanks for the review, i believe i have addressed all your comments, lmkwyt |
benvinegar
left a comment
There was a problem hiding this comment.
Thanks — the three earlier threads are addressed. I found two additional user-config interactions that still make the new “exact source” path unsafe, plus the Windows CI failure:
-
commands.ts:23,228-259: use an alias-insensitive commit-ID template. JJ template aliases can shadow the barecommit_idkeyword. With a validtemplate-aliases.commit_idthat emits an older full commit ID,hunk show @pins the patch, source reader, and cache key to that older commit. I reproduced the adapter showing an old add-file patch instead of the current@diff.self.commit_id()bypassed the alias in the same repository. -
source.ts:45-47,74-86: neutralize fileset andfile_showtemplate customization.root-file:<value>is itself shadowable throughfileset-aliases; I reproducedroot-file:"a.txt"selecting botha.txtandb.txt. Separately,jj file showdefaults to user-configuredtemplates.file_show, which can prepend metadata to the source. Together, the reader returnedPREFIX:a.txt\none\nPREFIX:b.txt\nbee\nas one file's attested source. A bare JSON-quoted path fromrepoRootplus an explicit empty-Ttemplate (-T '""') avoided both customizations in my local JJ 0.41.0 test. Please add regression coverage for both configurations. -
source.test.ts:66: make the integration filename Windows-valid. The double quote in-note [exact] "file".txtis illegal on Windows, and the Windows compatibility job is currently red withENOENTat the followingwriteFileSync. The quote case can stay in the mocked argv test; the real filesystem fixture should use only cross-platform-valid metacharacters.
The focused source tests, typecheck, lint, dependency check, and tracked-file format check otherwise pass locally. I also exercised the real branch TUI under tmux against local JJ repositories: z expanded the omitted source correctly, and a nested-cwd show @ -- file.txt selected only sub/file.txt and expanded its source.
This comment was generated by Pi using OpenAI GPT-5.6-sol
b9d9005 to
3359e45
Compare
3359e45 to
9d999ab
Compare
|
done in 9d999ab |
benvinegar
left a comment
There was a problem hiding this comment.
The requested fixes are addressed, including the Windows fileset regression, and the full CI matrix is green.
This comment was generated by Pi using OpenAI GPT-5.6-sol
Problem
Git-backed reviews can load complete file contents and expand context omitted from a patch. The Jujutsu adapter returned only patch text, so the same gaps appeared as static
··· N unchanged lines ···rows inhunk showandhunk diff.Approach
@or bookmark.jj file show --ignore-working-copyreader and expose it through the existing VCS extension contract.The resulting JJ review uses the existing expandable row and
zinteraction:And here's some screenshot of it in action:
Validation
bun test src/extensions/default/vcs/jujutsu/commands.test.ts src/extensions/default/vcs/jujutsu/source.test.ts src/extensions/default/vcs/jujutsu/index.test.ts— 24 passedbun run test— 1627 passed, 3 skippedbun run typecheckbun run format:checkbun run lintbun run deps:checkgit diff --checkhunk show mqin a pure JJ workspace: the previously static gap expanded and collapsed withz.Tested on NixOS/Linux with JJ 0.41.0. macOS and Windows were not tested manually.