{"thread":{"id":"53369","subject":"git log --since=<date>","startedAt":"2020-05-01T21:55:05Z","lastAt":"2020-05-02T16:21:53Z","messageCount":7,"participants":["Dmitry Kulikov","Junio C Hamano","Danh Doan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"396788","messageId":"3860060.ab4mYtCOl4@hp470","threadId":"53369","inReplyTo":null,"subject":"git log --since=<date>","fromName":"Dmitry Kulikov","fromEmail":"dima@koulikoff.ru","sentAt":"2020-05-01T21:35:53Z","receivedAt":"2020-05-01T21:55:05Z","isPatch":false,"sender":{"key":"dima@koulikoff.ru","avatar":null},"body":"Hello, \n\nI have found a problem.\n\nIt turned out, that the timestamp used to determinate which commit is later \nthe given date is not at 0h 0m 0s, Instead it is at the current time.\n\nSimilarly --until=<date> uses not 23h 59m 59s but also current time.\n-- \n\nWith best regards,\n   Dmitry Kulikov\n\nmailto:dima@koulikoff.ru\nskype: dima.koulikoff\nphone: +49 151 6338 5032\nViber, WhatsApp: +7 925 505 2185\n"},{"id":"396789","messageId":"xmqqd07nl3dt.fsf@gitster.c.googlers.com","threadId":"53369","inReplyTo":"3860060.ab4mYtCOl4@hp470","subject":"Re: git log --since=<date>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-05-01T22:03:10Z","receivedAt":"2020-05-01T22:03:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dmitry Kulikov <dima@koulikoff.ru> writes:\n\n> I have found a problem.\n>\n> It turned out, that the timestamp used to determinate which commit is later \n> the given date is not at 0h 0m 0s, Instead it is at the current time.\n>\n> Similarly --until=<date> uses not 23h 59m 59s but also current time.\n\nThe behaviour is as designed.  \"git log --since=yesterday\" does the\nsame \"as nobody said which hour and minute, we take it to mean this\ntime yesterday\".\n\nYou of course can say \"git log --since=yesterday.midnight\" if you\nwant to be exact ;-).\n\n"},{"id":"396811","messageId":"42953119.Wv2erQna2g@hp470","threadId":"53369","inReplyTo":"xmqqd07nl3dt.fsf@gitster.c.googlers.com","subject":"Re: git log --since=<date>","fromName":"Dmitry Kulikov","fromEmail":"dima@koulikoff.ru","sentAt":"2020-05-02T05:54:03Z","receivedAt":"2020-05-02T05:54:11Z","isPatch":false,"sender":{"key":"dima@koulikoff.ru","avatar":null},"body":"On Friday 01 May 2020 15:03:10 Junio C Hamano wrote:\n\n> Dmitry Kulikov <dima@koulikoff.ru> writes:\n> > I have found a problem.\n> > \n> > It turned out, that the timestamp used to determinate which commit is\n> > later\n> > the given date is not at 0h 0m 0s, Instead it is at the current time.\n> > \n> > Similarly --until=<date> uses not 23h 59m 59s but also current time.\n> \n> The behaviour is as designed.  \"git log --since=yesterday\" does the\n> same \"as nobody said which hour and minute, we take it to mean this\n> time yesterday\".\n\n  In the documentation it is not described this way. It is said:\n\n       --since=<date>, --after=<date>\n           Show commits more recent than a specific date.\n\n  Nothing is said about the time I entered the command.\n\n> You of course can say \"git log --since=yesterday.midnight\" if you\n> want to be exact ;-).\n\n  What should I enter instead --since=2020-05-01 to have a midnight time?\n\n-- \n\nWith best regards,\n   Dmitry Kulikov\n\nmailto:dima@koulikoff.ru\nskype: dima.koulikoff\nphone: +49 151 6338 5032\nViber, WhatsApp: +7 925 505 2185\n"},{"id":"396818","messageId":"20200502110350.GA3143@danh.dev","threadId":"53369","inReplyTo":"42953119.Wv2erQna2g@hp470","subject":"Re: git log --since=<date>","fromName":"Danh Doan","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-05-02T11:03:50Z","receivedAt":"2020-05-02T11:04:03Z","isPatch":false,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2020-05-02 07:54:03+0200, Dmitry Kulikov <dima@koulikoff.ru> wrote:\n> On Friday 01 May 2020 15:03:10 Junio C Hamano wrote:\n> > You of course can say \"git log --since=yesterday.midnight\" if you\n> > want to be exact ;-).\n> \n>   What should I enter instead --since=2020-05-01 to have a midnight time?\n\n\nYou can use the same syntax:\n\n\tgit log --since='2020-05-01 midnight'\n\t# or ISO-8601\n\tgit log --since='2020-05-01 00:00:00'\n\n\n-- \nDanh\n"},{"id":"396819","messageId":"5265732.OezXlLLYS9@hp470","threadId":"53369","inReplyTo":"20200502110350.GA3143@danh.dev","subject":"Re: git log --since=<date>","fromName":"Dmitry Kulikov","fromEmail":"dima@koulikoff.ru","sentAt":"2020-05-02T11:52:23Z","receivedAt":"2020-05-02T11:52:31Z","isPatch":false,"sender":{"key":"dima@koulikoff.ru","avatar":null},"body":"On Saturday 02 May 2020 18:03:50 Danh Doan wrote:\n\n> On 2020-05-02 07:54:03+0200, Dmitry Kulikov <dima@koulikoff.ru> wrote:\n> > On Friday 01 May 2020 15:03:10 Junio C Hamano wrote:\n> > > You of course can say \"git log --since=yesterday.midnight\" if you\n> > > want to be exact ;-).\n> > > \n> >   What should I enter instead --since=2020-05-01 to have a midnight time?\n> \n> You can use the same syntax:\n> \n> \tgit log --since='2020-05-01 midnight'\n> \t# or ISO-8601\n> \tgit log --since='2020-05-01 00:00:00'\n\n  Thank you. Please, do not forget to mention that in the documentation.\n-- \n\nWith best regards,\n   Dmitry Kulikov\n\nmailto:dima@koulikoff.ru\nskype: dima.koulikoff\nphone: +49 151 6338 5032\nViber, WhatsApp: +7 925 505 2185\n"},{"id":"396820","messageId":"6402621.Z0eHAnHnDS@hp470","threadId":"53369","inReplyTo":"42953119.Wv2erQna2g@hp470","subject":"Re: git log --since=<date>","fromName":"Dmitry Kulikov","fromEmail":"dima@koulikoff.ru","sentAt":"2020-05-02T12:02:10Z","receivedAt":"2020-05-02T12:02:18Z","isPatch":false,"sender":{"key":"dima@koulikoff.ru","avatar":null},"body":"On Saturday 02 May 2020 7:54:03 Dmitry Kulikov wrote:\n\n> On Friday 01 May 2020 15:03:10 Junio C Hamano wrote:\n\n> > The behaviour is as designed.  \"git log --since=yesterday\" does the\n> > same \"as nobody said which hour and minute, we take it to mean this\n> > time yesterday\".\n\n  After some consideration I still think, that the time if not set explicitly \nshould be midnight.\n\n-- \n\nWith best regards,\n   Dmitry Kulikov\n\nmailto:dima@koulikoff.ru\nskype: dima.koulikoff\nphone: +49 151 6338 5032\nViber, WhatsApp: +7 925 505 2185\n"},{"id":"396834","messageId":"xmqqzhaqjoiv.fsf@gitster.c.googlers.com","threadId":"53369","inReplyTo":"20200502110350.GA3143@danh.dev","subject":"Re: git log --since=<date>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-05-02T16:21:44Z","receivedAt":"2020-05-02T16:21:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Danh Doan <congdanhqx@gmail.com> writes:\n\n> On 2020-05-02 07:54:03+0200, Dmitry Kulikov <dima@koulikoff.ru> wrote:\n>> On Friday 01 May 2020 15:03:10 Junio C Hamano wrote:\n>> > You of course can say \"git log --since=yesterday.midnight\" if you\n>> > want to be exact ;-).\n>> \n>>   What should I enter instead --since=2020-05-01 to have a midnight time?\n>\n>\n> You can use the same syntax:\n>\n> \tgit log --since='2020-05-01 midnight'\n> \t# or ISO-8601\n> \tgit log --since='2020-05-01 00:00:00'\n\nPerhaps the use of <date> in the documentation is what is causing\nthis confusion?  Would <timestamp> or <datetime> work better?\n\nThere is Documentation/date-formats.txt that is included by the help\npages for \"git commit-tree\", \"git commit\" and \"git tag\".  These pages\nconsistently use \"date\" and does not say timestamp nor datetime, so\nthe noun we use in \"git log\" documentation is OK.\n\nBut the date-formats documentation is not included there, so we\nwould be OK once we\n\n (1) adjust the contents of the date-formats.txt documentation to\n     make sure it can be used in \"git log\" documentation, and\n\n (2) find the right place to include it in \"git log\" documentation.\n\nHere is a rough draft to do so.  I was tempted not to touch\ngit-log.txt and instead include it in rev-list-options.txt (where\n\"--since\" and friends are described), but the structure of the\ndocument was not ready for that.  If somebody wants to go in that\ndirection, it might be better as it would allow us to cover things\nlike \"git shortlog --since=3.months.ago\", but then we probably\nshould do the following before we can do so:\n\n (1) remove the section title and its header level from\n     date-formats.txt, and adjust the existing pages that include\n     it, and\n\n (2) find the right place in rev-list-options.txt, and\n\n (3) make sure everybody that includes rev-list-options.txt are\n     happy with the added description (if some of them do not offer\n     an option to specify ranges, they must conditionally be\n     excluded from using date-formats.txt).\n\nThanks.\n\n Documentation/date-formats.txt | 25 ++++++++++++++++++-------\n Documentation/git-commit.txt   |  1 -\n Documentation/git-log.txt      |  2 ++\n 3 files changed, 20 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/date-formats.txt b/Documentation/date-formats.txt\nindex 6926e0a4c8..ce6f6bdb95 100644\n--- a/Documentation/date-formats.txt\n+++ b/Documentation/date-formats.txt\n@@ -1,11 +1,10 @@\n-DATE FORMATS\n-------------\n+DATE INPUT FORMATS\n+------------------\n \n-The `GIT_AUTHOR_DATE`, `GIT_COMMITTER_DATE` environment variables\n-ifdef::git-commit[]\n-and the `--date` option\n-endif::git-commit[]\n-support the following date formats:\n+The `GIT_AUTHOR_DATE`, `GIT_COMMITTER_DATE` environment variables,\n+the `--date` option of `git commit`, and\n+the options like `--since` of `git log`,\n+all of which specify date-time, support the following date formats:\n \n Git internal format::\n \tIt is `<unix timestamp> <time zone offset>`, where `<unix\n@@ -24,3 +23,15 @@ ISO 8601::\n +\n NOTE: In addition, the date part is accepted in the following formats:\n `YYYY.MM.DD`, `MM/DD/YYYY` and `DD.MM.YYYY`.\n++\n+NOTE: Some human-friendly date and time (e.g. `yesterday`,\n+`midnight`, `4 days ago`) are also accepted.  \n+The full list is left as trivia for readers to discover.\n++\n+NOTE: A date-time that lacks time-part is taken to be the same time on\n+that day.  For example, `yesterday` used at 8 in the morning means 8 in the\n+morning yesterday.  A date-time that lacks date-part is taken to be\n+the given time on the same day (if the time has already passed) or\n+on the day before (otherwise).  For example, `8AM` used at 9 in the morning\n+means an hour ago the same day, while `noon` used at 9 in the morning \n+is taken as the noon the day before.\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex a3baea32ae..70cf5d9d4f 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -494,7 +494,6 @@ the environment variables.\n The typical usage is to set just the `user.name` and `user.email` variables;\n the other options are provided for more complex use cases.\n \n-:git-commit: 1\n include::date-formats.txt[]\n \n DISCUSSION\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 20e6d21a74..d2bda18d45 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -109,6 +109,8 @@ options or the revision range, when confusion arises.\n \n include::rev-list-options.txt[]\n \n+include::date-formats.txt[]\n+\n include::pretty-formats.txt[]\n \n COMMON DIFF OPTIONS\n"}]}