martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
7.25k stars 240 forks source link

commit: add `--reset-author` option #3998

Closed scott2000 closed 3 hours ago

scott2000 commented 2 days ago

Since jj describe --reset-author works, I also expected jj commit --reset-author to work, so I think this would be a good option to add.

Checklist

If applicable:

scott2000 commented 14 hours ago

It might be okay for jj commit to always reset author (or timestamp at least.) Is that surprising?

I think this might be surprising, since as @PhilipMetzger said, I tend to think of jj commit as being the same as jj describe followed by jj new, and I don't think describe should update the author information. If we do change it, it might be good to have it be opt-in through a config option.

Are there any existing cases where the behavior is different for commit compared to desc + new?

yuja commented 14 hours ago

Are there any existing cases where the behavior is different for commit compared to desc + new?

No, I don't think so (except for splitting.)

I just thought it might make sense to people coming from other VCSs if commit updated author timestamp. I don't have strong feeling about that.

scott2000 commented 13 hours ago

I just thought it might make sense to people coming from other VCSs if commit updated author timestamp. I don't have strong feeling about that.

Yeah, it does seem like it would better match the expectations of new users coming from Git. One concern I have is that new users might also use jj split to replicate git commit -p and then be confused why it doesn't behave the same as jj commit.

If we update jj commit, we could also update jj split to reset the author on the first commit, but I'm not sure whether that would be surprising when splitting commits other than @, since semantically the second commit might be the "new" one.

I'm curious how many Git users actually know that there's separate author and committer timestamps. It could be the case that most people don't even know/care how it works in Git, in which case it wouldn't matter that jj behaves differently.

PhilipMetzger commented 11 hours ago

I just thought it might make sense to people coming from other VCSs if commit updated author timestamp. I don't have strong feeling about that.

Yeah, it does seem like it would better match the expectations of new users coming from Git. One concern I have is that new users might also use jj split to replicate git commit -p and then be confused why it doesn't behave the same as jj commit.

Let's not change the meaning of commit to perfectly match Git, there's no reason to as Jujutsu is a separate system.

yuja commented 11 hours ago

One concern I have is that new users might also use jj split to replicate git commit -p and then be confused why it doesn't behave the same as jj commit.

I wouldn't consider jj split as a command to finish up the first commit, so I wouldn't expect it to update author timestamp. However, I see your point.

emilazy commented 11 hours ago

I'm curious how many Git users actually know that there's separate author and committer timestamps. It could be the case that most people don't even know/care how it works in Git, in which case it wouldn't matter that jj behaves differently.

My anecdotal experience is that most Git users barely think about timestamps at all.