git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
JTJonathan 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
    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.

Previous: Paolo BonziniNext: Paolo Bonzini
Message 7 of 10 in “interpret-trailers: add --where, --if-exists, --if-missing”
  1. 0/3 interpret-trailers: add --where, --if-exists, --if-missingPaolo Bonzini, Jul 12, 2017
  2. 1/3 trailers: create struct trailer_optsPaolo Bonzini, Jul 12, 2017
  3. Jonathan TanJul 12, 2017
  4. 2/3 trailers: export action enums and corresponding lookup functionsPaolo Bonzini, Jul 12, 2017
  5. Jonathan TanJul 12, 2017
  6. 3/3 interpret-trailers: add options for actionsPaolo Bonzini, Jul 12, 2017
  7. Jonathan TanJul 12, 2017
  8. Paolo BonziniJul 12, 2017
  9. Christian CouderJul 12, 2017
  10. Paolo BonziniJul 12, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.