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

Re: Teach "approxidate" about weekday syntax

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 18, 2005, 02:38 UTC
Message-ID
<Pine.LNX.4.64.0511171828380.13959@g5.osdl.org>
In-Reply-To
<46a038f90511171740x756b0336ib8b8937ee3a2af03@mail.gmail.com>
On Fri, 18 Nov 2005, Martin Langhoff wrote:
Show 5 quoted lines
> 
> That'd be even harder to define -- I'd rather have it spit out what it
> interpreted so that porcelains can display it to the user. The user
> can tell at a glance if the parser is off -- for it will be off by a
> mile.
Well, quite frankly, almost always it's pretty damn obvious.

We could make it less so: the most common mistake when it doesn't parse sanely is that it doesn't parse anything at all, but it saw a number somewhere, and thought it was a day of the month.

For example, "last janurary" will silently parse to just "1" (miss-spelled "january"), which will be interpreted as the "first of this month".

And we could make _that_ be an error. If you want the first of this month, you'd have to spell out the month, ie write "Nov 1" instead of just "1".

Apart from that parsign error, pretty much everything else will tend to parse correctly or just give "now" (which is pretty obvious when you ask for a log "since now", and get an empty answer back).

But quite frankly, I don't think the approximate date-parsing is serious enough to even worry about these kinds of things. I actually use it, but I don't think anybody _depends_ on it. It's useful to do

	gitk --since=last.week

just as a way to speed up the startup (if you're just interested in the top of the tree, the kernel history is so big that it's just pointless to do a full gitk, and doing the "since last week" is a quick way to just limit the history enough that it makes the graph cleaner).

And if you get that wrong, who cares? It's not a big deal. The approxidate parsing is one of those "hey, that's nice" features, but it's definitely not important.

		Linus
Previous: Martin LanghoffNext: Johannes Schindelin
Message 23 of 26 in “Teach "approxidate" about weekday syntax”
  1. Linus TorvaldsNov 17, 2005
  2. Nicolas PitreNov 17, 2005
  3. Johannes SchindelinNov 17, 2005
  4. Junio C HamanoNov 17, 2005
  5. Linus TorvaldsNov 17, 2005
  6. Linus TorvaldsNov 17, 2005
  7. David RoundyNov 18, 2005
  8. Johannes SchindelinNov 18, 2005
  9. Randy.DunlapNov 18, 2005
  10. Linus TorvaldsNov 18, 2005
  11. Junio C HamanoNov 19, 2005
  12. Andreas EricssonNov 19, 2005
  13. Randal L. SchwartzNov 19, 2005
  14. Linus TorvaldsNov 19, 2005
  15. Matthias UrlichsNov 18, 2005
  16. Johannes SchindelinNov 20, 2005
  17. H. Peter AnvinNov 18, 2005
  18. Linus TorvaldsNov 18, 2005
  19. Andreas EricssonNov 18, 2005
  20. Linus TorvaldsNov 18, 2005
  21. Johannes SchindelinNov 17, 2005
  22. Martin LanghoffNov 18, 2005
  23. Linus TorvaldsNov 18, 2005
  24. Johannes SchindelinNov 18, 2005
  25. H. Peter AnvinNov 17, 2005
  26. Linus TorvaldsNov 17, 2005

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.