Re: [PATCH 0/1] blame: Skip missing ignore-revs file
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 7, 2021, 20:58 UTC
- Message-ID
- <xmqqr1f5hszw.fsf@gitster.g>
- In-Reply-To
- <20210807202752.1278672-1-noah.pendleton@gmail.com>
Noah Pendleton <noah.pendleton@gmail.com> writes:
> Setting a global `blame.ignoreRevsFile` can be convenient, since I > usually use `.git-blame-ignore-revs` in repos. If the file is missing, > though, `git blame` exits with failure. This patch changes it to skip > over non-existent ignore-rev files instead of erroring.
That cuts both ways, though. Failing upon missing configuration file is a way to catch misconfiguration that is hard to diagnose.
I wonder if we can easily learn where the configuration variable came from in the codepath that diagnoses it as a misconfiguration.
If it came from a per-repo configuration and names a non-existent file, it clearly is a misconfiguration that we want to flag as an error. Even if it came from a per-user configuration, if it was specified in a conditionally included file, it is likely to be a misconfiguration. If it came from a per-user configuration that applies without any condition, it can be a good convenience feature to silently (or with a warning) ignore missing file.