Re: cgit, ages and chronological order

From: Marc Branchaud <marcnarc_at_gmail.com>
Date: Fri, 19 Nov 2021 14:37:57 UTC
On 2021-11-18 11:46, Warner Losh wrote:
> On Thu, Nov 18, 2021 at 9:29 AM Brooks Davis <brooks@freebsd.org> wrote:
> 
>> On Thu, Nov 18, 2021 at 12:46:49PM +0800, Philip Paeps wrote:
>>> On 2021-11-17 06:32:52 (+0800), Mark Millard via freebsd-git wrote:
>>>> information being based on local git commit timing (and clocks)
>>>> vs. when the commits are pushed to FreeBSD servers: The display
>>>> order is from the timing on the FreeBSD servers but the Age is
>>>> based on the original commit (before the push). The longer the
>>>> delay between commit and push, the more noticeable the
>>>> distinction is.
>>>
>>> Some projects require a "git rebase --ignore-date" (or "git rebase
>>> --reset-author-date", which I consider the more obvious spelling) before
>>> pushing.  A hook could potentially reject commits with timestamps that
>>> are too far off to the server's liking.
>>>
>>> I can't comment on whether we need or want either the policy or the hook
>>> or both.  I don't really have a problem with the default Git behaviour
>>> here.
>>
>> I always use --ignore-date when curating pre-commit.  I'd like to at
>> an absolute minimum enforce that CommitDate be newer than the previous
>> commit and older than the push time.  There is no good argument for
>> allowing non-linear CommitDates since the only requirement is that the
>> committer have their clock set more or less correctly.
>>
> 
> At the very least, we should document this suggestion.
> 
> I also like the idea of enforcing this as a pre-commit hook, but before that
> we should have it the docs... wouldn't hurt to have a section in the docs
> about each of the major points we enforce to tell people have to fix
> the issue should they encounter it.

A Git alias could be a useful recommendation here, eg. to create a "git 
rb" command that does a rebase with the desired option:

	git config --add alias.rb 'rebase --ignore-date'

(Add --local to make Git only configure the alias for your FreeBSD clone.)

I think maybe you can even create a "rebase" alias that overlays the 
real "rebase" Git command, but I'm not 100% sure of that (I don't like 
to mask the real Git commands with my aliases, so I've never tried).

		M.