2.0 KiB
2.0 KiB
allowed-tools, argument-hint, description, model
| allowed-tools | argument-hint | description | model | |
|---|---|---|---|---|
| Bash(jj log:*), Bash(jj diff:*), Bash(jj status:*), Bash(jj squash:*) |
|
Merge commits in the stack | claude-haiku-4-5 |
Context
- Current status: !
jj status - Current commit: !
jj log -r @ --no-graph -T 'concat(change_id.short(), ": ", description)' - Parent commit: !
jj log -r @- --no-graph -T 'concat(change_id.short(), ": ", description)' - Recent stack: !
jj log -r 'ancestors(@, 5)' -T 'concat(change_id.short(), ": ", description)' --no-graph
Your Task
Merge commits in the jujutsu stack.
Usage Modes:
-
Default (no argument): Merge current commit (@) into its parent (@-)
jj squashThis moves all changes from @ into @-, then abandons @.
-
With revision: Merge a specific revision into its parent
jj squash -r <revision>Useful for cleaning up a specific commit in the stack.
When to use:
- Multiple WIP commits for the same feature
- Cleaning up incremental work before sharing
- Combining related changes into a single commit
- Fixing typos or small changes that belong in the parent
Workflow:
- Explain what will be merged (which commits, what changes)
- Execute the squash operation
- Show the result with
jj logand confirm the changes
Important:
- Squashing is safe - you can undo with
jj undo - Use
jj squash -ifor interactive mode to select specific changes - Consider if you should update the description after squashing
Example scenarios:
Scenario 1: Merge current WIP into parent
# Before: @ = "WIP: fix tests", @- = "Add login feature"
jj squash
# After: @ = "Add login feature" (now includes test fixes)
Scenario 2: Merge specific revision
# Merge revision abc123 into its parent
jj squash -r abc123
Scenario 3: Interactive squash
# Choose which changes to move
jj squash -i
Show result: !jj log -r 'ancestors(@, 3)' -T 'concat(change_id.short(), ": ", description)' --no-graph