On Fri, May 10, 2013 at 11:10 AM, Michael J Gruber
<g...@drmicha.warpmail.net> wrote:
> From: Junio C Hamano <gits...@pobox.com>
> The diff_opt infrastructure sets flags based on defaults and command
> line options. Currently, it is impossible to detect whether a flag has
> been set as a default or on explicit request.
> Amend the structure so that this detection is possible:
>  * There is an extra "opt->touched_flags" that keeps track of all
>    the fields that have been touched by DIFF_OPT_SET and
>  * You may continue setting the default values to the flags, like
>    commands in the "log" family do in cmd_log_init_defaults(), but
>    after you finished setting the defaults, you clear the
>    touched_flags field;
>  * And then you let the usual callchain call diff_opt_parse(),
>    allowing the opt->flags be set or unset, while keeping track of
>    which bits the user touched;
>  * There is an optional callback "opt->set_default" that is called
>    at the very beginning to lets you inspect touched_flags and


>    update opt->flags appropriately, before the remainder of the
>    diffcore machinery is set up, taking the opt->flags value into
>    account.
> Signed-off-by: Michael J Gruber <g...@drmicha.warpmail.net>
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to