Repository navigation
feat(server): clean up idle jj workspaces - #20755
THEjacob1000 wants to merge 8 commits into
Conversation
4c52513 to
8422ddc
Compare
|
I'd take this out of the stack and follow up later.
The ownership and stranded-ancestry checks are stricter than the git side, which is good. |
5e02f3c to
cbc2b11
Compare
Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com>
Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com> Co-authored-by: Omar Shaarawi <16183117+omarshaarawi@users.noreply.github.com>
…vcs kind Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com>
Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com>
…cs actions Co-authored-by: Лев Федорец <152093961+knocking4thcylinder@users.noreply.github.com>
Co-authored-by: Omar Shaarawi <16183117+omarshaarawi@users.noreply.github.com>
cbc2b11 to
244a503
Compare
|
Rechecked at 244a503 with jj 0.46. The fetch and removal fixes hold. I ran the exact git fetch from a secondary workspace with local One new major:
Minor:
|
Problem
Git worktree cleanup can't safely remove jj workspaces. This adds the jj side. It's auxiliary: nothing else in the stack depends on it, so it can be deferred until the rest has merged.
Change
JjStorageCleanuponly considers registered secondary workspaces with the expected managed bookmark, and never infers ownership from a path or touches the main workspace. Its fetch goes into privaterefs/t3/remotes/like every other background fetch, so localmainnever moves. A workspace is kept, with the reason reported, if it has edits, unsnapshotted, oversized or ignored files, a description on@, conflicts, or commits not on a bookmark. Removal re-checks the files on disk at the last moment and restores the workspace if anything changed. Repo-wide prune and removal share a lock, so a concurrent prune can't forget a workspace mid-removal. The.jjkeep guard stays for any repo not detected as jj, including colocated repos that fell back to Git.All three of @omarshaarawi's items are fixed, each with a real jj test: the fetch moving
main, removal deleting large files, and the dropped.jjguard.Scope and approval
Approval is pending in #18468. Commits 1 to 6 are dormant on their own, #20756 is the one that turns jj on, and #20755 (idle workspace cleanup) sits on top so it can wait until the rest lands. Tracks #1126, the originals #11373, #11382, #11383, #11384, and ports #13816, #16380. @gergesh's port was a reference.
GitHub can't create stacked PRs from a fork, so the diff carries the PRs below. Review the top commit only.
Verification
Automatic startup cleanup removed an idle managed workspace, while unsnapshotted, 20 MiB and described ones were kept with their reasons. The cleanup fetch advanced only the private ref, and a T3 Git worktree with
jj git init --colocatein it was kept.Screenshots are from the integrated stack before the latest rebase onto current main. After rebasing, the stack was re-verified with the automated tests and the process comparison; the manual pass wasn't repeated.
Managed workspace and cleanup evidence
Cleanup fetch ref observations
refs/heads/maincca316e82517f0b164b828bc228c4d507c313c53cca316e82517f0b164b828bc228c4d507c313c53refs/remotes/origin/maincca316e82517f0b164b828bc228c4d507c313c53cca316e82517f0b164b828bc228c4d507c313c53refs/t3/remotes/origin/main898a27a19f7395345e60958b81ec0b470e6440d7