I have a test repository with 18 commits.
git log | grep Date:
returns the following:
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
I want to get a log from all commits that happened today (20.09.2013), so I tried
git log --since=20-09-2013 | grep Date:
I get nothing with that. So I searched a bit here on SO and found this question. In the comments it states that
seems so, that it without a time it defaults to the last second of the day.
Okay, no problem. Let's try git log --since=19-09-2013
. That returns
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
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 09:53:10
on that date? Shouldn't git only display the commits that happened after 19.09.2013?
But wait, it gets even stranger! I tried adding a time, which resulted in
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
That did the tri...wait a minute...All the commits happened before 09:00:00
. 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:
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
Still works...
git log --since=20-09-201312:09:00 | grep Date:
<nothing>
Hmm, what happened there? Seems like git uses only the last two :-separated numbers. But why would git display the commits that happened after 20.09.2013 08:00
if it seems to think that actually I'm looking for commits after 20.09.201312 08:00
? This doesn't make any sense to me.