<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/date.c, branch v2.34.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.34.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.34.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-06-16T02:25:11Z</updated>
<entry>
<title>comments: avoid using the gender of our users</title>
<updated>2021-06-16T02:25:11Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-06-15T14:11:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0e20b229eea63716cdd1bea916b7e416f450278a'/>
<id>urn:sha1:0e20b229eea63716cdd1bea916b7e416f450278a</id>
<content type='text'>
We generally avoid specifying the gender of our users in order to be
more inclusive, but sometimes a few slip by due to habit.

Since by doing a little bit of rewording we can avoid this irrelevant
detail, let's do so.

Inspired-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Helped-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>date.c: allow compact version of ISO-8601 datetime</title>
<updated>2020-04-24T21:06:09Z</updated>
<author>
<name>Đoàn Trần Công Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2020-04-24T15:07:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=544ed961a50c3442a3ec5643f2c443cd3e17311a'/>
<id>urn:sha1:544ed961a50c3442a3ec5643f2c443cd3e17311a</id>
<content type='text'>
Signed-off-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>date.c: skip fractional second part of ISO-8601</title>
<updated>2020-04-24T21:06:09Z</updated>
<author>
<name>Đoàn Trần Công Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2020-04-24T15:07:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b784840ca84c708708d1ab0b872eb3a6fb3200b5'/>
<id>urn:sha1:b784840ca84c708708d1ab0b872eb3a6fb3200b5</id>
<content type='text'>
git-commit(1) says ISO-8601 is one of our supported date format.

ISO-8601 allows timestamps to have a fractional number of seconds.
We represent time only in terms of whole seconds, so we never bothered
parsing fractional seconds. However, it's better for us to parse and
throw away the fractional part than to refuse to parse the timestamp
at all.

And refusing parsing fractional second part may confuse the parse to
think fractional and timezone as day and month in this example:

	2008-02-14 20:30:45.019-04:00

While doing this, make sure that we only interpret the number after the
second and the dot as fractional when and only when the date is known,
since only ISO-8601 allows the fractional part, and we've taught our
users to interpret "12:34:56.7.days.ago" as a way to specify a time
relative to current time.

Reported-by: Brian M. Carlson &lt;sandals@crustytoothpaste.net&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>date.c: validate and set time in a helper function</title>
<updated>2020-04-24T21:06:09Z</updated>
<author>
<name>Đoàn Trần Công Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2020-04-24T15:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4f89f4fc9ac494fde3f3bede19a7599f77afe8dc'/>
<id>urn:sha1:4f89f4fc9ac494fde3f3bede19a7599f77afe8dc</id>
<content type='text'>
In a later patch, we will reuse this logic, move it to a helper, now.

While we're at it, explicit states that we intentionally ignore
old-and-defective 2nd leap second.

Signed-off-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>date.c: s/is_date/set_date/</title>
<updated>2020-04-23T20:22:00Z</updated>
<author>
<name>Đoàn Trần Công Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2020-04-23T13:52:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c933b28d87062a0c68de298900b9060f577f865a'/>
<id>urn:sha1:c933b28d87062a0c68de298900b9060f577f865a</id>
<content type='text'>
The function is_date, confusingly also set tm_year. tm_mon, and tm_mday
after validating input.

Rename to set_date to reflect its real usage.

Also, change return value is 0 on success and -1 on failure following
our convention on function do some real work.

Signed-off-by: Đoàn Trần Công Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>date.c: switch to reentrant {gm,local}time_r</title>
<updated>2019-11-30T21:50:48Z</updated>
<author>
<name>Doan Tran Cong Danh</name>
<email>congdanhqx@gmail.com</email>
</author>
<published>2019-11-28T12:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ccd469450aaf62e6d0ce41a9738823d19d749a78'/>
<id>urn:sha1:ccd469450aaf62e6d0ce41a9738823d19d749a78</id>
<content type='text'>
Originally, git was intended to be single-thread executable.
`gmtime(3)' and `localtime(3)' can be used in such codebase
for cleaner code.

Overtime, we're employing multithread in our code base.

Let's phase out `gmtime(3)' and `localtime(3)' in favour of
`gmtime_r(3)' and `localtime_r(3)'.

Signed-off-by: Doan Tran Cong Danh &lt;congdanhqx@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Quit passing 'now' to date code</title>
<updated>2019-09-12T18:03:51Z</updated>
<author>
<name>Stephen P. Smith</name>
<email>ischis2@cox.net</email>
</author>
<published>2019-09-12T04:11:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=29f4332e66abf41e90d2f38e62370a42d8549c7e'/>
<id>urn:sha1:29f4332e66abf41e90d2f38e62370a42d8549c7e</id>
<content type='text'>
Commit b841d4ff43 (Add `human` format to test-tool, 2019-01-28) added
a get_time() function which allows $GIT_TEST_DATE_NOW in the
environment to override the current time. So we no longer need to
interpret that variable in cmd__date().

Therefore, we can stop passing the "now" parameter down through the
date functions, since nobody uses them. Note that we do need to make
sure all of the previous callers that took a "now" parameter are
correctly using get_time().

Signed-off-by: Stephen P. Smith &lt;ischis2@cox.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>completion: add more parameter value completion</title>
<updated>2019-02-20T20:31:56Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-02-16T11:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a59a2301f6ec9bcf1b101edb9ca33beb465842f'/>
<id>urn:sha1:5a59a2301f6ec9bcf1b101edb9ca33beb465842f</id>
<content type='text'>
This adds value completion for a couple more paramters. To make it
easier to maintain these hard coded lists, add a comment at the original
list/code to remind people to update git-completion.bash too.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'lt/date-human'</title>
<updated>2019-02-07T06:05:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-02-07T06:05:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ecbe1beb8e41664ac00581234a449c4487600e1d'/>
<id>urn:sha1:ecbe1beb8e41664ac00581234a449c4487600e1d</id>
<content type='text'>
A new date format "--date=human" that morphs its output depending
on how far the time is from the current time has been introduced.
"--date=auto" can be used to use this new format when the output is
going to the pager or to the terminal and otherwise the default
format.

* lt/date-human:
  Add `human` date format tests.
  Add `human` format to test-tool
  Add 'human' date format documentation
  Replace the proposed 'auto' mode with 'auto:'
  Add 'human' date format
</content>
</entry>
<entry>
<title>Add `human` format to test-tool</title>
<updated>2019-01-29T17:40:08Z</updated>
<author>
<name>Stephen P. Smith</name>
<email>ischis2@cox.net</email>
</author>
<published>2019-01-29T03:50:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b841d4ff438576fe0c3f69b7d48ba46a442f162b'/>
<id>urn:sha1:b841d4ff438576fe0c3f69b7d48ba46a442f162b</id>
<content type='text'>
Add the human format support to the test tool so that
GIT_TEST_DATE_NOW can be used to specify the current time.

The get_time() helper function was created and and checks the
GIT_TEST_DATE_NOW environment variable.  If GIT_TEST_DATE_NOW is set,
then that date is used instead of the date returned by by
gettimeofday().

All calls to gettimeofday() were replaced by calls to get_time().

Renamed occurances of TEST_DATE_NOW to GIT_TEST_DATE_NOW since the
variable is now used in the get binary and not just in the test-tool.

Signed-off-by: Stephen P. Smith &lt;ischis2@cox.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
