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

Re: [PATCH v5 0/2] blame: ignore revs in .git-blame-ignore-revs by default

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2026, 17:30 UTC
Message-ID
<xmqq4iepzex9.fsf@gitster.g>
In-Reply-To
<pull.2224.v5.git.1791902175.gitgitgadget@gmail.com>
"Ravi Mistry via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 7 quoted lines
>      +    tree when a working tree is available and fall back to the
>      +    HEAD:.git-blame-ignore-revs blob in bare repositories. Reading from the
>      +    working tree in non-bare repositories makes it ergonomic to prepare a
>      +    new .git-blame-ignore-revs file or add revisions to an existing one and
>      +    immediately test the effect with git-blame(1) before committing, while
>      +    falling back to HEAD:.git-blame-ignore-revs allows bare repositories to
>      +    respect the committed ignore list as well.
Very well written justification.
>      ++	processed after the default `.git-blame-ignore-revs` file at the root of
>      ++	the working tree (or `HEAD:.git-blame-ignore-revs` in a bare repository),
>      ++	if it exists, and any files specified with the `blame.ignoreRevsFile`
Good.  A bit more comment on this later.
>      ++	config option.  An empty file name, `""`, or `--no-ignore-revs-file` will
That's "a configuration variable".
Show 7 quoted lines
>      ++static void parse_default_ignore_revs(struct blame_scoreboard *sb)
>      ++{
>      ++	if (repo_get_work_tree(sb->repo))
>      ++		parse_default_ignore_revs_file(sb, ".git-blame-ignore-revs");
>      ++	else
>      ++		parse_default_ignore_revs_blob(sb, "HEAD:.git-blame-ignore-revs");
>      ++}

Here, HEAD:.git-blame-ignore-revs is used only in bare repositories so that those working in a working tree of the project and on a revision with a committed ignore-revs file can remove it from the working tree, verify the behaviour of "git blame" to test before committing the removal, if they no longer want to use the committed ignore-revs list. Which is great. We do not want to say "we have a working tree, we do not have the file there, fall back to HEAD".

Show 6 quoted lines
>      @@ builtin/blame.c: int cmd_blame(int argc,
>        
>        	setup_default_color_by_age();
>       +	string_list_append(&ignore_revs_file_list,
>      -+			   "HEAD:.git-blame-ignore-revs")->util = &sb;
>      ++			   ".git-blame-ignore-revs")->util = &sb;

Hmph, build_ignorelist() ignores the string and only pays attention to the fact that the string_list_item having a non-null .util member, so this diff, and the fact that a specific string is on the list, is a bit misleading in two ways (i.e., the string itself does not matter, and the value of .util member does not metter, either).

In other words, a cute hack like this
		string_list_append(&ignore_revs_file_list,
                		   "<builtin default>")->util =
                                   "see build_ignorelist()";
may still give us the same behaviour, which is *horrible*.
It probably deserves a comment to help future readers, e.g.
		/*
		 * An entry with non-NULL .util member adds the
		 *  .git-blame-ignore-revs at the project root;
                 * see build_ignorelist()
		 */
                string_list_append(&ignore_revs_file_list,
                                   ".git-blame-ignore-revs")->util = &sb;

or something? It is especially misleading to pass &sb here because it is not used as a scoreboard at all anywhere.

Thanks.
Previous: Ravi Mistry via GitGitGadgetNext: Ravi Mistry
Message 34 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.