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

Re: [RFD] use approxidate for "git commit --date=xyz"?

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2014, 21:34 UTC
Message-ID
<xmqq1tweec1o.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CA+55aFx=LizEyS6hq=av_qwRZuu_q3xPSXO-Jr4CAfXqaAuUtA@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 7 quoted lines
> I just got a comment saying that
>
>     git commit --amend --date=now
>
> doesn't work. I replied that you can use
>
>    --date="$(date)"

Offhand without double-checking the actual codepath I do not have objection against approxidate-careful.

But why does the workflow need --date=now in the first place? Wouldn't --reset-author do what you want better? What is the situation where you want to say that this patch has been changed significantly enough from the original to label it with the current timestamp without taking the authorship?

Show 8 quoted lines
> but I do wonder if we should accept the approxidate format - we do in
> other equivalent places. Hmm?
>
> The code uses fmt_ident(), which uses parse_date(), which in turn uses
> parse_date_basic(). Maybe parse_date() could use
> "approxidate_careful()" instead of "parse_date_basic()"?
>
>             Linus
Previous: Linus TorvaldsNext: Jeff King
Message 2 of 9 in “[RFD] use approxidate for "git commit --date=xyz"?”
  1. Linus TorvaldsApr 30, 2014
  2. Junio C HamanoApr 30, 2014
  3. Jeff KingMay 1, 2014
  4. 0/4 approxidate for "git commit --date=foo"Jeff King, May 2, 2014
  5. 1/4 commit: use split_ident_line to compare author/committerJeff King, May 2, 2014
  6. 2/4 pretty: make show_ident_date publicJeff King, May 2, 2014
  7. 3/4 commit: print "Date" line when the user has set dateJeff King, May 2, 2014
  8. 4/4 commit: accept more date formats for "--date"Jeff King, May 2, 2014
  9. Peter KreftingMay 7, 2014

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.