Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange behavior from git log --since
    primarykey
    data
    text
    <p>I have a test repository with 18 commits. <code>git log | grep Date:</code> returns the following: </p> <pre><code>Date: Fri Sep 20 08:04:13 2013 +0200 Date: Fri Sep 20 08:03:28 2013 +0200 Date: Fri Sep 20 08:02:05 2013 +0200 Date: Thu Sep 19 09:53:10 2013 +0200 Date: Wed Sep 18 17:04:41 2013 +0200 Date: Wed Sep 18 17:03:36 2013 +0200 Date: Sat Sep 14 14:42:10 2013 +0200 Date: Wed Sep 11 10:37:25 2013 +0200 Date: Fri Aug 30 13:59:43 2013 +0200 Date: Fri Aug 30 13:56:35 2013 +0200 Date: Fri Aug 30 11:30:17 2013 +0200 Date: Thu Aug 29 13:44:28 2013 +0200 Date: Thu Aug 29 13:34:32 2013 +0200 Date: Wed Aug 28 14:44:03 2013 +0200 Date: Wed Aug 28 14:32:44 2013 +0200 Date: Tue Aug 27 16:18:53 2013 +0200 Date: Tue Aug 27 16:16:29 2013 +0200 Date: Tue Aug 27 15:46:04 2013 +0200 </code></pre> <p>I want to get a log from all commits that happened today (20.09.2013), so I tried</p> <pre><code>git log --since=20-09-2013 | grep Date: </code></pre> <p>I get nothing with that. So I searched a bit here on SO and found <a href="https://stackoverflow.com/questions/14618022/how-does-git-log-since-count">this</a> question. In the comments it states that </p> <blockquote> <p>seems so, that it without a time it defaults to the last second of the day.</p> </blockquote> <p>Okay, no problem. Let's try <code>git log --since=19-09-2013</code>. That returns</p> <pre><code>Date: Fri Sep 20 08:04:13 2013 +0200 Date: Fri Sep 20 08:03:28 2013 +0200 Date: Fri Sep 20 08:02:05 2013 +0200 Date: Thu Sep 19 09:53:10 2013 +0200 </code></pre> <p>Wait, that seems strange, doesn't it? If it's supposed to use the last second of the specified date, why would it display a commit that happened at <code>09:53:10</code> on that date? Shouldn't git only display the commits that happened after 19.09.2013? </p> <p>But wait, it gets even stranger! I tried adding a time, which resulted in </p> <pre><code>git log --since=20-09-201309:00:00 Date: Fri Sep 20 08:04:13 2013 +0200 Date: Fri Sep 20 08:03:28 2013 +0200 Date: Fri Sep 20 08:02:05 2013 +0200 </code></pre> <p>That did the tri...wait a minute...All the commits happened before <code>09:00:00</code>. Why does git display them? In fact, as far as I'm aware I just made a syntax error too! Let's try out some stuff:</p> <pre><code>git log --since=20-09-201312:08:00 | grep Date: Date: Fri Sep 20 08:04:13 2013 +0200 Date: Fri Sep 20 08:03:28 2013 +0200 Date: Fri Sep 20 08:02:05 2013 +0200 </code></pre> <p>Still works...</p> <pre><code>git log --since=20-09-201312:09:00 | grep Date: &lt;nothing&gt; </code></pre> <p>Hmm, what happened there? Seems like git uses only the last two :-separated numbers. But why would git display the commits that happened after <code>20.09.2013 08:00</code> if it seems to think that actually I'm looking for commits after <code>20.09.201312 08:00</code>? This doesn't make any sense to me. </p> <h3>Can anyone explain this mess to me? It's not that I don't have a solution to solve my problem, but I want to understand, what is happening here...</h3>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload