git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] Documentation: updated documentation for git commit --date

From
CGChinmoy via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 28, 2021, 12:54 UTC
Message-ID
<pull.918.v2.git.1616936099778.gitgitgadget@gmail.com>
In-Reply-To
<pull.918.git.1616926790227.gitgitgadget@gmail.com>
From: Chinmoy Chakraborty <chinmoy12c@gmail.com>

This commit lists the special strings used with `--date` in `git-commit.txt` and also a brief explanation about the strings in `date-formats.txt`.

Signed-off-by: Chinmoy Chakraborty <chinmoy12c@gmail.com>
---
    Documentation: updated documentation for git commit --date
    
    This commit lists the special strings used with --date in git-commit.txt
    and also a brief explanation about the strings in date-formats.txt.
    
    Signed-off-by: Chinmoy Chakraborty chinmoy12c@gmail.com
    
    
    Related Issue
    =============
    
    #302
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-918%2Fchinmoy12c%2Fissue_302-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-918/chinmoy12c/issue_302-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/918
Range-diff vs v1:
 1:  818ac39b5203 ! 1:  20da93dea971 Documentation: updated documentation for git commit --date
     @@ Commit message
      
       ## Documentation/date-formats.txt ##
      @@
     -+[[DATE FORMATS]]
     ++[[DATE-FORMATS]]
       DATE FORMATS
       ------------
       
     @@ Documentation/git-commit.txt: See linkgit:git-rebase[1] for details.
      +	Override the author date used in the commit. The value of <date>
      +	may be any one of the following special values - "yesterday",
      +	"noon", "midnight", "tea", "PM", "AM", "never", "now"
     -+	(see <<DATE FORMATS>>).
     ++	(see <<DATE-FORMATS>>).
       
       -m <msg>::
       --message=<msg>::
 Documentation/date-formats.txt | 32 ++++++++++++++++++++++++++++++++
 Documentation/git-commit.txt   |  5 ++++-
 2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/Documentation/date-formats.txt b/Documentation/date-formats.txt
index 99c455f51c04..83c423a3ec2e 100644
--- a/Documentation/date-formats.txt
+++ b/Documentation/date-formats.txt
@@ -1,6 +1,38 @@
+[[DATE-FORMATS]]
 DATE FORMATS
 ------------
 
+`yesterday`::
+	Change commit time to yesterday, that is, 24 hours ago.
+
+`noon`::
+	Change commit time to noon, that is 12:00. If current
+	time is less than 12:00, the time will be set to 12:00
+	on the previous day, else it will be set to 12:00 on
+	the same day.
+
+`midnight`::
+	Change commit time to midnight, that is, 00:00.
+
+`tea`::
+	Change commit time to 17:00(tea time). If the current
+	time is less than 17:00, the time will be set to 17:00
+	on the previous day, else it will be set to 17:00 on
+	the same day.
+
+`PM`::
+	Change commit time from AM to PM. If the current time
+	is already greater than 12:00, then the time remains
+	unaltered.
+
+`AM`::
+	Change commit time from PM to AM. If current time is
+	already less than 12:00, then the time remains
+	unaltered.
+
+`now`::
+	Change commit time to current time.
+
 The `GIT_AUTHOR_DATE` and `GIT_COMMITTER_DATE` environment variables
 support the following date formats:
 
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index 3c69f461c9af..1935fad33f35 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -176,7 +176,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. The value of <date>
+	may be any one of the following special values - "yesterday",
+	"noon", "midnight", "tea", "PM", "AM", "never", "now"
+	(see <<DATE-FORMATS>>).
 
 -m <msg>::
 --message=<msg>::

base-commit: 84d06cdc06389ae7c462434cb7b1db0980f63860
-- 
gitgitgadget
Previous: Chinmoy via GitGitGadgetNext: Bagas Sanjaya
Message 2 of 9 in “Documentation: updated documentation for git commit --date”
  1. Documentation: updated documentation for git commit --dateChinmoy via GitGitGadget, Mar 28, 2021
  2. Documentation: updated documentation for git commit --dateChinmoy via GitGitGadget, Mar 28, 2021
  3. Bagas SanjayaMar 29, 2021
  4. Chinmoy ChakrabortyMar 29, 2021
  5. Bagas SanjayaMar 29, 2021
  6. Chinmoy ChakrabortyMar 29, 2021
  7. Junio C HamanoMar 29, 2021
  8. Chinmoy ChakrabortyMar 30, 2021
  9. Junio C HamanoMar 30, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.