jj icon indicating copy to clipboard operation
jj copied to clipboard

FR: jj commit --reset-author should also reset the author timestamp

Open farnoy opened this issue 1 year ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. In the index-less/working-copy/auto-commit model, I often have a long-standing empty commit that later gets re-purposed to deliver some change. This puts distance between when this commit is first created (as empty) and when the change is really done.

Describe the solution you'd like I think --reset-author could be repurposed for this, semantically, but we could also have another option. Something at describe/commit time feels like the right place.

Describe alternatives you've considered The best one I know is jj duplicate followed by a rebase, which re-creates the commit with the same parent, but you need to move the downstream commits over.

farnoy avatar Oct 22 '24 09:10 farnoy

I think --reset-author already does reset the author timestamp in addition to the name/email, just like in Git. Also, if a commit has no changes and an empty description, the author timestamp is automatically reset whenever the commit becomes non-empty or is given a description.

I'm not sure whether this behavior is mentioned in the docs, so it might be good to add it if it isn't.

scott2000 avatar Oct 22 '24 12:10 scott2000

Huh, I don't know what happened when I tried before but you're right, it does work. Even on immutable commits 👍

farnoy avatar Oct 22 '24 15:10 farnoy

Closing, it is documented and working as expected https://martinvonz.github.io/jj/latest/cli-reference/#jj-commit

farnoy avatar Oct 23 '24 08:10 farnoy