"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: [patch] preserve and show author dates
To:
"Sven M. Hallberg" <pesco@khjk.org>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 16 Aug 2024 09:43:35 +0200

Download raw body.

Thread
On Wed, Aug 07, 2024 at 10:49:37AM +0200, Sven M. Hallberg wrote:
> Stefan Sperling on Wed, Aug 07 2024:
> > Thanks Sven. We are currently preparing a release to get the
> > current state of SHA2 support shipped. Once that is done I plan
> > get back to your patches, by end of next week at the latest.
> 
> Cool, thanks for the update! I've got some more ideas but this is as
> much as I've wanted to get out the door on my end to present a complete
> package.
> 
> -p
> 

Getting back this, upon more reflection I believe the best path forward
for Got would be to preserve author timestamps as you suggest, but avoid
displaying them.

Preserving the author timestamp is an important detail when people
use a mix of Got and Git tooling within the same project, allowing
Git users to always see the behaviour they would except from commits
created with Got.

However, showing the author timestamp in 'got log' does not seem like
a good idea to me.
Given the way we work in the Got project, and possibly in the OpenBSD
project at some time in the future, many, if not most, commits will be
rebased before being sent to the server. This means we'd end up showing
two timestamps not only in a few exceptional cases. They would always
be crowding the display too much for my taste.

Even Git doesn't seem to be displaying the author date by default.
In my testing I had to run git log --pretty=fuller to see them.

Earlier, you brought up the use case of continuous rebasing of a branch
with bad conflict resolution introducing problems, where the author
timestamp would ostensibly help to figure out why this happened.
This use case is valid, but I would argue that the backup states saved
by rebase and histedit already cover this use case well enough. See
rebase -l / histedit -l. These features were designed for this exact
use case, where revisiting older states of branches becomes necessary.

Now, changing your diff to avoid displaying the timestamp is trivial,
but the tests you wrote would need adjustment.
The 'got cat' command displays both timestamps, so it could be used
in regression tests instead of 'got log'. Or these tests could use
some suitable invocation of 'git log' to ensure that Got preserves
the timestamp as intended.

Would you be willing to work on those suggested changes yourself?
No problem if not. I can take your diff as it is and add tweaks on
top if you don't have time or energy to work through this.

Thanks,
Stefan