public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: "Md Ferdous Alam via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Md Ferdous Alam <mdferdousalam1989@yahoo.com>,
	mdferdousalam <mdferdousalam1989@yahoo.com>
Subject: [PATCH] doc: commit: document special date keywords for --date
Date: Mon, 23 Feb 2026 08:45:03 +0000	[thread overview]
Message-ID: <pull.2051.git.1771836303147.gitgitgadget@gmail.com> (raw)

From: mdferdousalam <mdferdousalam1989@yahoo.com>

The --date option in git-commit accepts human-readable keywords
like "now", "yesterday", "noon", "midnight", "tea", and "never",
but these were not documented. Add them to the "DATE FORMATS"
section of git-commit(1), and expand the --date option description
to point readers there.

Signed-off-by: mdferdousalam <mdferdousalam1989@yahoo.com>
---
    doc: commit: document special date keywords for --date
    
    The --date option in git-commit accepts human-readable keywords like
    "now", "yesterday", "noon", "midnight", "tea", and "never", but these
    were not documented. Add them to the "DATE FORMATS" section of
    git-commit(1), and expand the --date option description to point readers
    there.
    
    This addresses https://github.com/gitgitgadget/git/issues/302
    
    Signed-off-by: mdferdousalam mdferdousalam1989@yahoo.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2051%2Fmdferdousalam%2Fdoc-commit-date-special-strings-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2051/mdferdousalam/doc-commit-date-special-strings-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2051

 Documentation/date-formats.adoc | 12 ++++++++++++
 Documentation/git-commit.adoc   |  5 ++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Documentation/date-formats.adoc b/Documentation/date-formats.adoc
index e24517c496..cbf651a8be 100644
--- a/Documentation/date-formats.adoc
+++ b/Documentation/date-formats.adoc
@@ -28,4 +28,16 @@ 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".
++
+The following special keywords are also recognized:
++
+`now`;; the current date and time.
+`yesterday`;; yesterday's date at the current time.
+`noon`;; today (or the given date) at 12:00.
+`midnight`;; today (or the given date) at 00:00.
+`tea`;; today (or the given date) at 17:00.
+`never`;; a zero timestamp (used e.g. by linkgit:git-reflog[1]).
++
+These keywords can be combined with other date constructs, for
+example `yesterday noon` or `3.days.ago`.
 endif::git-commit[]
diff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc
index 8329c1034b..840bc52096 100644
--- a/Documentation/git-commit.adoc
+++ b/Documentation/git-commit.adoc
@@ -181,7 +181,10 @@ See linkgit:git-rebase[1] for details.
 	the commit author is then copied from the first such commit found.
 
 `--date=<date>`::
-	Override the author date used in the commit.
+	Override the author date used in the commit.  See the
+	"DATE FORMATS" section below for accepted formats,
+	including human-readable strings like `now`, `yesterday`,
+	and `noon`.
 
 `-m <msg>`::
 `--message=<msg>`::

base-commit: 7c02d39fc2ed2702223c7674f73150d9a7e61ba4
-- 
gitgitgadget

             reply	other threads:[~2026-02-23  8:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23  8:45 Md Ferdous Alam via GitGitGadget [this message]
2026-02-23 17:10 ` [PATCH] doc: commit: document special date keywords for --date Junio C Hamano
2026-02-23 18:56   ` Engr Md Ferdous Alam

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=pull.2051.git.1771836303147.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mdferdousalam1989@yahoo.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