Git Rev News: Edition 141 (November 30th, 2026)

Welcome to the 141st edition of Git Rev News, a digest of all things Git. For our goals, the archives, the way we work, and how to contribute or to subscribe, see the Git Rev News page on git.github.io.

This edition covers what happened during the months of October and November 2026.

Discussions

Reviews

Ravi Mistry sent a patch via GitGitGadget to teach git blame and git annotate to automatically respect a .git-blame-ignore-revs file at the root of the working tree in non-bare repositories. The motivation was to eliminate a common mismatch between web hosting platforms which automatically ignore bulk formatting or refactoring commits listed in .git-blame-ignore-revs, and local git blame runs which don’t ignore them unless each user manually configured blame.ignoreRevsFile in every clone.

In the initial patch, Ravi anchored the lookup to repo_get_work_tree() and used lstat() so that symbolic links, directories, FIFOs, and sockets would be skipped safely. He also updated build_ignorelist() to start parsing only after the last empty string entry, ensuring that setting blame.ignoreRevsFile="" or passing --ignore-revs-file "" or --no-ignore-revs-file cleanly bypasses even a corrupted default file without opening it.

Background and Context

When git blame --ignore-revs-file and the blame.ignoreRevsFile configuration variable were introduced in 2019, Git deliberately avoided loading any default file. At the time, the feature was new, so avoiding unexpected I/O and attribution shifts took priority. Over the following years, however, committing a .git-blame-ignore-revs file at the repository root became a de facto standard adopted by GitHub, GitLab, Gerrit, and large projects such as Chromium and LLVM.

Ravi’s submission restarted a stalled earlier attempt by Abhijeetsingh Meena, crediting Abhijeetsingh along with reviewers Kristoffer Haugsbakk, Phillip Wood, and Eric Sunshine for earlier feedback on rationale, override semantics, documentation, and test organization.

Threat Model, Hardening, and Reading from HEAD

After Ravi sent a gentle ping, Junio Hamano, the Git maintainer, replied with two major points. First, Junio noted a mismatch in Ravi’s rationale. Reading from the working tree would diverge from hosting sites whenever an untracked file or uncommitted local edits existed, whereas always reading the HEAD:.git-blame-ignore-revs blob would match forges in both bare and non-bare repositories and avoid lstat() checks. Second, Junio warned that auto-loading an upstream-controlled file introduces a new threat vector. Before this change, blame.ignoreRevsFile came only from trusted configuration, so somebody had to “audit the parser for these files … and ensure that the implementation is truly secure.”

Ravi agreed with reading from HEAD and replied to Junio after auditing oidset.c and peel_to_commit_oid() in builtin/blame.c. He identified two places to tighten: rejecting lines with embedded NUL bytes via memchr(), and passing OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK in peel_to_commit_oid() while peeling tags step by step so missing objects cannot trigger lazy promisor fetches in partial clones. Junio clarified he had hoped security-minded reviewers would also inspect the parser, and encouraged Ravi to post a new version to attract their eyes.

Ravi then sent version 2 as a two-patch series renamed to “blame: ignore revs in HEAD:.git-blame-ignore-revs by default”. Patch 1 hardened oidset_parse_file_carefully() and peel_to_commit_oid(), using odb_read_object_info_extended() and verifying each peeled tag target’s declared type. Patch 2 loaded HEAD:.git-blame-ignore-revs via get_oid_with_context(), verified S_ISREG() to skip committed symlinks or directories, parsed the blob in memory with a new oidset_parse_buffer_carefully() helper sharing parse_oidset_line(), and switched git_blame_config() from string_list_insert() to string_list_append() to preserve ordering.

Reviewing patch 1 of version 2, Junio doubted that embedded NUL bytes had security implications, though, since malformed lines already call die(), rejecting them might be fine. But he welcomed the partial-clone and shallow protection in peel_to_commit_oid(). Ravi replied that the NUL check was for consistency with rejecting other trailing garbage.

