How dangerous is --committer-date-is-author-date these days?
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Sep 28, 2024, 06:59 UTC
- Message-ID
- <6af09726-e3bf-4903-87ae-9524ad334678@kdbg.org>
The option --committer-date-is-author-date of git-rebase rewrites the committer dates like its name suggests. It is not uncommon that commits are rearranged and cherry-picked. Then, as a consequence, author dates are not decreasing when walking back in history. Now, if such a history with a non-monotonic author date is rebased one final time with --committer-date-is-author-date, this creates a history with non-monotonic committer dates. I recall that this is not a good thing to have since it can confuse our history walker.
- Why do we have --committer-date-is-author-date in a porcelain command? - Should we remove it? - Should we require an explicit --force instead of implying it? - Should we issue a big warning about the consequences?
Here is the discussion that introduced the option git-rebase: rebase -i: support --committer-date-is-author-date https://lore.kernel.org/git/20200817174004.92455-4-phillip.wood123@gmail.com/
I am asking this here after I have participated in this Stackoverflow question, where git rebase --committer-date-is-author-date was suggested as a solution to "rewrite name and email, but not timestamps". https://stackoverflow.com/questions/79024409
-- Hannes