Skip to content

Conversation

@bryango
Copy link
Contributor

@bryango bryango commented Dec 7, 2025

Implement record --fixup=<rev> similar to reword --fixup=<rev>, i.e. by generating a commit message with the fixup! ... prefix, suitable for use with git rebase --autosquash.

There is an alternative behavior that we can implement: since now we have move --fixup -d <rev> we can directly squash the changes into <rev> without even committing it at all. This behavior would be similar to jj squash --into=<rev>. However, I opted not to do this as the squash operation may fail (e.g. due to merge conflicts) and it seems more natural for the semantics of record to be the same as reword. What do you think?

By the way, although record and reword have similar semantics, their implementations are quite different: record simply calls git commit directly, and we simply pass along the --fixup flag after resolving the revset expressions.

Introduce `MessageArgs` to group `-m`/`--message` and `--fixup` options.
Apply this struct to `record` and `reword` commands for improved
modularity and reusability of argument definitions.

Also refactor the `fixup!` message generation into a dedicated helper.
Allow specifying a commit to fixup using a revset.
The `record` command resolves the revset and passes the OID to `git commit --fixup`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant