From: Junio C Hamano <gitster@pobox.com>
To: gregor@chkpnt.de
Cc: git@vger.kernel.org
Subject: Re: Question: --since date parsing uses current time instead of midnight - by design?
Date: Sat, 14 Feb 2026 14:11:09 -0800 [thread overview]
Message-ID: <xmqq3433gema.fsf@gitster.g> (raw)
In-Reply-To: <xmqq8qcwjmgh.fsf@gitster.g> (Junio C. Hamano's message of "Fri, 13 Feb 2026 14:41:18 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> gregor@chkpnt.de writes:
>
>> Hello,
>>
>> I've just noticed how git log --since=<date> interprets dates without
>> explicit times, and I found the behavior seems potentially unintended.
>> I'd like to understand if this is by design or a bug.
>
> Looks like it is very much designed, ...
>
> https://lore.kernel.org/git/Pine.LNX.4.64.0511171505080.13959@g5.osdl.org/
>
> ... at least to me.
With hindsight, it looks to me that both conventions are equally
legit. If you extend a low-resolution time specification (e.g.,
date only without hours and minutes) to use the current time, which
is what Linus decided to do, that is one valid convention. You can
choose to extend lower bits to zero (e.g., date only without hours
and minutes means midnight at the beginning of that day), that is
equally valid.
The former, however, is more convenient than the latter for humans.
You can ask "what did we in the past 24-hours?" more easily. And if
you really care to give the midnight, filling the lower bits to zero
yourself is not that hard, compared to having to fill the lower bits
with the current time. So it would be an overall win for both use
cases.
prev parent reply other threads:[~2026-02-14 22:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 21:09 Question: --since date parsing uses current time instead of midnight - by design? gregor
2026-02-13 22:41 ` Junio C Hamano
2026-02-14 22:11 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq3433gema.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gregor@chkpnt.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox