git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Schuberth <sschuberth@gmail.com>
To: David Aguilar <davvid@gmail.com>, Phil Susi <phillsusi@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Cc: Philip Oakley <philipoakley@iee.org>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] mergetools: add winmerge as a builtin tool
Date: Wed, 13 May 2015 15:19:10 +0200	[thread overview]
Message-ID: <55534F4E.60402@gmail.com> (raw)
In-Reply-To: <1431482407-63642-1-git-send-email-davvid@gmail.com>

On 13.05.2015 04:00, David Aguilar wrote:

> +	if test -n "$ProgramW6432" && test -x "$ProgramW6432/$winmerge_exe"
> +	then
> +		printf '%s' "$ProgramW6432/$winmerge_exe"

I don't think it makes sense to check "$ProgramW6432". The content of 
that variable depends on the bitness of the process requesting the 
environment. Just checking "$PROGRAMFILES" and "$PROGRAMFILES(X86)" 
should be sufficient and more clear.

Also, note that you should use all upper case names when referring to 
Windows environment variables. While it's true that on plain Windows 
environment variable names are case-insensitive, MSYS1/2 converts all 
variable names to upper case and *is* case sensitive. I.e. while "echo 
$PROGRAMFILES" works as expected from a Git Bash on Windows, "echo 
$ProgramFiles" results in an empty string.

 > +	elif test -x "/c/Program Files (x86)/$winmerge_exe"
 > +	then
 > +		printf '%s' "/c/Program Files (x86)/$winmerge_exe"
 > +	elif test -x "/c/Program Files/$winmerge_exe"
 > +	then
 > +		printf '%s' "/c/Program Files/$winmerge_exe"

I also think these fallbacks can simply go away. It is *very* unlikely 
that "$PROGRAMFILES" / "$PROGRAMFILES(X86)" point to something else but 
WinMerge still is installed there.

-- 
Sebastian Schuberth

  parent reply	other threads:[~2015-05-13 13:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  2:00 [PATCH v2] mergetools: add winmerge as a builtin tool David Aguilar
2015-05-13  8:10 ` Johannes Schindelin
2015-05-13 13:19 ` Sebastian Schuberth [this message]
2015-05-13 15:22   ` Johannes Schindelin
2015-05-13 15:33     ` Sebastian Schuberth
2015-05-13 20:00       ` Sebastian Schuberth
2015-05-13 20:36         ` Sebastian Schuberth
2015-05-13 20:37           ` Sebastian Schuberth
2015-05-14 21:48             ` SZEDER Gábor
2015-05-15  5:46               ` Sebastian Schuberth
2015-05-15  9:01                 ` SZEDER Gábor
2015-05-14 21:24       ` SZEDER Gábor
2015-05-15  5:40         ` Sebastian Schuberth
2015-05-20  4:10           ` David Aguilar

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=55534F4E.60402@gmail.com \
    --to=sschuberth@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=philipoakley@iee.org \
    --cc=phillsusi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).