Re: git log --since to not stop after first old commit?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 01 2022, Miklos Vajna wrote:

> Hi,
>
> I wanted to look at commits of a contributor from the last year, and
> noticed that I only see commits from this year, not last year when I use:
>
>         git log --author="that person" --since="1 year ago"
>
> Digging around in the history, one other contributor pushed a mistake on
> 1st Jan, where the author date was supposed to be 2022-01-01, but
> happened to be 2021-01-01. Knowing that, it makes sense that 'git log'
> stopped at that commit by default.

So (just making sure I understand this) in this case the --since option
is behaving as expected in the sense that the information in the commit
itself matches what it's finding, but what you'd really like for it to
consider some "adjusted" commit date?

I.e. to be smart enough to spot that it should include a commit from
2021 if all the preceding commits are from 2022, or some other similar
heuristic?

Or...

> I wonder though, is there any option to "force" git log to walk all
> reachable commits from HEAD, but just show the ones which match the
> --since criteria?

...did we stop the walk as soon as we saw that 2021 commit?

> Or is this need so special that the best is to parse the output of 'git
> rev-list' and do my own filtering for author and date?

I think this is somewhere between "we could grow a new feature to be
more helpful" (we adjust commit dates in other places, i.e. commit-graph
reachability), or "a bug" depending on the answersto the above, but I
obviously haven't dug much. Hope this helps!



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux