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

Re: [PATCH v6 2/2] mergetools: add winmerge as a builtin tool

From
Junio C Hamano <gitster@pobox.com>
Date
May 20, 2015, 21:00 UTC
Message-ID
<xmqq8ucjm0bo.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHGBnuPyhG4y5ooR7KH0KrEhRYFu9BB+HKnnn+XhU5xL2TnL=w@mail.gmail.com>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 18 quoted lines
> On Wed, May 20, 2015 at 10:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> David Aguilar <davvid@gmail.com> 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.
>
> I did add the sort (and -u) by intention, to ensure that "C:\Program
> Files" (which is what %PROGRAMFILES% expands to by default) comes
> before "C:\Program Files (x86)" (which is what %PROGRAMFILES(X86)%
> expands to by default), so that programs of the OS-native bitness are
> preferred.

Yuck. So even though %PROGRAMFILES% and %PROGRAMFILES(X86)% look as if they are variables that can point at arbitrary places, they in reality don't? Otherwise %PROGRAMFILES% may point at D:\Program while %PROGRAMFILES(X86)% may piont at C:\X86 and the latter would sort before the former, which would defeat that "logic".

But of course if I view this not as a "logic" but as a "heuristics" that happens to do the right thing in common environments, it is perfectly OK ;-).

I've queued the patches as-is.
Thanks.
Previous: Sebastian SchuberthNext: Sebastian Schuberth
Message 9 of 11 in “mergetool--lib: set IFS for difftool and mergetool”
  1. 1/2 mergetool--lib: set IFS for difftool and mergetoolDavid Aguilar, May 20, 2015
  2. 2/2 mergetools: add winmerge as a builtin toolDavid Aguilar, May 20, 2015
  3. SZEDER GáborMay 20, 2015
  4. David AguilarMay 22, 2015
  5. Junio C HamanoMay 22, 2015
  6. David AguilarMay 22, 2015
  7. Junio C HamanoMay 20, 2015
  8. Sebastian SchuberthMay 20, 2015
  9. Junio C HamanoMay 20, 2015
  10. Sebastian SchuberthMay 20, 2015
  11. Johannes SchindelinMay 21, 2015

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.