Rebase only fully mutable branches in jj pull
A megamerge that integrates someone else's branch holds immutable commits, so --branch failed trying to rewrite the whole component. Skipping heads that descend from a non-trunk immutable commit leaves those branches untouched.
Assisted-by: Claude Opus 4.8 via Claude Code
diff --git a/.config/jj/config.toml b/.config/jj/config.toml
index 1a7bd9c9..c4119acf 100644
--- a/.config/jj/config.toml
+++ b/.config/jj/config.toml
@@ -129,7 +129,12 @@ pr = ["util", "exec", "--", "bash", "-c", """
"""]
pull = ["util", "exec", "--", "bash", "-c", """
jj git fetch
- jj rebase --branch "visible_heads() & mutable()" --destination "trunk()"
+ # Only rebase branches that are fully mutable. A megamerge that pulls in
+ # someone else's branch contains immutable commits, and --branch tries to
+ # rewrite the whole component, so the rebase fails. Excluding heads that
+ # descend from a non-trunk immutable commit leaves those branches alone and
+ # rebases just the stacks we own end to end.
+ jj rebase --branch "(visible_heads() & mutable()) ~ (immutable() ~ ::trunk())::" --destination "trunk()"
jj simplify-parents
jj sweep
"""]