Git development
 help / color / mirror / Atom feed
From: Ravi Mistry <rmistry@google.com>
To: phillip.wood@dunelm.org.uk
Cc: git@vger.kernel.org, gitster@pobox.com, gitgitgadget@gmail.com,
	 abhijeet040403@gmail.com, code@khaugsbakk.name,
	sunshine@sunshineco.com,  rmistry@google.com
Subject: Re: [PATCH v3 2/2] blame: ignore revs in HEAD:.git-blame-ignore-revs
Date: Mon, 12 Oct 2026 15:48:34 +0000	[thread overview]
Message-ID: <20261012154834.622130-1-rmistry@google.com> (raw)
In-Reply-To: <e3b68210-7558-4f95-bc3c-eb57b1065790@gmail.com>

Hi Phillip!

Phillip Wood <phillip.wood123@gmail.com> writes:

> 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.

> 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!

  reply	other threads:[~2026-10-12 15:48 UTC|newest]

Thread overview: 29+ 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-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 [this message]
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

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=20261012154834.622130-1-rmistry@google.com \
    --to=rmistry@google.com \
    --cc=abhijeet040403@gmail.com \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=phillip.wood@dunelm.org.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox