Subject: Re: Question: --since date parsing uses current time instead of midnight - by design?

From: Junio C Hamano <[email-masked]>
Date: Sat, 14 Feb 2026 14:11:09 -0800

Junio C Hamano <[email-masked]> writes:

> [email-masked] 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/[email-masked]/
>
> ... 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.