Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Rafael Dulfer <rafael@dulfer.be>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>, Andrei Rybak <rybak.a.v@gmail.com>,
	Rafael Dulfer <rafael.dulfer@gmail.com>
Subject: [PATCH] rev-list: clarify git-log default date format
Date: Wed,  1 Feb 2023 16:57:12 +0100	[thread overview]
Message-ID: <20230201155712.86577-1-rafael@dulfer.be> (raw)

From: Rafael Dulfer <rafael.dulfer@gmail.com>

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)

Signed-off-by: Rafael Dulfer <rafael.dulfer@gmail.com>
---
 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.
 
 ifdef::git-rev-list[]
 --header::
-- 
2.39.1


             reply	other threads:[~2023-02-01 15:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 15:57 Rafael Dulfer [this message]
2023-02-01 18:19 ` [PATCH] rev-list: clarify git-log default date format Junio C Hamano
2023-02-01 22:28   ` Ævar Arnfjörð Bjarmason
2023-02-01 22:58     ` Junio C Hamano
2023-02-02 11:37       ` Rafael Dulfer
2023-02-02 16:17         ` Junio C Hamano
2023-02-02 16:53           ` Junio C Hamano
2023-02-16  0:42             ` [PATCH v2] " Junio C Hamano
2023-02-16  2:15               ` Jeff King
2023-02-16  2:58                 ` Junio C Hamano
2023-02-16 16:29               ` [PATCH v3] " Junio C Hamano
2023-02-16 17:24                 ` Jeff King
2023-02-01 22:47   ` [PATCH] " 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

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

  git send-email \
    --in-reply-to=20230201155712.86577-1-rafael@dulfer.be \
    --to=rafael@dulfer.be \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=rafael.dulfer@gmail.com \
    --cc=rybak.a.v@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).