{"thread":{"id":"7302","subject":"[PATCH] mergetool: Add support for vimdiff.","startedAt":"2007-03-18T22:28:46Z","lastAt":"2007-03-19T02:18:27Z","messageCount":2,"participants":["James Bowes","Theodore Tso"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"37417","messageId":"11742569263141-git-send-email-jbowes@dangerouslyinc.com","threadId":"7302","inReplyTo":null,"subject":"[PATCH] mergetool: Add support for vimdiff.","fromName":"James Bowes","fromEmail":"jbowes@dangerouslyinc.com","sentAt":"2007-03-18T22:28:46Z","receivedAt":"2007-03-18T22:28:46Z","isPatch":true,"sender":{"key":"jbowes@dangerouslyinc.com","avatar":"https://gravatar.com/avatar/a2fe98c66b2b47a9fa9d2ba92ff949d54c3208b1f8acc2e745b4b84ae3c4483a?d=mp&s=160"},"body":"Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>\n---\n git-mergetool.sh |    8 +++++---\n 1 files changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 52386a5..563c5c0 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -185,9 +185,9 @@ merge_file () {\n \t\tmv -- \"$BACKUP\" \"$path.orig\"\n \t    fi\n \t    ;;\n-\tmeld)\n+\tmeld|vimdiff)\n \t    touch \"$BACKUP\"\n-\t    meld -- \"$LOCAL\" \"$path\" \"$REMOTE\"\n+\t    $merge_tool -- \"$LOCAL\" \"$path\" \"$REMOTE\"\n \t    if test \"$path\" -nt \"$BACKUP\" ; then\n \t\tstatus=0;\n \t    else\n@@ -305,6 +305,8 @@ if test -z \"$merge_tool\" ; then\n \tmerge_tool=meld\n     elif type emacs >/dev/null 2>&1; then\n \tmerge_tool=emerge\n+    elif type vimdiff >/dev/null 2>&1; then\n+\tmerge_tool=vimdiff\n     else\n \techo \"No available merge resolution programs available.\"\n \texit 1\n@@ -312,7 +314,7 @@ if test -z \"$merge_tool\" ; then\n fi\n \n case \"$merge_tool\" in\n-    kdiff3|tkdiff|meld|xxdiff)\n+    kdiff3|tkdiff|meld|xxdiff|vimdiff)\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.0.3\n"},{"id":"37440","messageId":"20070319021827.GB11371@thunk.org","threadId":"7302","inReplyTo":"11742569263141-git-send-email-jbowes@dangerouslyinc.com","subject":"Re: [PATCH] mergetool: Add support for vimdiff.","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-03-19T02:18:27Z","receivedAt":"2007-03-19T02:18:27Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Hi James,\n\n\tThanks for adding vimdiff support!  One minor nit, which I\nfixed before applying to my tree:  You didn't update git-mergetool.txt\nand config.txt in the Documentation directory to add \"vimdiff\" to the\nlist of possible merge resolution tools.\n\nJunio, please pull from:\n\n\tgit://repo.or.cz/git/mergetool.git\n\n\t\t\t\t\t\t- Ted\n\ncommit 9cec65399d3575774910b21c1cfd762a5e88a245\nAuthor: James Bowes <jbowes@dangerouslyinc.com>\nDate:   Sun Mar 18 22:11:54 2007 -0400\n\n    mergetool: Add support for vimdiff.\n    \n    Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>\n    Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 953acae..6688642 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -460,7 +460,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\"\n+\t\"meld\", \"xxdiff\", \"emerge\", \"vimdiff\"\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 ae69a0e..5baaaca 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, and emerge.\n+\tkdiff3, tkdiff, meld, xxdiff, emerge, and vimdiff.\n \n \tIf a merge resolution program is not specified, 'git mergetool'\n \twill use the configuration variable merge.tool.  If the\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 52386a5..563c5c0 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -185,9 +185,9 @@ merge_file () {\n \t\tmv -- \"$BACKUP\" \"$path.orig\"\n \t    fi\n \t    ;;\n-\tmeld)\n+\tmeld|vimdiff)\n \t    touch \"$BACKUP\"\n-\t    meld -- \"$LOCAL\" \"$path\" \"$REMOTE\"\n+\t    $merge_tool -- \"$LOCAL\" \"$path\" \"$REMOTE\"\n \t    if test \"$path\" -nt \"$BACKUP\" ; then\n \t\tstatus=0;\n \t    else\n@@ -305,6 +305,8 @@ if test -z \"$merge_tool\" ; then\n \tmerge_tool=meld\n     elif type emacs >/dev/null 2>&1; then\n \tmerge_tool=emerge\n+    elif type vimdiff >/dev/null 2>&1; then\n+\tmerge_tool=vimdiff\n     else\n \techo \"No available merge resolution programs available.\"\n \texit 1\n@@ -312,7 +314,7 @@ if test -z \"$merge_tool\" ; then\n fi\n \n case \"$merge_tool\" in\n-    kdiff3|tkdiff|meld|xxdiff)\n+    kdiff3|tkdiff|meld|xxdiff|vimdiff)\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"}]}