All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] merge: support --strategy '?' for git-completion.bash
Date: Fri, 26 Jan 2018 09:47:40 -0800	[thread overview]
Message-ID: <xmqqefmc8qbn.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20180126013142.GA11346@duynguyen.dek-tpc.internal> (Duy Nguyen's message of "Fri, 26 Jan 2018 08:31:42 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> I didn't look carefully at those sed magic. But it looks like it
> correctly handles this case too. So v2 follows below. It still feels
> dirty to do this kind of text manipulation though. But that can wait.

I do like "introduce and use helper feature to produce machine
parseable text" when it is appropriate.  But this alternative looks
more in line with the current design of completion script and can
easily be a maint material as pure bugfix for non C locale folks.

Will queue.

> -- 8< --
> Subject: [PATCH] completion: fix completing merge strategies on non-C locales
>
> The anchor string "Available strategies are:" is translatable so
> __git_list_merge_strategies may fail to collect available strategies
> from 'git merge' on non-C locales. Force C locale on this command.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---


>  contrib/completion/git-completion.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 3683c772c5..88813e9124 100644
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -594,7 +594,7 @@ __git_is_configured_remote ()
>  
>  __git_list_merge_strategies ()
>  {
> -	git merge -s help 2>&1 |
> +	LANG=C LC_ALL=C git merge -s help 2>&1 |
>  	sed -n -e '/[Aa]vailable strategies are: /,/^$/{
>  		s/\.$//
>  		s/.*://

      reply	other threads:[~2018-01-26 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25  9:40 [PATCH] merge: support --strategy '?' for git-completion.bash Nguyễn Thái Ngọc Duy
2018-01-25 18:49 ` Junio C Hamano
2018-01-26  1:31   ` Duy Nguyen
2018-01-26 17:47     ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqefmc8qbn.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.