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

Re: [PATCH 1/4] parse-options: convert "command mode" to a flag

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 19, 2020, 19:11 UTC
Message-ID
<CAPig+cQkBKJLW3-W4SS0KX9+Gs2fT-Z-DrvVpcVOLZpFmVBoQA@mail.gmail.com>
In-Reply-To
<20200219161352.13562-2-pbonzini@redhat.com>
On Wed, Feb 19, 2020 at 11:15 AM <pbonzini@redhat.com> wrote:
Show 15 quoted lines
> OPTION_CMDMODE is essentially OPTION_SET_INT plus the extra check
> that the variable had not set before.  In order to allow custom
> processing, change it to OPTION_SET_INT plus a new flag that takes
> care of the check.  This works as long as the option value points
> to an int.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
> @@ -324,6 +326,22 @@ test_expect_success 'OPT_NEGBIT() works' '
> +test_expect_success 'OPT_CMDMODE() detects incompatibility' '
> +       test_must_fail test-tool parse-options --mode1 --mode2 >output 2>output.err &&
> +       test_must_be_empty output &&
> +       grep "incompatible with --mode" output.err
> +'

The error message may have been localized, so use test_i18ngrep() instead of 'grep':

    test_i18ngrep "incompatible with --mode" output.err
Show 6 quoted lines
> +
> +test_expect_success 'OPT_CMDMODE() detects incompatibility with something else' '
> +       test_must_fail test-tool parse-options --set23 --mode2 >output 2>output.err &&
> +       test_must_be_empty output &&
> +       grep "incompatible with something else" output.err
> +'
Ditto.
Previous: pbonzini@redhat.comNext: Johannes Schindelin
Message 3 of 15 in “am: provide a replacement for "cat .git/rebase-apply/patch"”
  1. 0/4 am: provide a replacement for "cat .git/rebase-apply/patch"pbonzini@redhat.com, Feb 19, 2020
  2. 1/4 parse-options: convert "command mode" to a flagpbonzini@redhat.com, Feb 19, 2020
  3. Eric SunshineFeb 19, 2020
  4. Johannes SchindelinFeb 20, 2020
  5. Junio C HamanoFeb 19, 2020
  6. Paolo BonziniFeb 19, 2020
  7. 2/4 am: convert "resume" variable to a structpbonzini@redhat.com, Feb 19, 2020
  8. Junio C HamanoFeb 19, 2020
  9. Paolo BonziniFeb 19, 2020
  10. 3/4 am: support --show-current-patch=raw as a synonym for--show-current-patchpbonzini@redhat.com, Feb 19, 2020
  11. Eric SunshineFeb 19, 2020
  12. Junio C HamanoFeb 19, 2020
  13. Paolo BonziniFeb 19, 2020
  14. 4/4 am: support --show-current-patch=diff to retrieve .git/rebase-apply/patchpbonzini@redhat.com, Feb 19, 2020
  15. Eric SunshineFeb 19, 2020

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.