From: Rafael Dulfer <rafael@dulfer.be>
To: git@vger.kernel.org
Subject: Inconsistency between git-log documentation and behavior regarding default date format.
Date: Tue, 24 Jan 2023 16:09:00 +0100 [thread overview]
Message-ID: <9c3428f6-a254-13b4-046d-6e20ef602aef@dulfer.be> (raw)
In-Reply-To: <793c8116-f7ea-eef2-6979-231c3e94639a@dulfer.be>
The Git documentation
<https://www.git-scm.com/docs/git-log#Documentation/git-log.txt---dateltformatgt> states
that if no date format is given (or --date=default is given), the date
format is similar to rfc2822 except of a few exceptions, of which those
listed are:
* There is no comma after the day-of-week
* The time zone is omitted when the local time zone is used
However, if we were to compare the two date formats, you can see another
difference:
git log --default -> Tue Jan 24 11:03:47 2023 +0100
git log --rfc -> Tue, 24 Jan 2023 11:03:47 +0100
With the default, the month and day-of-month are switched around. From
my own quick investigation, this behavior occurs because of the
statement found at date.c#L266
<https://github.com/git/git/blob/56c8fb1e95377900ec9d53c07886022af0a5d3c2/date.c#L266>
wherein the month is inserted before the day-of-month. I am unsure which
behavior is exactly intended and whether this discrepancy was known, but
it would probably be a good idea to have a note of it in the documentation.
next parent reply other threads:[~2023-01-24 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <793c8116-f7ea-eef2-6979-231c3e94639a@dulfer.be>
2023-01-24 15:09 ` Rafael Dulfer [this message]
2023-02-01 1:33 ` Inconsistency between git-log documentation and behavior regarding default date format Andrei Rybak
2023-02-01 11:51 ` Jeff King
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9c3428f6-a254-13b4-046d-6e20ef602aef@dulfer.be \
--to=rafael@dulfer.be \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).