Skip to contentSkip to conversation

The since date of "git log" will have influence on the until date of it.

Bug Report Wang, Lei 2 participants 3 messages Jul 22, 2022

lore
Share & tools
lore

Wang, Lei

author
#0 lore raw

The since date of "git log --since" will have influence on the until date of it.

How to reproduce?

1. clone this repo https://erol.kernel.org/lkml/git/8/
2. run "git log --since="2020-05-30" --until="2020-06-02"", it won't output anything
3. change the since date to 2020-05-29: run "git log --since="2020-05-29" --until="2020-06-02""
4. it will output the commits in 2020-06-02 (The until date)

Why would that happen, I just change the since date from 2020-05-30 to 2020-05-29, why it suddenly output the commits in 2020-06-02?

Signature · 2 lines
BR,
Lei
#1 lore raw
Quoted 12 lines · Lei

The since date of "git log --since" will have influence on the until date of it.

How to reproduce?

1. clone this repo https://erol.kernel.org/lkml/git/8/
2. run "git log --since="2020-05-30" --until="2020-06-02"", it won't output anything
3. change the since date to 2020-05-29: run "git log --since="2020-05-29" --until="2020-06-02""
4. it will output the commits in 2020-06-02 (The until date)

Quoted 2 lines

Why would that happen, I just change the since date from 2020-05-30 to 2020-05-29, why it suddenly output the commits in 2020-06-02?

Perhaps there are clock skews in the history recorded in the repository? IOW, some commits have committer dates that are older than those of their ancestors?

For example, if you had a commit that has committer date of June 1st noon, and one of its children has committer date of May 29th noon, starting the history traversal from that misdated child and saying "I don't want to see commits before May 30th midnight, so stop the traversal immediately if you see a commit with timestamp older than that" with "--since=May.30th", the traversal stops even before the misdated child is shown. If you shift the cut-off date and ask to stop at May 29th midnight, then the misdated child is newer than that cut-off date and would be shown, and its parent, which has the date of June 1st, would also be shown.

author
#2 lore raw

Is the git log process involving some random methods? I tested the same command of the same repo with the same git version (37.1) on two different machines (i.e., just the machine is different), but the output is totally different...

BR,
Lei

Quoted 31 lines · Junio C Hamano
Quoted 9 lines · Lei

The since date of "git log --since" will have influence on the until date of it.

How to reproduce?

1. clone this repo https://erol.kernel.org/lkml/git/8/
2. run "git log --since="2020-05-30" --until="2020-06-02"", it won't output anything
3. change the since date to 2020-05-29: run "git log

Quoted 5 lines
    --since="2020-05-29" --until="2020-06-02""

4. it will output the commits in 2020-06-02 (The until date)

Why would that happen, I just change the since date from 2020-05-30 to 2020-05-29, why it suddenly output the commits in 2020-06-02?

Perhaps there are clock skews in the history recorded in the repository? IOW, some commits have committer dates that are older than those of their ancestors?

For example, if you had a commit that has committer date of June 1st noon, and one of its children has committer date of May 29th noon, starting the history traversal from that misdated child and saying "I don't want to see commits before May 30th midnight, so stop the traversal immediately if you see a commit with timestamp older than that" with "--since=May.30th", the traversal stops even before the misdated child is shown. If you shift the cut-off date and ask to stop at May 29th midnight, then the misdated child is newer than that cut-off date and would be shown, and its parent, which has the date of June 1st, would also be shown.