public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Michael J Gruber <git@drmicha•warpmail.net>
Cc: git@vger•kernel.org, David Aguilar <davvid@gmail•com>
Subject: Re: [PATCH] mergetool-lib: fix default tool selection
Date: Fri, 19 Jun 2015 10:39:08 -0700	[thread overview]
Message-ID: <xmqqbngba98j.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <a9844fc48424d5caf27cc2189af3d9d867d01833.1434706187.git.git@drmicha.warpmail.net> (Michael J. Gruber's message of "Fri, 19 Jun 2015 11:30:55 +0200")

Michael J Gruber <git@drmicha•warpmail.net> writes:

> When no diff nor merge tool is specified (config, option), mergetool-lib
> is supposed to choose a default tool from a set of tools. That set is
> constructed dynamically depending on the environment (graphical, editor
> setting) as a space separated string of tool names.
>
> 719518f (mergetool--lib: set IFS for difftool and mergetool, 2015-05-20)
> introduced a newline as IFS which breaks the parsing of the space
> separated list into items, resulting in a failed search for an available
> tool.
>
> Set IFS to a space locally for the tool search.

I wondered where this "locally" is ensured; it turns out that this
shell function is supposed to be always called inside $() to return
its result via its standard output ;-)

So I think this change makes sense.

> Signed-off-by: Michael J Gruber <git@drmicha•warpmail.net>
> ---
>  git-mergetool--lib.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
> index 14b039d..54ac8e4 100644
> --- a/git-mergetool--lib.sh
> +++ b/git-mergetool--lib.sh
> @@ -305,6 +305,7 @@ guess_merge_tool () {
>  	EOF
>  
>  	# Loop over each candidate and stop when a valid merge tool is found.
> +	IFS=' '
>  	for tool in $tools
>  	do
>  		is_available "$tool" && echo "$tool" && return 0

      reply	other threads:[~2015-06-19 17:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-19  9:30 [PATCH] mergetool-lib: fix default tool selection Michael J Gruber
2015-06-19 17:39 ` 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=xmqqbngba98j.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=davvid@gmail$(echo .)com \
    --cc=git@drmicha$(echo .)warpmail.net \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox