{"thread":{"id":"66918","subject":"[PATCH] git-commit: document --date=now for amended commits","startedAt":"2026-11-23T09:34:57Z","lastAt":"2026-11-23T19:24:03Z","messageCount":2,"participants":["Gontu Sujith Reddy via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"559134","messageId":"pull.2502.git.git.1795426497536.gitgitgadget@gmail.com","threadId":"66918","inReplyTo":null,"subject":"[PATCH] git-commit: document --date=now for amended commits","fromName":"Gontu Sujith Reddy via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-11-23T09:34:57Z","receivedAt":"2026-11-23T09:34:57Z","isPatch":true,"sender":{"key":"name:Gontu Sujith Reddy","avatar":null},"body":"From: GontuSujithReddy <gontusujith2009@gmail.com>\n\nAmending a commit normally preserves its original author date. Mention\nthat --date=now sets the author date to the current time when amending.\n\nSigned-off-by: GontuSujithReddy <gontusujith2009@gmail.com>\n---\n    git-commit: document --date=now for amended commits\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2502%2FGontuSujithReddy%2Fdoc-commit-date-now-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2502/GontuSujithReddy/doc-commit-date-now-v1\nPull-Request: https://github.com/git/git/pull/2502\n\n Documentation/git-commit.adoc | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc\nindex 8329c1034b..ba0d5aeb8f 100644\n--- a/Documentation/git-commit.adoc\n+++ b/Documentation/git-commit.adoc\n@@ -182,6 +182,8 @@ See linkgit:git-rebase[1] for details.\n \n `--date=<date>`::\n \tOverride the author date used in the commit.\n+\tWhen amending a commit, use `--date=now` to set the author date\n+\tto the current time.\n \n `-m <msg>`::\n `--message=<msg>`::\n\nbase-commit: f7de81456940dd6f3274e461149bba12965de609\n-- \ngitgitgadget\n\n"},{"id":"559178","messageId":"xmqqik1n5p2k.fsf@gitster.g","threadId":"66918","inReplyTo":"pull.2502.git.git.1795426497536.gitgitgadget@gmail.com","subject":"Re: [PATCH] git-commit: document --date=now for amended commits","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-11-23T19:24:03Z","receivedAt":"2026-11-23T19:24:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Gontu Sujith Reddy via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: GontuSujithReddy <gontusujith2009@gmail.com>\n>\n> Amending a commit normally preserves its original author date. Mention\n> that --date=now sets the author date to the current time when amending.\n>\n> Signed-off-by: GontuSujithReddy <gontusujith2009@gmail.com>\n> ---\n\nYour message identifies you as \"Gontu Sujith Reddy\" (before the \"via\nGitGitGadget\" comment) on the mail envelope Sender: header, and if that\nis how your name is usually spelled, we would prefer to have the name\nwith the same spelling on the in-body \"From:\" line and also on your\nsign-off, not squashed into a single long word.\n\n>     git-commit: document --date=now for amended commits\n\nYou do not have to write what you wrote elsewhere here.  The space under\nthe three dashes is to communicate what should not be recorded in the\ncommit log message for \"git log\" readers in the longer term but is\nrelevant and helpful for reviewers to know while reviewing the patch.\n\nI am mildly against this update.\n\nWhether you are creating a new commit or amending an existing commit,\nthe option overrides the author date.  Singling out \"When amending a\ncommit\" in the description of the --date option gives an impression\nthat it is the primary purpose of the option, which is not the case.\n\nPreserving the author date is what the description of --amend should\nmention, and if it does not already, there is a patch opportunity for\nyou to improve the documentation ;-).  And in the context of that\ndescription, it may be a good idea to mention that the user could\noverride it with --date when they have a good reason to do so.\n\nBut the author date is not the only thing that \"git commit --amend\"\npreserves (the author identity is also preserved when you are amending\nsomebody else's commit).  For that reason, it would be a good idea to\nmention the --reset-author option as well when you bring up the --date\noption there.\n\n\n\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2502%2FGontuSujithReddy%2Fdoc-commit-date-now-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2502/GontuSujithReddy/doc-commit-date-now-v1\n> Pull-Request: https://github.com/git/git/pull/2502\n>\n>  Documentation/git-commit.adoc | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/Documentation/git-commit.adoc b/Documentation/git-commit.adoc\n> index 8329c1034b..ba0d5aeb8f 100644\n> --- a/Documentation/git-commit.adoc\n> +++ b/Documentation/git-commit.adoc\n> @@ -182,6 +182,8 @@ See linkgit:git-rebase[1] for details.\n>  \n>  `--date=<date>`::\n>  \tOverride the author date used in the commit.\n> +\tWhen amending a commit, use `--date=now` to set the author date\n> +\tto the current time.\n>  \n>  `-m <msg>`::\n>  `--message=<msg>`::\n>\n> base-commit: f7de81456940dd6f3274e461149bba12965de609\n\n"}]}