Re: [PATCH v2 2/3] config: let sequence require a successful file
- From
- Delilah Ashley Wu <delilahwu@linux.microsoft.com>
- Date
- Oct 9, 2026, 09:11 UTC
- Message-ID
- <asivbJyLJ3QbehBf-delilahwu@linux.microsoft.com>
- In-Reply-To
- <xmqqy0dsg2vt.fsf@gitster.g>
On Wed, Aug 26, 2026 at 11:20:22AM +1000, Junio C Hamano wrote:
Show 13 quoted lines
> Delilah Ashley Wu <delilahwu@linux.microsoft.com> writes:
>> From: Delilah Ashley Wu <delilahwu@microsoft.com>
>> +static void attempt_git_config_from_file_with_options(config_fn_t fn,
>> [...]
>> static int do_git_config_sequence(const struct config_options *opts,
>> + const struct repository *repo, config_fn_t fn,
>> + void *data, int require_successful_config)
>> {
>> int ret = 0;
>> + int success_count = 0;
>
> I am not convinced 100% that we need "success_count", either, until
> we see how it is used in the later steps.Good point!! I realised that v2 overcomplicated the error handling. We want to let `do_git_config_sequence()` optionally bail when both global configuration files could not be read. We can simply set a boolean flag when a global configuration file is successfully read, rather than adding a helper function that tracks the number of successful reads. I've corrected this in v3.