Re: Question: --since date parsing uses current time instead of midnight - by design?
From: Junio C Hamano <hidden>
Date: 2026-02-14 22:11:12
Junio C Hamano [off-list ref] writes:
gregor@chkpnt.de writes:quoted
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/ (local) ... 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.