Re: [PATCH 3/3] interpret-trailers: add options for actions
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Jul 12, 2017, 21:10 UTC
- Message-ID
- <20170712141028.2d6beecc@twelve2.svl.corp.google.com>
- In-Reply-To
- <20170712134646.17179-4-bonzini@gnu.org>
On Wed, 12 Jul 2017 15:46:46 +0200 Paolo Bonzini <bonzini@gnu.org> wrote:
Show 10 quoted lines
> +static int option_parse_where(const struct option *opt,
> + const char *arg, int unset)
> +{
> + enum action_where *where = opt->value;
> +
> + if (unset)
> + return 0;
> +
> + return set_where(where, arg);
> +}This means that we have the following:
$ cat message
Helloa: a
$ ./git interpret-trailers --trailer a=b message
Hello a: a
a: b $ ./git interpret-trailers --where start --no-where --trailer a=b message
Hello a: b
a: aWhen I would expect the last 2 commands to produce the same output. Maybe invoke set_where(where, NULL) when "unset" is true? And change set_where() accordingly. Same for the other two option parsing functions.