<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/date.c, branch v1.6.5.4</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.5.4</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.5.4'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2009-10-03T10:04:38Z</updated>
<entry>
<title>Fix '--relative-date'</title>
<updated>2009-10-03T10:04:38Z</updated>
<author>
<name>Johan Sageryd</name>
<email>j416@1616.se</email>
</author>
<published>2009-10-03T04:20:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=dbc1b1f71052c084a84b5c395e1cb4b5ae526fcb'/>
<id>urn:sha1:dbc1b1f71052c084a84b5c395e1cb4b5ae526fcb</id>
<content type='text'>
This fixes '--relative-date' so that it does not give '0
year, 12 months', for the interval 360 &lt;= diff &lt; 365.

Signed-off-by: Johan Sageryd &lt;j416@1616.se&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>fix approxidate parsing of relative months and years</title>
<updated>2009-08-31T05:04:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2009-08-31T02:31:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=931e8e27d94dbc24abc9c969ae0b414e0361abff'/>
<id>urn:sha1:931e8e27d94dbc24abc9c969ae0b414e0361abff</id>
<content type='text'>
These were broken by b5373e9. The problem is that the code
marks the month and year with "-1" for "we don't know it
yet", but the month and year code paths were not adjusted to
fill in the current time before doing their calculations
(whereas other units follow a different code path and are
fine).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add date formatting and parsing functions relative to a given time</title>
<updated>2009-08-31T02:59:11Z</updated>
<author>
<name>Alex Riesen</name>
<email>raa.lkml@gmail.com</email>
</author>
<published>2009-08-31T02:26:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=33012fc429af24fee64f39406d401662feb947a8'/>
<id>urn:sha1:33012fc429af24fee64f39406d401662feb947a8</id>
<content type='text'>
The main purpose is to allow predictable testing of the code.

Signed-off-by: Alex Riesen &lt;raa.lkml@gmail.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Further 'approxidate' improvements</title>
<updated>2009-08-23T01:51:06Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-08-23T01:11:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=36e4986f26d18defa51fd7af60ec7e7a98337902'/>
<id>urn:sha1:36e4986f26d18defa51fd7af60ec7e7a98337902</id>
<content type='text'>
The previous patch to improve approxidate got us to the point that a lot
of the remaining annoyances were due to the 'strict' date handling running
first, and deciding that it got a good enough date that the approximate
date routines were never even invoked.

For example, using a date string like

	6AM, June 7, 2009

the strict date logic would be perfectly happy with the "June 7, 2009"
part, and ignore the 6AM part that it didn't understand - resulting in the
information getting dropped on the floor:

	6AM, June 7, 2009 -&gt; Sat Jun 6 00:00:00 2009

and the date being calculated as if it was midnight, and the '6AM' having
confused the date routines into thinking about '6 June' rather than 'June
7' at 6AM (ie notice how the _day_ was wrong due to this, not just the
time).

So this makes the strict date routines a bit stricter, and requires that
not just the date, but also the time, has actually been parsed. With that
fix, and trivial extension of the approxidate routines, git now properly
parses the date as

	6AM, June 7, 2009 -&gt; Sun Jun  7 06:00:00 2009

without dropping the fuzzy time ("6AM" or "noon" or any of the other
non-strict time formats) on the floor.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Improve on 'approxidate'</title>
<updated>2009-08-23T01:51:05Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-08-22T22:10:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=9029055207443c28ca65a705d1a1b96cce3995fd'/>
<id>urn:sha1:9029055207443c28ca65a705d1a1b96cce3995fd</id>
<content type='text'>
This is not a new failure mode - approxidate has always been kind of
random in the input it accepts, but some of the randomness is more
irritating than others.

For example:

	Jun 6, 5AM -&gt; Mon Jun 22 05:00:00 2009
	5AM Jun 6 -&gt; Sat Jun  6 05:00:00 2009

Whaa? The reason for the above is that approxidate squirrells away the '6'
from "Jun 6" to see if it's going to be a relative number, and then
forgets about it when it sees a new number (the '5' in '5AM'). So the odd
"June 22" date is because today is July 22nd, and if it doesn't have
another day of the month, it will just pick todays mday - having ignored
the '6' entirely due to getting all excited about seeing a new number (5).

There are other oddnesses. This does not fix them all, but I think it
makes for fewer _really_ perplexing cases. At least now we have

	Jun 6, 5AM -&gt; Sat Jun  6 05:00:00 2009
	5AM, Jun 6 -&gt; Sat Jun  6 05:00:00 2009

