git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: jade via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, jade <software@lfcode.ca>
Subject: Re: [PATCH] builtin/blame: ignore nonexistent ignore files
Date: Sun, 20 Apr 2025 01:35:58 -0400	[thread overview]
Message-ID: <CAPig+cT1BNXRotrz=rnVgvhQjZZwYgsAOQMonHFFTPfK-C0LOQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqo6wr95r6.fsf@gitster.g>

On Sat, Apr 19, 2025 at 5:54 PM Junio C Hamano <gitster@pobox.com> wrote:
> "jade via GitGitGadget" <gitgitgadget@gmail.com> writes:
> > It's currently a problem to put blame.ignoreRevsFile in a global
> > gitconfig, for example, to use the GitHub (and other) supported filename
> > of .git-blame-ignore-revs by default if present in a repo, since the
> > current implementation exits the process if it fails to open the file.
>
> An alternative design that goes along the following lines may be
> more palatable:
>
>  - The way to spell for the users to specify a path that is
>    optional, either as the value of a command line option or a
>    configuration variable, is to prefix it with ":(optional)".  E.g.
>
>     [blame]
>         ignoreRevsFile = ":(optional).git-blame-ignore"
>
>     $ git blame --ignore-revs-file=":(optional).git-blame-ignore"
>
>  - For command line options, all commands that use parse-options API
>    would automatically benefit by updating parse-options.c and tweak
>    its handling of OPTION_FILENAME; when the specified string begins
>    with ":(optional)", you strip the prefix and see if the remainder
>    or the string names an existing file.  If it does, you use the
>    filename as the value of that command line option; otherwise you
>    pretend that the option didn't even exist on the command line.

For what it's worth, an initial implementation of ":(optional)"
exists[*]. It was eventually dropped from Junio's "seen" branch merely
because it never received any reviews, not due to any particular
problem with it.

[*]: https://lore.kernel.org/git/20241014204427.1712182-1-gitster@pobox.com/

      reply	other threads:[~2025-04-20  5:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-19 18:43 [PATCH] builtin/blame: ignore nonexistent ignore files jade via GitGitGadget
2025-04-19 21:54 ` Junio C Hamano
2025-04-20  5:35   ` Eric Sunshine [this message]

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='CAPig+cT1BNXRotrz=rnVgvhQjZZwYgsAOQMonHFFTPfK-C0LOQ@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=software@lfcode.ca \
    /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).