git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>, Git Mailing List <git@vger.kernel.org>
Cc: Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: How dangerous is --committer-date-is-author-date these days?
Date: Sat, 28 Sep 2024 10:49:17 +0100	[thread overview]
Message-ID: <aa981bb7-dd3b-4e63-9769-0fc2559983e6@gmail.com> (raw)
In-Reply-To: <6af09726-e3bf-4903-87ae-9524ad334678@kdbg.org>

Hi Johannes

On 28/09/2024 07:59, Johannes Sixt wrote:
> 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

  reply	other threads:[~2024-09-28  9:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-28  6:59 How dangerous is --committer-date-is-author-date these days? Johannes Sixt
2024-09-28  9:49 ` Phillip Wood [this message]
2024-09-28 10:04   ` Phillip Wood
2024-09-30 14:49     ` Kristoffer Haugsbakk
2024-09-30 17:08       ` Junio C Hamano
2025-10-08 20:41       ` SZEDER Gábor
2025-10-08 19:45 ` [PATCH] doc: warn against --committer-date-is-author-date kristofferhaugsbakk
2025-10-09 13:46   ` Phillip Wood
2025-10-09 14:31     ` Kristoffer Haugsbakk
2025-10-09 20:47       ` Kristoffer Haugsbakk
2025-10-09 21:58         ` Junio C Hamano
2025-10-09 22:56           ` Kristoffer Haugsbakk
2025-10-09 21:41     ` Junio C Hamano
2025-10-09 21:57       ` Kristoffer Haugsbakk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa981bb7-dd3b-4e63-9769-0fc2559983e6@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).