which makes me happier. I can still point to cases that don't work as
well, but those are separate issues.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Work around BSD whose typeof(tv.tv_sec) != time_t</title>
<updated>2009-05-06T05:19:14Z</updated>
<author>
<name>Bernd Ahlers</name>
<email>bernd@ba-net.org</email>
</author>
<published>2009-04-06T17:26:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f697b33b015fcb0c90210840eb4ef8e6a18d4bdf'/>
<id>urn:sha1:f697b33b015fcb0c90210840eb4ef8e6a18d4bdf</id>
<content type='text'>
According to POSIX, tv_sec is supposed to be a time_t, but OpenBSD
(and FreeBSD, too) defines it to be a long, which triggers a type
mismatch when a pointer to it is given to localtime_r().

Acked-by: Jeff King &lt;peff@peff.net&gt;

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>never fallback relative times to absolute</title>
<updated>2009-02-25T08:44:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2009-02-24T05:42:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=10edf37796badc58239eb3e5d1e8e608f6e1473c'/>
<id>urn:sha1:10edf37796badc58239eb3e5d1e8e608f6e1473c</id>
<content type='text'>
Previously, for dates older than 12 months we fell back to just giving the
absolute time.  This can be a bit jarring when reading a list of times.

Instead, let's switch to "Y years, M months" for five years, and then just
"Y years" after that.

No particular reason on the 5 year cutoff except that it seemed reasonable
to me.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Support 'raw' date format</title>
<updated>2009-02-21T05:45:42Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-02-20T22:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7dff9b30ea0603fe265f9f7da055fc34f5d57d2f'/>
<id>urn:sha1:7dff9b30ea0603fe265f9f7da055fc34f5d57d2f</id>
<content type='text'>
Talking about --date, one thing I wanted for the 1234567890 date was to
get things in the raw format. Sure, you get them with --pretty=raw, but it
felt a bit sad that you couldn't just ask for the date in raw format.

So here's a throw-away patch (meaning: I won't be re-sending it, because I
really don't think it's a big deal) to add "--date=raw". It just prints
out the internal raw git format - seconds since epoch plus timezone (put
another way: 'date +"%s %z"' format)

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>date/time: do not get confused by fractional seconds</title>
<updated>2008-08-18T00:41:53Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2008-08-17T04:25:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=9f2b6d2936a7c4bb3155de8efec7b10869ca935e'/>
<id>urn:sha1:9f2b6d2936a7c4bb3155de8efec7b10869ca935e</id>
<content type='text'>
The date/time parsing code was confused if the input time HH:MM:SS is
followed by fractional seconds.  Since we do not record anything finer
grained than seconds, we could just drop fractional part, but there is a
twist.

We have taught people that not just spaces but dot can be used as word
separators when spelling things like:

    $ git log --since 2.days
    $ git show @{12:34:56.7.days.ago}

and we shouldn't mistake "7" in the latter example as a fraction and
discard it.

The rules are:

 - valid days of month/mday are always single or double digits.

 - valid years are either two or four digits

   No, we don't support the year 600 _anyway_, since our encoding is based
   on the UNIX epoch, and the day we worry about the year 10,000 is far
   away and we can raise the limit to five digits when we get closer.

 - Other numbers (eg "600 days ago") can have any number of digits, but
   they cannot start with a zero. Again, the only exception is for
   two-digit numbers, since that is fairly common for dates ("Dec 01" is
   not unheard of)

So that means that any milli- or micro-second would be thrown out just
because the number of digits shows that it cannot be an interesting date.

A milli- or micro-second can obviously be a perfectly fine number
according to the rules above, as long as it doesn't start with a '0'. So
if we have

	12:34:56.123

then that '123' gets parsed as a number, and we remember it. But because
it's bigger than 31, we'll never use it as such _unless_ there is
something after it to trigger that use.

So you can say "12:34:56.123.days.ago", and because of the "days", that
123 will actually be meaninful now.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Make my_mktime() public and rename it to tm_to_time_t()</title>
<updated>2008-06-23T11:40:29Z</updated>
<author>
<name>Johannes Sixt</name>
<email>johannes.sixt@telecom.at</email>
</author>
<published>2008-06-23T06:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=bb5799d6ef3ad7ee70a138b82e67b93e3aaa8017'/>
<id>urn:sha1:bb5799d6ef3ad7ee70a138b82e67b93e3aaa8017</id>
<content type='text'>
We will use it from the MinGW port's gettimeofday() substitution.

Signed-off-by: Johannes Sixt &lt;johannes.sixt@telecom.at&gt;
</content>
</entry>
</feed>
