git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Utku <ugultopu@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Utku Gultopu via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] doc: `--date` in `git-commit` accepts approxidates
Date: Tue, 23 Feb 2021 15:50:58 -0500	[thread overview]
Message-ID: <YDVqsnLOGUxX3v42@coredump.intra.peff.net> (raw)
In-Reply-To: <E2F9E8D8-0862-433D-BD20-BA3139BEC0C3@gmail.com>

On Tue, Feb 23, 2021 at 03:24:58PM -0500, Utku wrote:

> In this case, maybe Jeff can submit a patch, since I wouldn't be adding
> anything to what he suggested.

I'm happy to do that to move things along, though really 99% of the work
was in your initially identifying the problem. Here's what I would
suggest (I did steal your hunk to push all of the --date bits down into
that separate paragraph):

-- >8 --
Subject: [PATCH] doc: mention approxidates for git-commit --date

We describe the more strict date formats accepted by GIT_COMMITTER_DATE,
etc, but the --date option also allows the looser approxidate formats,
as well. Unfortunately we don't have a good or complete reference for
this format, but let's at least mention that it _is_ looser, and give a
few examples.

If we ever write separate, more complete date-format documentation, we
should refer to it from here.

Based-on-a-patch-by: Utku Gultopu <ugultopu@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/date-formats.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/date-formats.txt b/Documentation/date-formats.txt
index f1097fac69..99c455f51c 100644
--- a/Documentation/date-formats.txt
+++ b/Documentation/date-formats.txt
@@ -1,10 +1,7 @@
 DATE FORMATS
 ------------
 
-The `GIT_AUTHOR_DATE`, `GIT_COMMITTER_DATE` environment variables
-ifdef::git-commit[]
-and the `--date` option
-endif::git-commit[]
+The `GIT_AUTHOR_DATE` and `GIT_COMMITTER_DATE` environment variables
 support the following date formats:
 
 Git internal format::
@@ -26,3 +23,9 @@ ISO 8601::
 +
 NOTE: In addition, the date part is accepted in the following formats:
 `YYYY.MM.DD`, `MM/DD/YYYY` and `DD.MM.YYYY`.
+
+ifdef::git-commit[]
+In addition to recognizing all date formats above, the `--date` option
+will also try to make sense of other, more human-centric date formats,
+such as relative dates like "yesterday" or "last Friday at noon".
+endif::git-commit[]
-- 
2.30.1.1095.g03347429ea


      reply	other threads:[~2021-02-23 20:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 17:35 [PATCH] doc: `--date` in `git-commit` accepts approxidates Utku Gultopu via GitGitGadget
2021-02-23 18:11 ` Jeff King
2021-02-23 19:33   ` Junio C Hamano
2021-02-23 18:52 ` [PATCH v2] " Utku Gultopu via GitGitGadget
2021-02-23 19:06   ` Jeff King
     [not found]     ` <CAEeqB6kqZTft9NWtOvm3hk9bicBL7GU_WYuAGdMG1MHYMgNAxg@mail.gmail.com>
2021-02-23 19:16       ` Utku
2021-02-23 19:34     ` Junio C Hamano
2021-02-23 20:24       ` Utku
2021-02-23 20:50         ` Jeff King [this message]

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=YDVqsnLOGUxX3v42@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=ugultopu@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.
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).