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

Git log: filtering by date and by lines do not work together

From
МДМария Долгополова <dolgopolovamariia@gmail.com>
Date
Jul 3, 2020, 14:14 UTC
Message-ID
<CAD6JL5SRvB_yXcqJ5HGADQaGtZAiKrtd447vtHLSagJqNGPChA@mail.gmail.com>
Hi! I would like to report the bug.

I want to get commits that change specific lines in a specific file and were made before a specific date.

Steps:
1) I apply filtering by date: --before="2016-11-18"
Result is in the picture FilteringByDate.png. Commit
570778797effd69bd4536c51125b7d2e8f654c08 is presented.
2) I apply filtering by lines:
-L33,34:src/main/java/org/toradocu/translator/Subject.java
Result is in the picture FilteringByLines.png . Commit
570778797effd69bd4536c51125b7d2e8f654c08 is presented.
3) Finally, I apply filtering by lines and by date:
--before="2016-11-18"
-L33,34:src/main/java/org/toradocu/translator/Subject.java
Result is in the picture FilteringByDatesAndLines.png . Commit
570778797effd69bd4536c51125b7d2e8f654c08 is NOT presented.

Expected Result: the commit is presented in filter 1 and in filter 2, so it must be presented in filter “1 AND 2”

Actual Result: the commit is NOT presented in filter “1 AND 2”
Environment: git version 2.27.0.windows.1
 I beg you to provide me with a workaround. I am doing research work
on analyzing commits in open source projects. Therefore, this
functionality is very important to me.
Next: René Scharfe
Message 1 of 4 in “Git log: filtering by date and by lines do not work together”
  1. Мария ДолгополоваJul 3, 2020
  2. René ScharfeJul 4, 2020
  3. revision: disable min_age optimization with line-logRené Scharfe, Jul 4, 2020
  4. Junio C HamanoJul 7, 2020

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.