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

Re: [PATCH v2] mergetools: add winmerge as a builtin tool

From
Sebastian Schuberth <sschuberth@gmail.com>
Date
May 13, 2015, 20:36 UTC
Message-ID
<5553B5BF.7040408@gmail.com>
In-Reply-To
<5553AD43.9010807@gmail.com>
On 13.05.2015 22:00, Sebastian Schuberth wrote:
Show 11 quoted lines
> So how about something like this which hopefully covers all cases (including case-sensitivity issues regarding environment variable names and the problem of querying a variable that contains parentheses as part of its name):
> 
> for directory in "$(env | sed -nr 's/^PROGRAM(FILES(\(X86\))?|W6432)=//pI')"
> do
>      test -n "$directory" &&
>      test -x "$directory/$winmerge_exe" &&
>      echo "$directory/$winmerge_exe" &&
>      break
> done
> 
> sed's "I" seems to be a GNU extension that's not available with OS X' BSD sed. This shouldn't be an issue as WinMerge is Windows only anyway. If it still turns out to be an issue we probably should come up with an equivalent Perl expression.
Or even better, as that does not rely on GNU sed, sorts matches so that "C:\Program Files" for sure comes before "C:\Program Files (x86)" and removes any duplicates:
for directory in "$(env | grep -E '^PROGRAM(FILES(\(X86\))?|W6432)=' | cut -d '=' -f 2 | sort -u)"
do
     test -n "$directory" &&
     test -x "$directory/$winmerge_exe" &&
     echo "$directory/$winmerge_exe" &&
     break
done
-- 
Sebastian Schuberth
Previous: Sebastian SchuberthNext: Sebastian Schuberth
Message 7 of 14 in “mergetools: add winmerge as a builtin tool”
  1. mergetools: add winmerge as a builtin toolDavid Aguilar, May 13, 2015
  2. Johannes SchindelinMay 13, 2015
  3. Sebastian SchuberthMay 13, 2015
  4. Johannes SchindelinMay 13, 2015
  5. Sebastian SchuberthMay 13, 2015
  6. Sebastian SchuberthMay 13, 2015
  7. Sebastian SchuberthMay 13, 2015
  8. Sebastian SchuberthMay 13, 2015
  9. SZEDER GáborMay 14, 2015
  10. Sebastian SchuberthMay 15, 2015
  11. SZEDER GáborMay 15, 2015
  12. SZEDER GáborMay 14, 2015
  13. Sebastian SchuberthMay 15, 2015
  14. David AguilarMay 20, 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.