git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 1, 2022, 09:57 UTC
Message-ID
<220401.86pmm1nmvh.gmgdl@evledraar.gmail.com>
In-Reply-To
<Yka2GSGs3EIXm6Xt@vmiklos.hu>
On Fri, Apr 01 2022, Miklos Vajna wrote:
Show 11 quoted lines
> 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!

Previous: Miklos VajnaNext: Miklos Vajna
Message 2 of 24 in “git log --since to not stop after first old commit?”
  1. Miklos VajnaApr 1, 2022
  2. Ævar Arnfjörð BjarmasonApr 1, 2022
  3. Miklos VajnaApr 1, 2022
  4. Ævar Arnfjörð BjarmasonApr 1, 2022
  5. Junio C HamanoApr 1, 2022
  6. git-log: add a --since-as-filter optionMiklos Vajna, Apr 1, 2022
  7. git-log: add a --since-as-filter optionMiklos Vajna, Apr 2, 2022
  8. Miklos VajnaApr 7, 2022
  9. Junio C HamanoApr 8, 2022
  10. Junio C HamanoApr 8, 2022
  11. git-log: add a --since=... --as-filter optionMiklos Vajna, Apr 8, 2022
  12. Ævar Arnfjörð BjarmasonApr 12, 2022
  13. git-log: add a --since=... --as-filter optionMiklos Vajna, Apr 15, 2022
  14. Junio C HamanoApr 15, 2022
  15. log: "--as-filter" option adjusts how "--since" cut-off worksMiklos Vajna, Apr 16, 2022
  16. Miklos VajnaApr 22, 2022
  17. Miklos VajnaApr 11, 2022
  18. demerphqApr 11, 2022
  19. Junio C HamanoApr 11, 2022
  20. Junio C HamanoApr 22, 2022
  21. log: "--since-as-filter" option is a non-terminating "--since" variantMiklos Vajna, Apr 22, 2022
  22. Junio C HamanoApr 22, 2022
  23. log: "--since-as-filter" option is a non-terminating "--since" variantMiklos Vajna, Apr 23, 2022
  24. Junio C HamanoApr 22, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.