threads / discuss / 29294

git log --since --until

Subject: git log --since --until

## tl;dr

4 messages between Jan 4, 2012 and Jan 4, 2012.

replies: 3people: 2as markdown or json

Hilco Wijbenga· Jan 4, 2012, 21:46 UTC · lore
Hi all,

I need to write sort of a report listing what we worked on (month by month) over the last year. Yippie. ;-)

Luckily most of the information I can get from our Git logs but I noticed some "anomalies". The quotes are there because I do understand (or I think I do anyway) why those "anomalies" are there.

As an example, I ran (on master)
git log --since="01-Dec-2011" --until="31-Dec-2011"

The returned list of commits also included a few from November. I'm guessing that's because --since and --until simply determine a start commit and an end commit in master and any commit that falls in that range is included, whether its actual commit date is in the originally specified date range or not.

Is there a way to just get the commits made in December? (I can manually go through the list, of course, [and that's probably what I'll do] but playing with Git is more fun than writing a report. ;-) )

Cheers, Hilco

Junio C Hamano· Jan 4, 2012, 22:16 UTC · re: Hilco Wijbenga · lore

Re: git log --since --until

Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
> git log --since="01-Dec-2011" --until="31-Dec-2011"
>
> The returned list of commits also included a few from November.

These limits act on committer dates. Are you by any chance looking at author dates instead?

Hilco Wijbenga· Jan 4, 2012, 22:32 UTC · re: Junio C Hamano · lore

Re: git log --since --until

On 4 January 2012 14:16, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
>
>> git log --since="01-Dec-2011" --until="31-Dec-2011"
>>
>> The returned list of commits also included a few from November.
>
> These limits act on committer dates. Are you by any chance looking at
> author dates instead?

I had to look that up. :-) Yes, I'm apparently looking at (and for) author dates. I don't really care when the commit was merged into master (that's the committer date, right?), I want to know when the work was done.

I didn't really see any useful switches for git log in this regard but then the author date seems to be additional data without special meaning to Git.

Junio C Hamano· Jan 4, 2012, 22:58 UTC · re: Hilco Wijbenga · lore

Re: git log --since --until

Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
> ... the author date seems to be additional data without special
> meaning to Git.
That is exactly correct. The author date is merely for human consumption.

← back to recent threads