{"thread":{"id":"65047","subject":"[PATCH] doc: commit: document special date keywords for --date","startedAt":"2026-02-23T08:45:05Z","lastAt":"2026-02-23T19:16:50Z","messageCount":3,"participants":["Md Ferdous Alam via GitGitGadget","Junio C Hamano","Engr Md Ferdous Alam"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"536711","messageId":"pull.2051.git.1771836303147.gitgitgadget@gmail.com","threadId":"65047","inReplyTo":null,"subject":"[PATCH] doc: commit: document special date keywords for --date","fromName":"Md Ferdous Alam via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-02-23T08:45:03Z","receivedAt":"2026-02-23T08:45:05Z","isPatch":true,"sender":{"key":"name:Md Ferdous Alam","avatar":null},"body":"From: mdferdousalam <mdferdousalam1989@yahoo.com>\n\nThe --date option in git-commit accepts human-readable keywords\nlike \"now\", \"yesterday\", \"noon\", \"midnight\", \"tea\", and \"never\",\nbut these were not documented. Add them to the \"DATE FORMATS\"\nsection of git-commit(1), and expand the --date option description\nto point readers there.\n\nSigned-off-by: mdferdousalam <mdferdousalam1989@yahoo.com>\n---\n    doc: commit: document special date keywords for --date\n    \n    The --date option in git-commit accepts human-readable keywords like\n    \"now\", \"yesterday\", \"noon\", \"midnight\", \"tea\", and \"never\", but these\n    were not documented. Add them to the \"DATE FORMATS\" section of\n    git-commit(1), and expand the --date option description to point readers\n    there.\n    \n    This addresses https://github.com/gitgitgadget/git/issues/302\n    \n    Signed-off-by: mdferdousalam mdferdousalam1989@yahoo.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2051%2Fmdferdousalam%2Fdoc-commit-date-special-strings-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2051/mdferdousalam/doc-commit-date-special-strings-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2051\n\n Documentation/date-formats.adoc | 12 ++++++++++++\n Documentation/git-commit.adoc   |  5 ++++-\n 2 files changed, 16 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/date-formats.adoc b/Documentation/date-formats.adoc\nindex e24517c496..cbf651a8be 100644\n--- a/Documentation/date-formats.adoc\n+++ b/Documentation/date-formats.adoc\n@@ -28,4 +28,16 @@ ifdef::git-commit[]\n In addition to recognizing all date formats above, the `--date` option\n will also try to make sense of other, more human-centric date formats,\n such as relative dates like \"yesterday\" or \"last Friday at noon\".\n++\n+The following special keywords are also recognized:\n++\n+`now`;; the current date and time.\n+`yesterday`;; yesterday's date at the current time.\n+`noon`;; today (or the given date) at 12:00.\n+`midnight`;; today (or the given date) at 00:00.\n+`tea`;; today (or the given date) at 17:00.\n+`never`;; a zero timestamp (used e.g. by linkgit:git-reflog[1]).\n++\n+These keywords can be combined with other date constructs, for\n+example `yesterday noon` or `3.days.ago`.\n endif::git-commit[]\ndiff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc\nindex 8329c1034b..840bc52096 100644\n--- a/Documentation/git-commit.adoc\n+++ b/Documentation/git-commit.adoc\n@@ -181,7 +181,10 @@ See linkgit:git-rebase[1] for details.\n \tthe commit author is then copied from the first such commit found.\n \n `--date=<date>`::\n-\tOverride the author date used in the commit.\n+\tOverride the author date used in the commit.  See the\n+\t\"DATE FORMATS\" section below for accepted formats,\n+\tincluding human-readable strings like `now`, `yesterday`,\n+\tand `noon`.\n \n `-m <msg>`::\n `--message=<msg>`::\n\nbase-commit: 7c02d39fc2ed2702223c7674f73150d9a7e61ba4\n-- \ngitgitgadget\n"},{"id":"536854","messageId":"xmqqa4wzo077.fsf@gitster.g","threadId":"65047","inReplyTo":"pull.2051.git.1771836303147.gitgitgadget@gmail.com","subject":"Re: [PATCH] doc: commit: document special date keywords for --date","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-23T17:10:20Z","receivedAt":"2026-02-23T17:10:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Md Ferdous Alam via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: mdferdousalam <mdferdousalam1989@yahoo.com>\n>\n> The --date option in git-commit accepts human-readable keywords\n> like \"now\", \"yesterday\", \"noon\", \"midnight\", \"tea\", and \"never\",\n> but these were not documented.\n\nI've always thought that these are easter eggs to be discovered,\ndeliberately left out of documentation, as they mostly exist to be\namusing.  For those who want to be precise, the date formats section\ngives sufficient information.\n\nOther than perhaps \"now\", which may be handy but not so useful in\nthe context of \"git commit --date=now\".\n\nMoreover, 7.days.ago and 1.week.ago are also in the same category as\nwhat you called \"keywords\" here, but we do not try to make an\nexhausitive list.\n\nSo, I dunno.\n"},{"id":"536869","messageId":"1858262678.1052976.1771872991160@mail.yahoo.com","threadId":"65047","inReplyTo":"xmqqa4wzo077.fsf@gitster.g","subject":"Re: [PATCH] doc: commit: document special date keywords for --date","fromName":"Engr Md Ferdous Alam","fromEmail":"mdferdousalam1989@yahoo.com","sentAt":"2026-02-23T18:56:31Z","receivedAt":"2026-02-23T19:16:50Z","isPatch":true,"sender":{"key":"mdferdousalam1989@yahoo.com","avatar":null},"body":"\nJunio C Hamano <gitster@pobox.com> writes:\n\n\n> I've always thought that these are easter eggs to be discovered,\n> deliberately left out of documentation, as they mostly exist to be\n> amusing.  For those who want to be precise, the date formats section\n> gives sufficient information.\n>\n> Moreover, 7.days.ago and 1.week.ago are also in the same category as\n> what you called \"keywords\" here, but we do not try to make an\n> exhausitive list.\n>\n> So, I dunno.\n\n\nThat makes sense.  I had not considered that these were intentionally\nleft undocumented as easter eggs.  And you are right that trying to\nlist some without listing all (like 7.days.ago) would be incomplete\nand misleading.\n\n\nI will withdraw this patch.  Thank you for the explanation.\n\n\nMd Ferdous Alam\n\n\n\n  \n\n\n\n\n\n\n\nOn Monday, February 23, 2026 at 11:10:23 PM GMT+6, Junio C Hamano <gitster@pobox.com> wrote: \n\n\n\n\n\n\"Md Ferdous Alam via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n\n> From: mdferdousalam <mdferdousalam1989@yahoo.com>\n>\n> The --date option in git-commit accepts human-readable keywords\n> like \"now\", \"yesterday\", \"noon\", \"midnight\", \"tea\", and \"never\",\n> but these were not documented.\n\n\nI've always thought that these are easter eggs to be discovered,\ndeliberately left out of documentation, as they mostly exist to be\namusing.  For those who want to be precise, the date formats section\ngives sufficient information.\n\nOther than perhaps \"now\", which may be handy but not so useful in\nthe context of \"git commit --date=now\".\n\nMoreover, 7.days.ago and 1.week.ago are also in the same category as\nwhat you called \"keywords\" here, but we do not try to make an\nexhausitive list.\n\nSo, I dunno.\n\n"}]}