{"thread":{"id":"8459","subject":"[PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool","startedAt":"2007-06-06T01:38:02Z","lastAt":"2007-06-09T17:17:24Z","messageCount":3,"participants":["Dan McGee","Theodore Tso"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"44112","messageId":"11810938823594-git-send-email-dpmcgee@gmail.com","threadId":"8459","inReplyTo":null,"subject":"[PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2007-06-06T01:38:02Z","receivedAt":"2007-06-06T01:38:02Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"Signed-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n Documentation/config.txt        |    2 +-\n Documentation/git-mergetool.txt |    2 +-\n git-mergetool.sh                |    6 +++---\n 3 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 5868d58..3ca01af 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -531,7 +531,7 @@ merge.summary::\n merge.tool::\n \tControls which merge resolution program is used by\n \tgitlink:git-mergetool[l].  Valid values are: \"kdiff3\", \"tkdiff\",\n-\t\"meld\", \"xxdiff\", \"emerge\", \"vimdiff\", and \"opendiff\"\n+\t\"meld\", \"xxdiff\", \"emerge\", \"vimdiff\", \"gvimdiff\", and \"opendiff\".\n \n merge.verbosity::\n \tControls the amount of output shown by the recursive merge\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex add01e8..34c4c1c 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -25,7 +25,7 @@ OPTIONS\n -t or --tool=<tool>::\n \tUse the merge resolution program specified by <tool>.\n \tValid merge tools are:\n-\tkdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, and opendiff\n+\tkdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, and opendiff\n +\n If a merge resolution program is not specified, 'git mergetool'\n will use the configuration variable merge.tool.  If the\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex e62351b..1e4807b 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -209,7 +209,7 @@ merge_file () {\n \t    status=$?\n \t    save_backup\n \t    ;;\n-\tmeld|vimdiff)\n+\tmeld|vimdiff|gvimdiff)\n \t    touch \"$BACKUP\"\n \t    $merge_tool -- \"$LOCAL\" \"$path\" \"$REMOTE\"\n \t    check_unchanged\n@@ -293,7 +293,7 @@ done\n if test -z \"$merge_tool\"; then\n     merge_tool=`git-config merge.tool`\n     case \"$merge_tool\" in\n-\tkdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | \"\")\n+\tkdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | \"\")\n \t    ;; # happy\n \t*)\n \t    echo >&2 \"git config option merge.tool set to unknown tool: $merge_tool\"\n@@ -325,7 +325,7 @@ if test -z \"$merge_tool\" ; then\n fi\n \n case \"$merge_tool\" in\n-    kdiff3|tkdiff|meld|xxdiff|vimdiff|opendiff)\n+    kdiff3|tkdiff|meld|xxdiff|vimdiff|gvimdiff|opendiff)\n \tif ! type \"$merge_tool\" > /dev/null 2>&1; then\n \t    echo \"The merge tool $merge_tool is not available\"\n \t    exit 1\n-- \n1.5.2.1\n"},{"id":"44113","messageId":"20070606024545.GA32603@thunk.org","threadId":"8459","inReplyTo":"11810938823594-git-send-email-dpmcgee@gmail.com","subject":"Re: [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-06-06T02:45:45Z","receivedAt":"2007-06-06T02:45:45Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Dan, your patch didn't add a gvimdiff check to the code which\ndetermins which merge tool to use if one isn't specified in the config\nfile:\n\nif test -z \"$merge_tool\" ; then\n    if type kdiff3 >/dev/null 2>&1 && test -n \"$DISPLAY\"; then\n\tmerge_tool=\"kdiff3\";\n    elif type tkdiff >/dev/null 2>&1 && test -n \"$DISPLAY\"; then\n\tmerge_tool=tkdiff\n    elif type xxdiff >/dev/null 2>&1 && test -n \"$DISPLAY\"; then\n\tmerge_tool=xxdiff\n    elif type meld >/dev/null 2>&1 && test -n \"$DISPLAY\"; then\n\tmerge_tool=meld\n    elif type opendiff >/dev/null 2>&1; then\n\tmerge_tool=opendiff\n    ...\n\nWas this interntional?\n\nRegards,\n\n\t\t\t\t\t\t- Ted\n"},{"id":"44455","messageId":"449c10960706091017m5d536295waa0fbcd05a6bbb73@mail.gmail.com","threadId":"8459","inReplyTo":"20070606024545.GA32603@thunk.org","subject":"Re: [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2007-06-09T17:17:24Z","receivedAt":"2007-06-09T17:17:24Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On 6/5/07, Theodore Tso <tytso@mit.edu> wrote:\n> Dan, your patch didn't add a gvimdiff check to the code which\n> determins which merge tool to use if one isn't specified in the config\n> file:\n\nHere is an updated patch with that fix, and another that I just\ndiscovered. gvim by default forks and does not run in the foreground,\nso we need to call it with the '-f' flag to prevent this.\n\n-Dan\n\n>From b9c8873d63365c55b75bb2ec3d76c208f327b620 Mon Sep 17 00:00:00 2001\nFrom: Dan McGee <dpmcgee@gmail.com>\nDate: Tue, 5 Jun 2007 21:19:47 -0400\nSubject: [PATCH] git-mergetool: Allow gvimdiff to be used as a mergetool\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n Documentation/config.txt        |    2 +-\n Documentation/git-mergetool.txt |    2 +-\n git-mergetool.sh                |   12 ++++++++++--\n 3 files changed, 12 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 5868d58..3ca01af 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -531,7 +531,7 @@ merge.summary::\n merge.tool::\n \tControls which merge resolution program is used by\n \tgitlink:git-mergetool[l].  Valid values are: \"kdiff3\", \"tkdiff\",\n-\t\"meld\", \"xxdiff\", \"emerge\", \"vimdiff\", and \"opendiff\"\n+\t\"meld\", \"xxdiff\", \"emerge\", \"vimdiff\", \"gvimdiff\", and \"opendiff\".\n\n merge.verbosity::\n \tControls the amount of output shown by the recursive merge\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex add01e8..34c4c1c 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -25,7 +25,7 @@ OPTIONS\n -t or --tool=<tool>::\n \tUse the merge resolution program specified by <tool>.\n \tValid merge tools are:\n-\tkdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, and opendiff\n+\tkdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, and opendiff\n +\n If a merge resolution program is not specified, 'git mergetool'\n will use the configuration variable merge.tool.  If the\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex bb21b03..c9a90cd 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -215,6 +215,12 @@ merge_file () {\n \t    check_unchanged\n \t    save_backup\n \t    ;;\n+\tgvimdiff)\n+\t\ttouch \"$BACKUP\"\n+\t\tgvimdiff -f -- \"$LOCAL\" \"$path\" \"$REMOTE\"\n+\t\tcheck_unchanged\n+\t\tsave_backup\n+\t\t;;\n \txxdiff)\n \t    touch \"$BACKUP\"\n \t    if base_present ; then\n@@ -293,7 +299,7 @@ done\n if test -z \"$merge_tool\"; then\n     merge_tool=`git-config merge.tool`\n     case \"$merge_tool\" in\n-\tkdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | \"\")\n+\tkdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | \"\")\n \t    ;; # happy\n \t*)\n \t    echo >&2 \"git config option merge.tool set to unknown tool: $merge_tool\"\n@@ -312,6 +318,8 @@ if test -z \"$merge_tool\" ; then\n \tmerge_tool=xxdiff\n     elif type meld >/dev/null 2>&1 && test -n \"$DISPLAY\"; then\n \tmerge_tool=meld\n+    elif type gvimdiff >/dev/null 2>&1 && test -n \"$DISPLAY\"; then\n+\tmerge_tool=gvimdiff\n     elif type opendiff >/dev/null 2>&1; then\n \tmerge_tool=opendiff\n     elif type emacs >/dev/null 2>&1; then\n@@ -325,7 +333,7 @@ if test -z \"$merge_tool\" ; then\n fi\n\n case \"$merge_tool\" in\n-    kdiff3|tkdiff|meld|xxdiff|vimdiff|opendiff)\n+    kdiff3|tkdiff|meld|xxdiff|vimdiff|gvimdiff|opendiff)\n \tif ! type \"$merge_tool\" > /dev/null 2>&1; then\n \t    echo \"The merge tool $merge_tool is not available\"\n \t    exit 1\n-- \n1.5.2.1\n"}]}