From: Junio C Hamano <gitster@pobox.com>
To: Noah Pendleton <noah.pendleton@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/1] blame: Skip missing ignore-revs file
Date: Sun, 08 Aug 2021 10:50:14 -0700 [thread overview]
Message-ID: <xmqqim0fhlm1.fsf@gitster.g> (raw)
In-Reply-To: <xmqqtuk0h4ph.fsf@gitster.g> (Junio C. Hamano's message of "Sat, 07 Aug 2021 22:43:06 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> I think an easier way out is to introduce a new configuration
> variable blame.ignoreRevsFileIsOptional which takes a boolean value,
> and when it is set to true, silently ignore when the named file does
> not exist without any warning. When the variable is set to false
> (or the variable does not exist), we can keep the current behaviour
> of noticing a misconfigured blame.ignoreRevsFile and error out.
>
> That way, the current users who rely on the typo detection feature
> can keep relying on it, and those who want to make it optional can
> do so without getting annoyed by a warning.
A bit more ambitious might want to consider another more generally
applicable avenue, which would help the userbase a lot more, before
continuing.
We start from the realization that this is not the only
configuration variable that specifies a filename that could be
missing. There may be other variables that name files to be used
("git config --help" would hopefully be the most comprehensive, but
"git grep -e git_config_pathname \*.c" would give us quicker
starting point to gauge how big an impact to the system we would be
talking about).
What do the codepaths that use these variables do when they find
that the named files are missing? Do some of them die, some
others just warn, and yet some others silently ignore? Would such
an inconsistency hurt our users?
Among the ones that die, are there ones that could reasonably
continue as if the configuration variable weren't there and no file
was specified (i.e. similar to what you want blame.ignoreRevsFile to
do)? Among the ones that are silently ignored, are there ones that
may benefit by having a typo-detection? Do all of them benefit if
the behaviour upon missing files can be configurable by the end-user?
Depending on the answers to the above questions, it might be that it
is not a desirable approach to add "blame.ignoreRevsFileIsOptional"
configuration variable, as all the existing configuration variables
that name files would want to add their own. We might be better off
inventing a syntax for the value of blame.ignoreRevsFile (and other
variables that name files) to mark if the file is optional (i.e.
silently ignore if the named file does not exist) or required (i.e.
diagnose as a configuration error). For example, we may borrow from
the "magic" syntax for pathspecs that begin with ":(", with comma
separated "magic" keywords and ends with ")" and specify optional
pathname configuration like so:
[blame] ignoreRevsFile = :(optional).gitignorerevs
and teach the config parser to pretend as if it saw nothing when it
notices that the named file is missing. That approach would cover
not just this single variable, but other variables that are parsed
using git_config_pathname() may benefit the same way (of course, the
callsites for git_config_pathmame() must be inspected and adjusted
for this to happen).
Thanks.
next prev parent reply other threads:[~2021-08-08 17:50 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-07 20:27 [PATCH 0/1] blame: Skip missing ignore-revs file Noah Pendleton
2021-08-07 20:58 ` Junio C Hamano
2021-08-07 21:34 ` Noah Pendleton
2021-08-08 5:43 ` Junio C Hamano
2021-08-08 17:50 ` Junio C Hamano [this message]
2021-08-08 18:21 ` Noah Pendleton
2021-08-09 15:47 ` Junio C Hamano
2024-10-14 20:44 ` [PATCH 0/3] specifying a file that can optionally exist Junio C Hamano
2024-10-14 20:44 ` [PATCH 1/3] t7500: make each piece more independent Junio C Hamano
2024-10-14 20:44 ` [PATCH 2/3] config: values of pathname type can be prefixed with :(optional) Junio C Hamano
2024-10-14 20:44 ` [PATCH 3/3] parseopt: " Junio C Hamano
2025-05-01 21:40 ` [PATCH 0/3] specifying a file that can optionally exist Junio C Hamano
2025-05-01 21:40 ` [PATCH 1/3] t7500: make each piece more independent Junio C Hamano
2025-05-01 21:40 ` [PATCH 2/3] config: values of pathname type can be prefixed with :(optional) Junio C Hamano
2025-05-02 8:52 ` Patrick Steinhardt
2025-05-02 14:28 ` Phillip Wood
2025-05-02 20:05 ` Junio C Hamano
2025-05-01 21:40 ` [PATCH 3/3] parseopt: " Junio C Hamano
2025-09-28 21:29 ` [PATCH v2 0/3] Support :(optional) filepaths D. Ben Knoble
2025-09-28 21:29 ` [PATCH v2 1/3] t7500: make each piece more independent D. Ben Knoble
2025-09-28 21:29 ` [PATCH v2 2/3] config: values of pathname type can be prefixed with :(optional) D. Ben Knoble
2025-09-30 15:26 ` Phillip Wood
2025-10-06 19:00 ` Junio C Hamano
2025-10-06 19:59 ` Junio C Hamano
2025-10-06 20:21 ` Junio C Hamano
2025-10-06 20:22 ` Junio C Hamano
2025-10-07 12:24 ` Kristoffer Haugsbakk
2025-10-07 17:04 ` Junio C Hamano
2025-11-02 16:20 ` D. Ben Knoble
2025-09-28 21:29 ` [PATCH v2 3/3] parseopt: " D. Ben Knoble
2025-09-30 15:26 ` Phillip Wood
2025-11-02 16:20 ` D. Ben Knoble
2025-11-03 0:10 ` Eric Sunshine
2025-11-04 18:22 ` D. Ben Knoble
2025-09-28 22:40 ` [PATCH v2 0/3] Support :(optional) filepaths Junio C Hamano
2025-09-29 16:42 ` Ben Knoble
2025-10-20 9:40 ` [PATCH] t7500: fix tests with absolute path following ":(optional)" on Windows Johannes Sixt
2025-10-20 13:43 ` Ben Knoble
2025-10-20 17:32 ` Johannes Sixt
2025-10-20 18:06 ` Junio C Hamano
2025-10-20 20:27 ` D. Ben Knoble
2025-10-20 20:27 ` D. Ben Knoble
2025-10-20 17:39 ` Eric Sunshine
2025-10-20 16:17 ` Junio C Hamano
2025-10-20 17:24 ` Johannes Sixt
2022-03-04 9:51 ` [PATCH 0/1] blame: Skip missing ignore-revs file Thranur Andul
2021-08-08 17:48 ` [PATCH v2] blame: add config `blame.ignoreRevsFileIsOptional` Noah Pendleton
-- strict thread matches above, loose matches on Subject: below --
2021-08-07 20:29 [PATCH 0/1] blame: Skip missing ignore-revs file Noah Pendleton
2025-04-25 18:41 Feature request: automatically read .git-blame-ignore-revs or allow global optional config Michael Grosser
2025-04-25 19:54 ` Eric Sunshine
2025-05-01 18:00 ` D. Ben Knoble
2025-05-01 18:28 ` Eric Sunshine
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=xmqqim0fhlm1.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=noah.pendleton@gmail.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.