Re: [PATCH v2] config: Use parseopt.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 14, 2009, 20:19 UTC
- Message-ID
- <7viqncsreo.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.DEB.1.00.0902142041370.10279@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 12 quoted lines
>> + else if (given_config_file) {
>> + if (!is_absolute_path(given_config_file) && file)
>> + file = prefix_filename(file, strlen(file),
>> + given_config_file);
>> + else
>> + file = given_config_file;
>> + config_exclusive_filename = file;
>
> It took me a considerable amount of time to figure out that "file" is
> actually the "prefix"! That cleanup would be nice to have before the
> parseopt patch, methinks, especially since the code is reindented, and
> thus hard to follow in the diff.I noticed that "file" thing during my review of the first round. It probably was a cute attempt to avoid using two variables "prefix" and "file", but made the result a lot harder to read. I agree that a clean-up *before* code restructuring would be good for this particular wart.
A note that is off-topic to this patch.
I also noticed that the diff was impossible to read because it matched
the lines with only an indented close brace or whitespace between the
preimage and the postimage too aggressively. Your --patience did seem
to help a little bit, at least it produced a different result, but not
much (not that patience was meant to make this kind of change easier
to read). It may have helped if we had that "do not match trivial
lines too aggressively just to reduce the patch size" option.