lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Allow rebasing with comitter date as author date

Open Insprill opened this issue 8 months ago • 5 comments

Is your feature request related to a problem? Please describe. Rebasing branches is a prevalent part of my workflow. To avoid mangling dates during this, I always rebase with the --committer-date-is-author-date flag to preserve the original date of the commit when viewed in GitHub, BitBucket, or any other application that shows the committer date instead of the author date. As far as I can tell, Lazygit has no way to set this flag globally for all rebase operations.

Describe the solution you'd like A config option to set this flag automatically when doing any type of rebase.

Describe alternatives you've considered

  • Rebasing outside of Lazygit.
  • Do complex interactive rebases within Lazygit, then go back and rebase again manually with the flag to fix the dates (when it is reasonable to do so).

Additional context The --committer-date-is-author-date flag implies --force-rebase, which may not always be desired. I suppose ideally it'd only be applied if the operation would actually change the committer date, but I'm not sure how Git handles dates when fast-forwarding to know if that's necessary, or if it's feasible to implement.

Insprill avatar Apr 27 '25 07:04 Insprill

I don't believe lazygit has a way to set this flag globally either. The only explicit interactions we do with committer date vs author date is allow sorting based on each of them.

Sounds like another case that would be helped by https://github.com/jesseduffield/lazygit/issues/2849

To make sure I'm hearing your request correctly, this is a setting that you image people would either want on all the time, or not at all? So it is better suited by a configuration option, and not by a 2nd keybinding that does a rebase with this flag.

ChrisMcD1 avatar May 02 '25 01:05 ChrisMcD1

Correct - I'd like it to always be enabled or disabled, but also having a keybind to do the opposite of the global setting when desired may be nice.

Insprill avatar May 03 '25 00:05 Insprill

~~There is also git config --global rebase.committerDateIsAuthorDate true that might help in this situation.~~ Only in the AI reality unfortunately.

Kaarel avatar Jun 05 '25 17:06 Kaarel

@Kaarel Can you link the docs for that? I tried looking it up, and couldn't find it.

ChrisMcD1 avatar Jun 05 '25 18:06 ChrisMcD1

Ok now thats a bit embarrasing. I was looking for the exact same functionality and found this issue. Something about being on GitHub triggered me to promp AI for a solution. And it ohh so helpfully and convincingly suggested me the above config setting that I didn't even bother to test it. Now that I finally am in a position to try this useful setting, it dares to fail on me! When I confronted the same AI bot - what gives, this not work - it kindly apologised and is now saying that this "is not a direct configuration option in Git". Really, now you tell me...

All I can say I hope for the survival of humanity, it's not true that in 6 month "AI is writing 90% of the code" :)

Kaarel avatar Jun 05 '25 20:06 Kaarel