What does git log --since/--until do when there is no HH:MM:SS supplied in the value?
Asked Answered
A

0

1

Reference the answer at https://mcmap.net/q/109205/-how-do-i-view-all-commits-for-a-specific-day to the question of How do I view all commits for a specific day?

What is the value of HH:MM:SS referenced below that would make the output of the following command be true across all git repositories regardless of history and content:

git log --since='2019-12-25'          --until='2019-12-26 00:00:00'
git log --since='2019-12-25 HH:MM:SS' --until='2019-12-26 00:00:00'

I ask because the man-page for git-log does not provide that detail (or I missed it).

TL;DR Experiment

Try this on your own git repos, and be as baffled by the output as I am by the fact that all of the one after the first combination yield differences in git log output:

$ for x in "" "00:00:00" "23:59:59"
do
  for y in "" "00:00:00" "23:59:59"
  do
    printf "x %-10s y %-10s --> " "<$x>" "<$y>"
    diff <(git log --since=2019-12-25 --until=2019-12-26 | sha1sum) <(git log --since="2019-12-25 $x" --until="2019-12-26 $y" | sha1sum) | wc -l
  done
done
x <>         y <>         --> 0
x <>         y <00:00:00> --> 4
x <>         y <23:59:59> --> 4
x <00:00:00> y <>         --> 4
x <00:00:00> y <00:00:00> --> 4
x <00:00:00> y <23:59:59> --> 4
x <23:59:59> y <>         --> 4
x <23:59:59> y <00:00:00> --> 4
x <23:59:59> y <23:59:59> --> 4
$ 
Apotheosis answered 11/1, 2020 at 2:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.