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

Re: [BUG] minor: wrong handling of GIT_AUTHOR_DATE

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 17, 2008, 03:50 UTC
Message-ID
<alpine.LFD.1.10.0808162040160.3324@nehalem.linux-foundation.org>
In-Reply-To
<7vr68obbpd.fsf@gitster.siamese.dyndns.org>
On Sat, 16 Aug 2008, Junio C Hamano wrote:
Show 6 quoted lines
> 
> People who followed that advice would have gotten used to this already, e.g.
> 
>    $ git reflog delete master@{07.04.2005.15:15:00.-0700}
> 
> should not be broken.

Hmm. Fair enough. In that case, just the "nodate()" approach is probably fine on its own. HOWEVER:

> I think your first hunk needs to distinguish between "very-long-precision
> posint" (in which case we ignore because it is likely to be nanoseconds
> fraction) and others.

Well, that ignores nanosecond resolution seconds, but not microseconds, for example. Now, microseconds normally don't matter (because they won't trigger the 'seconds-since-epoch' case), but they _can_ trigger some other cases.

For example, let's assume that we have microseconds in the date specifier. Then try this one:

	./test-date "12:12:12.000001"
Notice what happens? Oops.
With my patch, you get
	12:12:12.0000001 -> Sat Aug 16 12:12:12 2008
and with your, you get
	12:12:12.000001 -> Fri Aug  1 12:12:12 2008
and yeah, it's odd, but I can explain it.
But you are definitely right about the case of doing
	"15:15:00.-0700"
and yes, my patch was crap too. 
			Linus
Previous: Linus Torvalds
Message 10 of 10 in “[BUG] minor: wrong handling of GIT_AUTHOR_DATE”
  1. Hermann GaustererAug 16, 2008
  2. Linus TorvaldsAug 16, 2008
  3. Linus TorvaldsAug 16, 2008
  4. Junio C HamanoAug 17, 2008
  5. Junio C HamanoAug 17, 2008
  6. Linus TorvaldsAug 17, 2008
  7. Linus TorvaldsAug 17, 2008
  8. Junio C HamanoAug 17, 2008
  9. Linus TorvaldsAug 17, 2008
  10. Linus TorvaldsAug 17, 2008

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.