On patch 2 of version 2, Junio questioned the Helped-by: trailers carried over from the earlier thread, asked why parse_oidset_line() was not extracted in patch 1, and noticed that parse_default_ignore_revs_blob() referenced the_repository even though sb->repo was already available. Eric replied to Junio that his input from the old thread had been only minor style fixups, while Ravi explained what each reviewer had contributed (Phillip on the rationale when --ignore-revs-file was introduced, Kristoffer on the override model and --no-ignore-revs-file, and Eric on docs and the t8013 test script). Ravi sent version 3 switching parse_default_ignore_revs_blob() to use sb->repo, and Junio proposed marking the topic ready for next unless objections appeared.

Size Limits and Working-Tree Ergonomics

Phillip quickly replied to both version 3 and Junio’s message with two key concerns. First, he noted that “it seems strange to me to ignore uncommitted changes in a non-bare repository”, pointing out that Git does not do so for .gitattributes and that it is inconvenient if users must explicitly pass the file to test local edits. He also wondered about capping the blob size as Git does for .gitattributes, noting that struct oidset uses 32-bit counters in khash.

Ravi replied to Phillip that peel_to_commit_oid() drops unknown OIDs before oidset_insert(), bounding the set to local commits, but offered to add a size cap similar to ATTR_MAX_FILE_SIZE. Junio replied to Phillip that capping the untrusted file size was “a sensible thing to worry about”, and added that consulting the checked-out copy, or even an untracked file before its first commit, did feel more intuitive.

Ravi sent version 4, which capped the default blob at IGNORE_REVS_MAX_FILE_SIZE (100 MB, matching ATTR_MAX_FILE_SIZE) via odb_read_object_info() before calling odb_read_object(), skipping oversized blobs with a warning. He kept reading from HEAD for now and asked whether to switch to the working tree in this series. Junio replied that reading the working tree in non-bare repositories was more ergonomic unless a stronger justification existed beyond matching forges.

Agreeing, Ravi sent version 5, renaming the series to “blame: ignore revs in .git-blame-ignore-revs by default”. Following the .mailmap model in read_mailmap(), patch 2 now reads .git-blame-ignore-revs from the working tree root in non-bare repositories (using open_nofollow(), S_ISREG(), and the 100 MB limit) and falls back to HEAD:.git-blame-ignore-revs in bare repositories.

Junio praised the ergonomic justification in version 5, suggested replacing “config option” with “configuration variable” in the docs, and spotted a misleading detail in cmd_blame() and build_ignorelist(). The default item stored ".git-blame-ignore-revs" with .util = &sb, yet neither the string nor the scoreboard pointer was actually used. Ravi addressed this in version 6, passing i->string to parse_default_ignore_revs() for both working-tree and HEAD:<path> lookups, setting .util = (void *)1 with a comment, and fixing the documentation terminology. Junio called the revised design “very cleanly done” and marked it ready for next. Phillip replied that aside from a minor note about lstat() before open_nofollow(), he was happy to see version 6 merged.

Conclusion

A long-standing ecosystem gap was closed cleanly while strengthening Git’s defenses against untrusted repository content. Both git blame and git annotate now honor .git-blame-ignore-revs out of the box, respecting local working-tree edits so developers can test changes before committing, and falling back to HEAD:.git-blame-ignore-revs in bare repositories. The feature also enforces a 100 MB safety limit, avoids lazy promisor fetches in partial clones, and still lets users opt out cleanly via --no-ignore-revs-file or blame.ignoreRevsFile="".

The two-patch series (rm/blame-default-ignore-revs) was merged into master in October 2026, and is part of the upcoming Git 2.98.0 release.

Developer Spotlight: Tian Yuchen

Editor’s note: This edition features a retrospective interview with a contributor who worked on Git through a mentoring program. We hope the reflections shared by the GSoC contributor will provide an insightful perspective that benefits the community. As always, we welcome your thoughts and feedback!

Other News

Events

Various

Light reading

Newsletters

Git tools and sites

Releases

Credits

This edition of Git Rev News was curated by Christian Couder <christian.couder@gmail.com>, Jakub Narębski <jnareb@gmail.com>, Markus Jansen <mja@jansen-preisler.de> and Kaartic Sivaraam <kaartic.sivaraam@gmail.com> with help from Tian Yuchen, Tom Demers, Raman Gupta, Shiqi Cao, porcelaintech, Luca Milanesio and Amaresh Pelleti.