Subject: Re: [PATCH] rev-list: clarify git-log default date format

From: Junio C Hamano <[email-masked]>
Date: Wed, 01 Feb 2023 10:19:02 -0800

Rafael Dulfer <[email-masked]> writes:

> From: Rafael Dulfer <[email-masked]>
>
> Currently, the documentation is slightly incomplete, not explaining all the differences the default format has with rfc2822. Leading to confusion for people trying to parse the date format outputted by git log
>
> This patch adds 2 more exceptions when compared to rfc2822. Also adds an example of what the format looks like (I originally wanted to specify this in strftime notation, but because of the way day-of-month is formatted this is impossible)

Overly long lines.

>
> Signed-off-by: Rafael Dulfer <[email-masked]>
> ---
>  Documentation/rev-list-options.txt | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
> index ff68e48406..8bc8475f3e 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -1103,9 +1103,15 @@ format placeholders. When using `-local`, the correct syntax is
>  `--date=default` is the default format, and is similar to
>  `--date=rfc2822`, with a few exceptions:
>  --
> -	- there is no comma after the day-of-week
> +	- There is no comma after the day-of-week
>  
> -	- the time zone is omitted when the local time zone is used
> +	- The time zone is omitted when the local time zone is used
> +
> +	- Day-of-month and month are switched around
> +
> +	- Time-of-day and the year are switched around
> +
> +As a result, the format looks as follows: `Thu Jan 1 00:00:00 1970 +0000` with `+0000` being omitted when the local time zone is used.

All of the above may technically be correct, but I wonder if it
makes it easier to follow to simply stop saying "is similar to".
That is

    The default format `--date=default` shows a single line with
    three-letter day of the week, three-letter month, day-of-month,
    hour-minute-second in the "HH:MM:SS" format, followed by 4-digit
    year, plus timezone information unless the local time zone is
    used (e.g. "Thu Jan 1 00:00:00 1970 +0000").

or something like that.