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

可紊 提交于 2020-01-25 01:03:25

问题


Reference the answer at https://stackoverflow.com/a/19987337/257924 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
$ 

来源:https://stackoverflow.com/questions/59691065/what-does-git-log-since-until-do-when-there-is-no-hhmmss-supplied-in-the-v

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!