Re: [PATCH] fsck: reject misconfigured fsck.skipList
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 7, 2025, 17:21 UTC
- Message-ID
- <xmqqttaatu8h.fsf@gitster.g>
- In-Reply-To
- <20250107162914.3756968-2-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
Show 13 quoted lines
> In Git, fsck operations can ignore known broken objects via the > `fsck.skipList` configuration. This option expects a path to a file with > the list of object names. When the configuration is specified without a > path, an error message is printed, but the command continues as if the > configuration was not set. Configuring `fsck.skipList` without a value > is a misconfiguration so config parsing should be more strict and reject > it. > > Update `git_fsck_config()` to no longer ignore misconfiguration of > `fsck.skipList`. The same behavior is also present for > `fetch.fsck.skipList` and `receive.fsck.skipList` so the configuration > parsers for these are updated to ensure the related operations remain > consistent.
If the value is missing, i.e.,
[fsck] skipList
it is a very clear misconfiguration. "We expect a path, but you gave me a valueless true". Once a specified value gets to oidset_parse_file(), we would die when a specified path cannot be opened, so it is not like we want to deliberately tolerate misconfiguration (we also die if the value is given as "~t/sl" and user "t" does not exist on the system).
Makes sense.