Thread (17 messages) flat view 17 messages, 9 authors, 2016-06-15

Re: Teach "approxidate" about weekday syntax

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:12

Possibly related (same subject, not in this thread)


On Fri, 18 Nov 2005, Martin Langhoff wrote:
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help