Re: [PATCH] Add the diff option --no-defaults
- From
Keith Cascio <keith@cs.ucla.edu>
- Date
- Apr 18, 2009, 16:41 UTC
- Message-ID
- <alpine.GSO.2.00.0904180930390.16775@kiwi.cs.ucla.edu>
- In-Reply-To
- <alpine.DEB.1.00.0904171514440.6675@intel-tinevez-2-302>
Dscho,
On Fri, 17 Apr 2009, Johannes Schindelin wrote:
Show 5 quoted lines
> Besides, you still will have a poison: > > git config diff.defaultOptions --no-defaults > > which is Russel's paradoxon right there.
I can cleanly modify my v3 to handle this case. In diff_setup_done(), change this:
+ if (DIFF_OPT_TST(options, ALLOW_DEFAULT_OPTIONS)) + flatten_diff_options(options, defaults ? defaults : + parse_diff_defaults(diff_setup(defaults = + xmalloc(sizeof(struct diff_options)))));
to this:
+ if (DIFF_OPT_TST(options, ALLOW_DEFAULT_OPTIONS) && (defaults || + parse_diff_defaults(diff_setup(defaults = xmalloc( + sizeof(struct diff_options))))) && DIFF_OPT_TST( + defaults, ALLOW_DEFAULT_OPTIONS)) + flatten_diff_options(options, + defaults);
All I did there was add the test DIFF_OPT_TST(defaults, ALLOW_DEFAULT_OPTIONS)
to the condition that controls whether to perform the flattening. Clean and
clear.
-- Keith