{"thread":{"id":"17480","subject":"[PATCH] contrib/difftool: Don't repeat merge tool candidates","startedAt":"2009-01-31T20:27:56Z","lastAt":"2009-02-01T01:35:53Z","messageCount":2,"participants":["David Aguilar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"102710","messageId":"1233433676-21944-1-git-send-email-davvid@gmail.com","threadId":"17480","inReplyTo":null,"subject":"[PATCH] contrib/difftool: Don't repeat merge tool candidates","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2009-01-31T20:27:56Z","receivedAt":"2009-01-31T20:27:56Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"git difftool listed some candidates for mergetools twice, depending on\nthe environment.\n\nThis slightly changes the behavior when both KDE_FULL_SESSION and\nGNOME_DESKTOP_SESSION_ID are set at the same time; in such a case\nmeld is used in favor of kdiff3 (the old code favored kdiff3 in such a\ncase), but it should not matter in practice.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n\nHi Junio\n\nThis is based on top of Markus's kompare patch:\n\t\"contrib/difftool: add support for Kompare\"\n\thttp://article.gmane.org/gmane.comp.version-control.git/107883\n\nThis syncs difftool up with the mergetool patch that's in 'next':\n\t\"git mergetool: Don't repeat merge tool candidates\"\n\thttp://article.gmane.org/gmane.comp.version-control.git/106669\n\n\n contrib/difftool/git-difftool-helper |   31 ++++++++++++-------------------\n 1 files changed, 12 insertions(+), 19 deletions(-)\n\ndiff --git a/contrib/difftool/git-difftool-helper b/contrib/difftool/git-difftool-helper\nindex 10632a3..db3af6a 100755\n--- a/contrib/difftool/git-difftool-helper\n+++ b/contrib/difftool/git-difftool-helper\n@@ -181,31 +181,24 @@ fi\n \n # Try to guess an appropriate merge tool if no tool has been set.\n if test -z \"$merge_tool\"; then\n-\n \t# We have a $DISPLAY so try some common UNIX merge tools\n \tif test -n \"$DISPLAY\"; then\n-\t\tmerge_tool_candidates=\"kdiff3 kompare tkdiff xxdiff meld gvimdiff\"\n-\t\t# If gnome then prefer meld\n-\t\tif test -n \"$GNOME_DESKTOP_SESSION_ID\"; then\n-\t\t\tmerge_tool_candidates=\"meld $merge_tool_candidates\"\n-\t\tfi\n-\t\t# If KDE then prefer kdiff3 or kompare\n-\t\tif test \"$KDE_FULL_SESSION\" = \"true\"; then\n-\t\t\tmerge_tool_candidates=\"kdiff3 kompare $merge_tool_candidates\"\n+\t\t# If gnome then prefer meld, otherwise, prefer kdiff3 or kompare\n+\t\tif test -n \"$GNOME_DESKTOP_SESSION_ID\" ; then\n+\t\t\tmerge_tool_candidates=\"meld kdiff3 kompare tkdiff xxdiff gvimdiff\"\n+\t\telse\n+\t\t\tmerge_tool_candidates=\"kdiff3 kompare tkdiff xxdiff meld gvimdiff\"\n \t\tfi\n \tfi\n-\n-\t# $EDITOR is emacs so add emerge as a candidate\n \tif echo \"${VISUAL:-$EDITOR}\" | grep 'emacs' > /dev/null 2>&1; then\n-\t\tmerge_tool_candidates=\"$merge_tool_candidates emerge\"\n+\t\t# $EDITOR is emacs so add emerge as a candidate\n+\t\tmerge_tool_candidates=\"$merge_tool_candidates emerge opendiff vimdiff\"\n+\telif echo \"${VISUAL:-$EDITOR}\" | grep 'vim' > /dev/null 2>&1; then\n+\t\t# $EDITOR is vim so add vimdiff as a candidate\n+\t\tmerge_tool_candidates=\"$merge_tool_candidates vimdiff opendiff emerge\"\n+\telse\n+\t\tmerge_tool_candidates=\"$merge_tool_candidates opendiff emerge vimdiff\"\n \tfi\n-\n-\t# $EDITOR is vim so add vimdiff as a candidate\n-\tif echo \"${VISUAL:-$EDITOR}\" | grep 'vim' > /dev/null 2>&1; then\n-\t\tmerge_tool_candidates=\"$merge_tool_candidates vimdiff\"\n-\tfi\n-\n-\tmerge_tool_candidates=\"$merge_tool_candidates opendiff emerge vimdiff\"\n \techo \"merge tool candidates: $merge_tool_candidates\"\n \n \t# Loop over each candidate and stop when a valid merge tool is found.\n-- \n1.6.1.2.253.ga34a\n"},{"id":"102739","messageId":"7vskmzym4m.fsf@gitster.siamese.dyndns.org","threadId":"17480","inReplyTo":"1233433676-21944-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH] contrib/difftool: Don't repeat merge tool candidates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-01T01:35:53Z","receivedAt":"2009-02-01T01:35:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> git difftool listed some candidates for mergetools twice, depending on\n> the environment.\n>\n> This slightly changes the behavior when both KDE_FULL_SESSION and\n> GNOME_DESKTOP_SESSION_ID are set at the same time; in such a case\n> meld is used in favor of kdiff3 (the old code favored kdiff3 in such a\n> case), but it should not matter in practice.\n>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n>\n> Hi Junio\n>\n> This is based on top of Markus's kompare patch:\n> \t\"contrib/difftool: add support for Kompare\"\n> \thttp://article.gmane.org/gmane.comp.version-control.git/107883\n\nOk, so I'll add \"Acked-by: David Aguilar <davvid@gmail.com>\" to Markus's\npatch and apply it.\n\nThanks\n"}]}