git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:04 UTC

Re: How dangerous is --committer-date-is-author-date these days?

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 28, 2024, 09:49 UTC
Message-ID
<aa981bb7-dd3b-4e63-9769-0fc2559983e6@gmail.com>
In-Reply-To
<6af09726-e3bf-4903-87ae-9524ad334678@kdbg.org>
Hi Johannes
On 28/09/2024 07:59, Johannes Sixt wrote:
Show 10 quoted lines
> 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?

Support was added to the sequencer to reduce the differences between the two rebase backends in the hope that one day we'll be able to remove the apply based backend. Support was added to the shell based rebase in 570ccad33e (rebase: add options passed to git-am, 2009-03-18), there is not much discussion in the commit message or mailing list thread [1] about the motivation for adding this support.

[1] https://lore.kernel.org/git/1237409629-4289-1-git-send-email-barra_cuda@katamail.com/

> - Should we remove it?

It is only a problem when re-arranging commits - even then I think the commit walk machinery has some tolerance to commit dates that do not increase monotonically in order accommodate clocks that are out of sync. It is perfectly fine for non-interactive rebases (or just squashing fixups) so removing it seems like throwing out the baby with the bathwater.

> - Should we require an explicit --force instead of implying it?

I think we'd want a convincing reason to change the behavior - the other options that require the history to be rewritten all imply "--force" rather than requiring the user to pass it separately.

> - Should we issue a big warning about the consequences?

It would certainly be worth adding a warning to the documentation. To issue a warning at run-time would require us to check that the commits are actually being re-arranged as there are plenty of reasons to use "--interactive" without changing the order of commits.

Best Wishes
Phillip
Previous: Johannes SixtNext: Phillip Wood
Message 2 of 25 in “How dangerous is --committer-date-is-author-date these days?”
  1. Johannes SixtSep 28, 2024
  2. Phillip WoodSep 28, 2024
  3. Phillip WoodSep 28, 2024
  4. Kristoffer HaugsbakkSep 30, 2024
  5. Junio C HamanoSep 30, 2024
  6. doc: warn against --committer-date-is-author-datekristofferhaugsbakk@fastmail.com, Oct 8, 2025
  7. SZEDER GáborOct 8, 2025
  8. Phillip WoodOct 9, 2025
  9. Kristoffer HaugsbakkOct 9, 2025
  10. Kristoffer HaugsbakkOct 9, 2025
  11. Junio C HamanoOct 9, 2025
  12. Kristoffer HaugsbakkOct 9, 2025
  13. Junio C HamanoOct 9, 2025
  14. Kristoffer HaugsbakkOct 9, 2025
  15. Johannes SixtOct 11, 2025
  16. Kristoffer HaugsbakkOct 16, 2025
  17. Kristoffer HaugsbakkOct 16, 2025
  18. Johannes SixtOct 16, 2025
  19. Kristoffer HaugsbakkOct 16, 2025
  20. Junio C HamanoOct 16, 2025
  21. Kristoffer HaugsbakkNov 19, 2025
  22. doc: warn against --committer-date-is-author-datekristofferhaugsbakk@fastmail.com, Nov 20, 2025
  23. Johannes SixtNov 20, 2025
  24. Phillip WoodNov 26, 2025
  25. Kristoffer HaugsbakkNov 27, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.