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

Re: [PATCH v3 2/2] blame: ignore revs in HEAD:.git-blame-ignore-revs

From
RMRavi Mistry <rmistry@google.com>
Date
Oct 12, 2026, 15:48 UTC
Message-ID
<20261012154834.622130-1-rmistry@google.com>
In-Reply-To
<e3b68210-7558-4f95-bc3c-eb57b1065790@gmail.com>
Hi Phillip!
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 8 quoted lines
> I can see we'd want to use the committed version in a bare repository,
> but it seems strange to me to ignore uncommitted changes in a non-bare
> repository. We don't do that for other special files like
> .gitattributes. It is rather inconvinient if the user has to explicitly
> pass the file inorder to test the effect of local modification to
> .git-brame-ignore-revs. To me it would make more sense to automatically
> use .git-blame-ignore-revs file from the working tree when that path is
> tracked by git.

In v1, this patch originally read .git-blame-ignore-revs from the working tree in non-bare repositories. I switched to reading the HEAD:.git-blame-ignore-revs blob in v2 based on Junio's review and suggestions on v1 (https://lore.kernel.org/git/xmqqse2kma4o.fsf@gitster.g/).

> I did wonder if we wanted to automatically support
> .git-blame-ignore-revs in the root of a subtree, but I don't think there
> is an easy way to do that without visiting all the directories
> containing tracked files which makes it too expensive.

Agreed. By convention across the ecosystem (GitHub, GitLab, and soon Gerrit and Gitiles), .git-blame-ignore-revs is read from the root of the repository, so only looking at the root keeps it simple and avoids the overhead of walking subdirectories.

Show 5 quoted lines
> One final thought - do we want to limit the size of the blob that we're
> prepared to parse as we do for .gitattributes? I had a very quick look
> at the khash code which is used by 'struct oidset' and it seems to use
> 32 bit integers for the number of entries. I did not spend anytime
> trying to figure out what happens if you try and store 2^32 entires.

In parse_oidset_line(), peel_to_commit_oid() runs before oidset_insert() and skips any OID that is not an existing local commit in the repository, and duplicate OIDs hash to the same entry. So the oidset (and khash) will not have more entries than the number of local commits in the repository. That said, if you and Junio would like a blob size cap in parse_default_ignore_revs_blob() (similar to ATTR_MAX_FILE_SIZE), I am happy to add one.

Thanks!
Previous: Phillip WoodNext: Ravi Mistry via GitGitGadget
Message 27 of 40 in “blame: default to ignoring revisions in .git-blame-ignore-revs”
  1. blame: default to ignoring revisions in .git-blame-ignore-revsRavi Mistry via GitGitGadget, Sep 11, 2026
  2. Ravi MistrySep 30, 2026
  3. Junio C HamanoOct 5, 2026
  4. Ravi MistryOct 5, 2026
  5. Junio C HamanoOct 7, 2026
  6. Ravi MistryOct 7, 2026
  7. 0/2 blame: ignore revs in HEAD:.git-blame-ignore-revs by defaultRavi Mistry via GitGitGadget, Oct 8, 2026
  8. 1/2 blame: harden ignore-revs parser and tag peelingRavi Mistry via GitGitGadget, Oct 8, 2026
  9. Junio C HamanoOct 9, 2026
  10. Ravi MistryOct 10, 2026
  11. 2/2 blame: ignore revs in HEAD:.git-blame-ignore-revsRavi Mistry via GitGitGadget, Oct 8, 2026
  12. Junio C HamanoOct 9, 2026
  13. Eric SunshineOct 10, 2026
  14. Ravi MistryOct 10, 2026
  15. Junio C HamanoOct 11, 2026
  16. Ravi MistryOct 11, 2026
  17. Junio C HamanoOct 11, 2026
  18. Phillip WoodOct 12, 2026
  19. Junio C HamanoOct 12, 2026
  20. Ravi MistryOct 12, 2026
  21. Junio C HamanoOct 12, 2026
  22. Ravi MistryOct 13, 2026
  23. 0/2 blame: ignore revs in HEAD:.git-blame-ignore-revs by defaultRavi Mistry via GitGitGadget, Oct 11, 2026
  24. 1/2 blame: harden ignore-revs parser and tag peelingRavi Mistry via GitGitGadget, Oct 11, 2026
  25. 2/2 blame: ignore revs in HEAD:.git-blame-ignore-revsRavi Mistry via GitGitGadget, Oct 11, 2026
  26. Phillip WoodOct 12, 2026
  27. Ravi MistryOct 12, 2026
  28. 0/2 blame: ignore revs in HEAD:.git-blame-ignore-revs by defaultRavi Mistry via GitGitGadget, Oct 12, 2026
  29. 1/2 blame: harden ignore-revs parser and tag peelingRavi Mistry via GitGitGadget, Oct 12, 2026
  30. 2/2 blame: ignore revs in HEAD:.git-blame-ignore-revsRavi Mistry via GitGitGadget, Oct 12, 2026
  31. 0/2 blame: ignore revs in .git-blame-ignore-revs by defaultRavi Mistry via GitGitGadget, Oct 13, 2026
  32. 1/2 blame: harden ignore-revs parser and tag peelingRavi Mistry via GitGitGadget, Oct 13, 2026
  33. 2/2 blame: ignore revs in .git-blame-ignore-revs by defaultRavi Mistry via GitGitGadget, Oct 13, 2026
  34. Junio C HamanoOct 13, 2026
  35. Ravi MistryOct 13, 2026
  36. Junio C HamanoOct 13, 2026
  37. Phillip WoodOct 15, 2026
  38. 0/2 blame: ignore revs in .git-blame-ignore-revs by defaultRavi Mistry via GitGitGadget, Oct 13, 2026
  39. 1/2 blame: harden ignore-revs parser and tag peelingRavi Mistry via GitGitGadget, Oct 13, 2026
  40. 2/2 blame: ignore revs in .git-blame-ignore-revs by defaultRavi Mistry via GitGitGadget, Oct 13, 2026

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.