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

Re: [PATCH] completion: clear cached --options when sourcing the completion script

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Mar 23, 2018, 15:14 UTC
Message-ID
<CAM0VKjm3WKkxjEN09Dv1wUnuBf8CSsUvmLjmSVb1fbHTyAdXEQ@mail.gmail.com>
In-Reply-To
<20180322141604.15957-1-szeder.dev@gmail.com>
On Thu, Mar 22, 2018 at 3:16 PM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
> Add tests to ensure that these variables are indeed cleared when the
> completion script is sourced; not just the variables caching options,
> but all other caching variables, i.e. the variables caching commands,
> porcelain commands and merge strategies as well.
Show 6 quoted lines
> +test_expect_success 'sourcing the completion script clears cached merge strategies' '
> +       __git_compute_merge_strategies &&
> +       verbose test -n "$__git_merge_strategies" &&
> +       . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" &&
> +       verbose test -z "$__git_merge_strategies"
> +'
Hang on, this test fails in the GETTEXT_POISON build.

The thing is, we get the merge strategies with this piece of code in __git_list_merge_strategies() in master:

    LANG=C LC_ALL=C git merge -s help 2>&1 |
    sed -n -e '/[Aa]vailable strategies are: /,/^$/{
        # a couple of s/// commands
    }'

and that '/[Aa]vailable strategies are: /' won't match in a GETTEXT_POISON-ed output, because that string is translated.

I think for now (-rc phase) we should just drop this test, and in the future we should consider adding a 'git merge --list-strategies' option.

Previous: Duy NguyenNext: Junio C Hamano
Message 3 of 6 in “completion: clear cached --options when sourcing the completion script”
  1. completion: clear cached --options when sourcing the completion scriptSZEDER Gábor, Mar 22, 2018
  2. Duy NguyenMar 22, 2018
  3. SZEDER GáborMar 23, 2018
  4. Junio C HamanoMar 23, 2018
  5. Junio C HamanoMar 23, 2018
  6. SZEDER GáborMar 26, 2018

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.