From: Junio C Hamano Date: Wed, 20 May 2015 20:13:15 GMT Subject: Re: [PATCH v6 2/2] mergetools: add winmerge as a builtin tool Message-ID: In-Reply-To: <1432112843-973-2-git-send-email-davvid@gmail.com> David Aguilar writes: > + for directory in $(env | grep -Ei '^PROGRAM(FILES(\(X86\))?|W6432)=' | > + cut -d '=' -f 2- | sort -u) Is the final "sort" really desired? I am wondering if there are fixed precedence/preference order among variants of %PROGRAMFILES% environment variables that the users on the platform are expected to stick to, but the "sort" is sorting by the absolute pathnames of where these things are, which may not reflect that order. Not that I personally care too deeply, as I would expect that it is likely any one of them found would just work fine ;-) > + do > + if test -n "$directory" && test -x "$directory/$winmerge_exe" > + then > + printf '%s' "$directory/$winmerge_exe" > + return > + fi > + done > + > + printf WinMergeU.exe > +}