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

Re: Re Behavior of git log --diff-filter=d

From
Jeff King <peff@peff.net>
Date
Jul 3, 2025, 15:36 UTC
Message-ID
<20250703153611.GB1309870@coredump.intra.peff.net>
In-Reply-To
<20250703134220.31638-1-jayatheerthkulkarni2005@gmail.com>
On Thu, Jul 03, 2025 at 07:12:20PM +0530, K Jayatheerth wrote:
Show 5 quoted lines
> Yes, this is expected behavior
> You're seeing a difference because
> 
> --diff-filter=d tells Git to exclude commits that have deleted files in their diffs.
> However, this filter only applies if there is a diff to filter.

I don't think that is true. Even if we are not showing a diff, we'll select which commits to show based on diff options (and show only those that still touch something). That's why "--diff-filter=D" shows only the commit with the deletion. With the "d" filter we should omit deletions, leaving the second commit with no changes (and thus not shown).

-Peff
Previous: K JayatheerthNext: Eric Salem
Message 3 of 9 in “Behavior of git log --diff-filter=d”
  1. Eric SalemJul 2, 2025
  2. Re Behavior of git log --diff-filter=dK Jayatheerth, Jul 3, 2025
  3. Jeff KingJul 3, 2025
  4. Eric SalemJul 3, 2025
  5. Jeff KingJul 3, 2025
  6. setup_revisions(): turn on diffs for all-negative diff filterJeff King, Jul 3, 2025
  7. Eric SalemJul 3, 2025
  8. Karthik NayakJul 4, 2025
  9. Junio C HamanoJul 7, 2025

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.