jj
jj copied to clipboard
FR: Improve `jj backout` generated description
Is your feature request related to a problem? Please describe.
Currently when a commit is created with jj backout
, the description just mentions the commit hash. This makes a very poor commit message
Describe the solution you'd like
I would just copy what git revert
does and use "Revert '$first_line_of_commit_being_reverted'"
Describe alternatives you've considered I haven't considered any alternatives.
Additional context
Would it be acceptable to put the first line in the body of the message, rather than in the title? Or do you want it in the title? I ask because putting the hash in the title is kind of nice since it's often hyperlinkable on places like GitHub, so you can click to see exactly what it's reverting anyway. For jj log
itself, it will also allow you to see the commit from the default short, one-line format, rather than needing to expand the message e.g. with jj show
to find the commit it's backing out.
I find the last bit the most important and subtle part; due to the fact the jj log
is truncated by default, to only show as short a history as possible, I actually find the commit hash is more useful since you can just immediately jj show
that hash, but you can't necessarily look up reverted commit from the description without something like jj log -r description(exact:"...")
or whatnot.
That said I agree just having a fully empty message is otherwise not great!
I think I do really want line one of the commit to be line one of the back out because:
- It prepopulates the title of GitHub pull requests. At work, we use a squash-merge only PR system, so optimizing for that is best (for me).
- It's much rarer that I actually need to see the commit that was reverted. I just need to understand the general commit that was reverted.
Perhaps this means it's :star: template time :star: ?