← ClaudeAtlas

jj-extract-gitignoreslisted

Extract `.gitignore` changes from buried commits in a jj chain back into named in-between commits that sit right after a target ancestor (default: the project's init commit). Use when the user says "extract gitignore changes", "split off the gitignores", "roll the gitignores back to <commit>", "retroactive gitignore remediation", "/jj-extract-gitignores", or wants to land later-committed `.gitignore` additions as logical ancestors of the work that uses them. Builds a sequential chain of named in-between commits — not siblings — because siblings conflict at squash time when they all append to the same end-of-file position. Each in-between commit holds exactly one original commit's `.gitignore` delta, preserving its hunk exactly. `@` does not move. Also covers a related variant for modifying a tracked path in an ancestor commit without `jj edit` (which would let auto-tracking pollute the ancestor) — uses `jj restore --from @ --to <new>` instead of squash, with a `jj restore --from 'root()'` fix for any delete/m
alycda/dotfiles · ★ 1 · Data & Documents · score 60
Install: claude install-skill alycda/dotfiles
# jj-extract-gitignores This skill rolls `.gitignore` changes back through a jj chain to land as logical ancestors instead of staying mixed into feature commits. The result is a tidy chain where every `.gitignore` addition lives in its own small, named commit positioned right after the target ancestor. ## When this applies Alyssa wants to retroactively organize `.gitignore` history when later commits added ignores that should have been in place earlier. Common phrasing: "extract gitignore changes", "split off the gitignores", "retroactive gitignore remediation", "roll the gitignores back to pm". She does not want sibling commits — those conflict at squash time. She wants in-between commits in the main chain. ## Inputs - **Target ancestor** (optional, default = the project's init commit, often visible as `pm` or whatever the user names). If the user provides a short prefix like `pm`, run `jj log -r '<prefix>' --no-graph --limit 1` to confirm resolution. - **Path filter** (optional, default `.gitignore`). The skill name says "gitignores" but the recipe generalizes to any path. If Alyssa points at a different path, use that. ## Preconditions to verify 1. The repo is a jj repo (`.jj/` exists). If not, abort and surface that this skill is jj-only. 2. The target is an ancestor of `@`. Check with `jj log -r '<target> & ::@' --no-graph --limit 1`. If empty, abort. 3. The target's commits and descendants are not pushed (no remote bookmark, or the bookmark sits be