From: Junio C Hamano <gitster@pobox.com>
To: "Ravi Mistry via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
Abhijeetsingh Meena <abhijeet040403@gmail.com>,
Kristoffer Haugsbakk <code@khaugsbakk.name>,
Phillip Wood <phillip.wood@dunelm.org.uk>,
Eric Sunshine <sunshine@sunshineco.com>,
Phillip Wood <phillip.wood123@gmail.com>,
Ravi Mistry <rmistry@google.com>
Subject: Re: [PATCH v5 0/2] blame: ignore revs in .git-blame-ignore-revs by default
Date: Tue, 13 Oct 2026 10:30:26 -0700 [thread overview]
Message-ID: <xmqq4iepzex9.fsf@gitster.g> (raw)
In-Reply-To: <pull.2224.v5.git.1791902175.gitgitgadget@gmail.com> (Ravi Mistry via GitGitGadget's message of "Tue, 13 Oct 2026 14:36:13 +0000")
"Ravi Mistry via GitGitGadget" <gitgitgadget@gmail.com> writes:
> + 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".
> ++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".
> @@ 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.
next prev parent reply other threads:[~2026-10-13 17:30 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-11 23:29 [PATCH] blame: default to ignoring revisions in .git-blame-ignore-revs Ravi Mistry via GitGitGadget
2026-09-30 14:59 ` Ravi Mistry
2026-10-05 15:37 ` Junio C Hamano
2026-10-05 21:12 ` Ravi Mistry
2026-10-07 17:43 ` Junio C Hamano
2026-10-07 18:07 ` Ravi Mistry
2026-10-08 21:07 ` [PATCH v2 0/2] blame: ignore revs in HEAD:.git-blame-ignore-revs by default Ravi Mistry via GitGitGadget
2026-10-08 21:07 ` [PATCH v2 1/2] blame: harden ignore-revs parser and tag peeling Ravi Mistry via GitGitGadget
2026-10-09 5:07 ` Junio C Hamano
2026-10-10 19:25 ` Ravi Mistry
2026-10-08 21:07 ` [PATCH v2 2/2] blame: ignore revs in HEAD:.git-blame-ignore-revs Ravi Mistry via GitGitGadget
2026-10-09 20:17 ` Junio C Hamano
2026-10-10 6:12 ` Eric Sunshine
2026-10-10 18:40 ` Ravi Mistry
2026-10-11 18:58 ` Junio C Hamano
2026-10-11 22:29 ` Ravi Mistry
2026-10-11 23:07 ` Junio C Hamano
2026-10-12 9:13 ` Phillip Wood
2026-10-12 16:38 ` Junio C Hamano
2026-10-12 19:21 ` Ravi Mistry
2026-10-12 21:13 ` Junio C Hamano
2026-10-13 14:48 ` Ravi Mistry
2026-10-11 22:21 ` [PATCH v3 0/2] blame: ignore revs in HEAD:.git-blame-ignore-revs by default Ravi Mistry via GitGitGadget
2026-10-11 22:21 ` [PATCH v3 1/2] blame: harden ignore-revs parser and tag peeling Ravi Mistry via GitGitGadget
2026-10-11 22:21 ` [PATCH v3 2/2] blame: ignore revs in HEAD:.git-blame-ignore-revs Ravi Mistry via GitGitGadget
2026-10-12 9:10 ` Phillip Wood
2026-10-12 15:48 ` Ravi Mistry
2026-10-12 19:17 ` [PATCH v4 0/2] blame: ignore revs in HEAD:.git-blame-ignore-revs by default Ravi Mistry via GitGitGadget
2026-10-12 19:17 ` [PATCH v4 1/2] blame: harden ignore-revs parser and tag peeling Ravi Mistry via GitGitGadget
2026-10-12 19:17 ` [PATCH v4 2/2] blame: ignore revs in HEAD:.git-blame-ignore-revs Ravi Mistry via GitGitGadget
2026-10-13 14:36 ` [PATCH v5 0/2] blame: ignore revs in .git-blame-ignore-revs by default Ravi Mistry via GitGitGadget
2026-10-13 14:36 ` [PATCH v5 1/2] blame: harden ignore-revs parser and tag peeling Ravi Mistry via GitGitGadget
2026-10-13 14:36 ` [PATCH v5 2/2] blame: ignore revs in .git-blame-ignore-revs by default Ravi Mistry via GitGitGadget
2026-10-13 17:30 ` Junio C Hamano [this message]
2026-10-13 20:24 ` [PATCH v5 0/2] " Ravi Mistry
2026-10-13 20:39 ` Junio C Hamano
2026-10-13 20:22 ` [PATCH v6 " Ravi Mistry via GitGitGadget
2026-10-13 20:22 ` [PATCH v6 1/2] blame: harden ignore-revs parser and tag peeling Ravi Mistry via GitGitGadget
2026-10-13 20:22 ` [PATCH v6 2/2] blame: ignore revs in .git-blame-ignore-revs by default Ravi Mistry via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4iepzex9.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=abhijeet040403@gmail.com \
--cc=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=phillip.wood123@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=rmistry@google.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.