Thread (10 messages) flat view 10 messages, 4 authors, 2017-07-12

Re: [PATCH 3/3] interpret-trailers: add options for actions

From: Jonathan Tan <hidden>
Date: 2017-07-12 21:10:36

On Wed, 12 Jul 2017 15:46:46 +0200
Paolo Bonzini [off-list ref] wrote:
+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
    Hello

    a: 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: a

When 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help