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

Re: [PATCH] builtin-commit: add --date option

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Dec 2, 2009, 21:07 UTC
Message-ID
<20091202210751.GC31763@genesis.frugalware.org>
In-Reply-To
<7vpr6xcgki.fsf@alter.siamese.dyndns.org>
On Wed, Dec 02, 2009 at 11:38:05AM -0800, Junio C Hamano <gitster@pobox.com> wrote:
>  - We should honor GIT_AUTHOR_DATE if --reset-author is given.
This is already a situation, as far as I see.
>  - I _think_ we should ignore GIT_AUTHOR_DATE if --reset-author is not
>    given, as --amend/-c/-C is stronger for being command line options than
>    an environment variable.

We already ignore GIT_AUTHOR_DATE if --reset-author is not given, also when I change it like this:

diff --git a/builtin-commit.c b/builtin-commit.c
index e93a647..7234c7d 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -397,7 +397,8 @@ static void determine_author_info(void)

                name = xstrndup(a + 8, lb - (a + 8));
                email = xstrndup(lb + 2, rb - (lb + 2));
-               date = xstrndup(rb + 2, eol - (rb + 2));
+               if (!date)
+                       date = xstrndup(rb + 2, eol - (rb + 2));
        }

        if (force_author) {

tests 27, 33, 38 and 39 fail in t7501-commit.sh.
Previous: Junio C HamanoNext: Miklos Vajna
Message 10 of 12 in “builtin-commit: add --date option”
  1. builtin-commit: add --date optionMiklos Vajna, Dec 1, 2009
  2. Miklos VajnaDec 2, 2009
  3. Junio C HamanoDec 2, 2009
  4. Junio C HamanoDec 2, 2009
  5. Miklos VajnaDec 2, 2009
  6. Jeff KingDec 2, 2009
  7. Miklos VajnaDec 2, 2009
  8. Jeff KingDec 2, 2009
  9. Junio C HamanoDec 2, 2009
  10. Miklos VajnaDec 2, 2009
  11. Miklos VajnaDec 2, 2009
  12. Jeff KingDec 2, 2009

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.