git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Abhijeetsingh Meena via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Kristoffer Haugsbakk <code@khaugsbakk.name>,
	Phillip Wood <phillip.wood123@gmail.com>,
	Abhijeetsingh Meena <abhijeetsingh.github@gmail.com>,
	Abhijeetsingh Meena <abhijeet040403@gmail.com>
Subject: Re: [PATCH v2 1/2] blame: respect .git-blame-ignore-revs automatically
Date: Mon, 14 Oct 2024 17:08:48 -0400	[thread overview]
Message-ID: <Zw2IYMPsywFCN5Yj@nand.local> (raw)
In-Reply-To: <CAPig+cR4WbcDDav0cdXxOMC-EDe2ipWxEzB+0C7zbFjvY_kXtg@mail.gmail.com>

On Sat, Oct 12, 2024 at 02:07:36AM -0400, Eric Sunshine wrote:
> > diff --git a/builtin/blame.c b/builtin/blame.c
> > @@ -1105,6 +1105,14 @@ parse_done:
> > +       /*
> > +       * By default, add .git-blame-ignore-revs to the list of files
> > +       * containing revisions to ignore if it exists.
> > +       */
> > +       if (access(".git-blame-ignore-revs", F_OK) == 0) {
> > +               string_list_append(&ignore_revs_file_list, ".git-blame-ignore-revs");
> > +       }
>
> A couple style nits and a couple questions...
>
> nit: drop the braces around the one-line `if` body
>
> nit: this project uses `!foo(...)` rather than `foo(...) == 0`
>
> Presumably this consults ".git-blame-ignore-revs" in the top-level
> directory (as you intended) rather than ".git-blame-ignore-revs" in
> whatever subdirectory you happen to issue the command because the
> current-working-directory has already been set to the top-level
> directory by the time cmd_blame() has been called, right?
>
> But that leads to the next question. Should automatic consulting of
> ".git-blame-ignore-revs" be restricted to just the top-level
> directory, or should it be modeled after, say, ".gitignore" which may
> be strewn around project directories and in which ".gitignore" files
> are consulted rootward starting from the directory in which the
> command is invoked. My knee-jerk thought was that the ".gitignore"
> model may not make sense for ".git-blame-ignore-revs", but the fact
> that `git blame` can accept and work with multiple ignore-revs files
> makes me question that knee-jerk response.

All very good suggestions and questions for Abhijeetsingh to consider.

At a minimum, I think the style nits need to be addressed here. But I
also think it is worth considering seriously whether or not multiple
`.git-blame-ignore-revs` files should be considered, and if so, in what
order and how they override (or not) each other.

I am generally OK with adding one of these special files and having 'git
blame' respect it automatically. But once we do so, it is going to be
considered part of our compatibility guarantee, so we should get it
right the first time.

Thanks,
Taylor

  parent reply	other threads:[~2024-10-14 21:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  7:01 [PATCH] blame: respect .git-blame-ignore-revs automatically Abhijeetsingh Meena via GitGitGadget
2024-10-08  9:07 ` Kristoffer Haugsbakk
2024-10-08  9:51 ` Phillip Wood
     [not found] ` <pull.1809.v2.git.1728397437637.gitgitgadget@gmail.com>
     [not found]   ` <CAAirc3j2MfLyiNVnseRmTsDDu6R4gkcms1GXk=9_jAVLvEYaUg@mail.gmail.com>
     [not found]     ` <CAAirc3gX=PBixcyR0NRyRDnrydkeeu8A9or90c8MSUdHQ6uo=w@mail.gmail.com>
2024-10-08 16:12       ` [PREVIEW v2] " Abhijeetsingh Meena
2024-10-08 16:12         ` Abhijeetsingh Meena
2024-10-12  4:37 ` [PATCH v2 0/2] " Abhijeetsingh Meena via GitGitGadget
2024-10-12  4:37   ` [PATCH v2 1/2] " Abhijeetsingh Meena via GitGitGadget
2024-10-12  6:07     ` Eric Sunshine
2024-10-12  6:43       ` Eric Sunshine
2024-10-14 21:08       ` Taylor Blau [this message]
2024-10-16  6:04       ` Abhijeetsingh Meena
2024-10-12 13:58     ` Kristoffer Haugsbakk
2024-10-13 15:25       ` Phillip Wood
2024-10-14 21:00         ` Kristoffer Haugsbakk
2024-10-16  6:06       ` Abhijeetsingh Meena
2024-10-13 15:18     ` Phillip Wood
2024-10-16  6:07       ` Abhijeetsingh Meena
2024-10-22  6:49         ` Abhijeetsingh Meena
2024-10-22  7:54           ` Eric Sunshine
2024-10-12  4:37   ` [PATCH v2 2/2] blame: introduce --override-ignore-revs to bypass ignore revisions list Abhijeetsingh Meena via GitGitGadget
2024-10-12  6:24     ` Eric Sunshine
2024-10-12  6:26       ` Eric Sunshine
2024-10-12 14:25     ` Kristoffer Haugsbakk
2024-10-13 15:20     ` Phillip Wood

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=Zw2IYMPsywFCN5Yj@nand.local \
    --to=me@ttaylorr.com \
    --cc=abhijeet040403@gmail.com \
    --cc=abhijeetsingh.github@gmail.com \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=phillip.wood123@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).