{"thread":{"id":"7475","subject":"[PATCH] mergetool: Fix abort command when resolving symlinks and deleted files","startedAt":"2007-03-29T15:44:14Z","lastAt":"2007-03-30T14:46:47Z","messageCount":19,"participants":["Theodore Ts'o","Matthias Lederhofer","Theodore Tso","Junio C Hamano","Randal L. Schwartz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"38326","messageId":"11751830653554-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":null,"subject":"[GIT PULL] git mergetool fixes","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:14Z","receivedAt":"2007-03-29T15:44:14Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Hi Junio,\n\nPlease pull from:\n\n        git://repo.or.cz/git/mergetool.git\n\nTo receive the following fixes (see below).  They are mostly cleanups\nand portability fixes.  They also include Arjen Laarjoven's support\nfor Apple Mac OS X's opendiff GUI merge tool.\n\n----\n\nTheodore Ts'o (11):\n      Fix minor formatting issue in man page for git-mergetool\n      mergetool: Replace use of \"echo -n\" with printf(3) to be more portable\n      mergetool: Don't error out in the merge case where the local file is deleted\n      mergetool: portability fix: don't assume true is in /bin\n      mergetool: portability fix: don't use reserved word function\n      mergetool: factor out common code\n      mergetool: Remove spurious error message if merge.tool config option not set\n      mergetool: Fix abort command when resolving symlinks and deleted files\n      mergetool: Add support for Apple Mac OS X's opendiff command\n      mergetool: Make git-rm quiet when resolving a deleted file conflict\n      mergetool: Clean up description of files and prompts for merge resolutions\n\n                                                - Ted\n"},{"id":"38321","messageId":"11751830653871-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830653554-git-send-email-tytso@mit.edu","subject":"[PATCH] Fix minor formatting issue in man page for git-mergetool","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:15Z","receivedAt":"2007-03-29T15:44:15Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n Documentation/git-mergetool.txt |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex 5baaaca..34288fe 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -26,11 +26,11 @@ OPTIONS\n \tUse the merge resolution program specified by <tool>.\n \tValid merge tools are:\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\n-\tconfiguration variable merge.tool is not set, 'git mergetool'\n-\twill pick a suitable default.\n++\n+If a merge resolution program is not specified, 'git mergetool'\n+will use the configuration variable merge.tool.  If the\n+configuration variable merge.tool is not set, 'git mergetool'\n+will pick a suitable default.\n \n Author\n ------\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38330","messageId":"11751830651770-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830653871-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: Replace use of \"echo -n\" with printf(3) to be more portable","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:16Z","receivedAt":"2007-03-29T15:44:16Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |   26 +++++++++++++-------------\n 1 files changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 7942fd0..3cc428c 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -44,18 +44,18 @@ function describe_file () {\n     branch=\"$2\"\n     file=\"$3\"\n \n-    echo -n \"    \"\n+    printf \"    \"\n     if test -z \"$mode\"; then\n-\techo -n \"'$path' was deleted\"\n+\tprintf  \"'$path' was deleted\"\n     elif is_symlink \"$mode\" ; then\n-\techo -n \"'$path' is a symlink containing '\"\n+\tprintf \"'$path' is a symlink containing '\"\n \tcat \"$file\"\n-\techo -n \"'\"\n+\tprintf \"'\"\n     else\n \tif base_present; then\n-\t    echo -n \"'$path' was created\"\n+\t    printf \"'%s' was created\" \"$path\"\n \telse\n-\t    echo -n \"'$path' was modified\"\n+\t    printf \"'%s' was modified\" \"$path\"\n \tfi\n     fi\n     echo \" in the $branch branch\"\n@@ -64,7 +64,7 @@ function describe_file () {\n \n resolve_symlink_merge () {\n     while /bin/true; do\n-\techo -n \"Use (r)emote or (l)ocal, or (a)bort? \"\n+\tprintf \"Use (r)emote or (l)ocal, or (a)bort? \"\n \tread ans\n \tcase \"$ans\" in\n \t    [lL]*)\n@@ -88,7 +88,7 @@ resolve_symlink_merge () {\n \n resolve_deleted_merge () {\n     while /bin/true; do\n-\techo -n \"Use (m)odified or (d)eleted file, or (a)bort? \"\n+\tprintf \"Use (m)odified or (d)eleted file, or (a)bort? \"\n \tread ans\n \tcase \"$ans\" in\n \t    [mM]*)\n@@ -157,7 +157,7 @@ merge_file () {\n     echo \"Normal merge conflict for $path:\"\n     describe_file \"$local_mode\" \"local\" \"$LOCAL\"\n     describe_file \"$remote_mode\" \"remote\" \"$REMOTE\"\n-    echo -n \"Hit return to start merge resolution tool ($merge_tool): \"\n+    printf \"Hit return to start merge resolution tool ($merge_tool): \"\n     read ans\n \n     case \"$merge_tool\" in\n@@ -193,7 +193,7 @@ merge_file () {\n \t    else\n \t\twhile true; do\n \t\t    echo \"$path seems unchanged.\"\n-\t\t    echo -n \"Was the merge successful? [y/n] \"\n+\t\t    printf \"Was the merge successful? [y/n] \"\n \t\t    read answer < /dev/tty\n \t\t    case \"$answer\" in\n \t\t\ty*|Y*) status=0; break ;;\n@@ -225,7 +225,7 @@ merge_file () {\n \t    else\n \t\twhile true; do\n \t\t    echo \"$path seems unchanged.\"\n-\t\t    echo -n \"Was the merge successful? [y/n] \"\n+\t\t    printf \"Was the merge successful? [y/n] \"\n \t\t    read answer < /dev/tty\n \t\t    case \"$answer\" in\n \t\t\ty*|Y*) status=0; break ;;\n@@ -346,12 +346,12 @@ if test $# -eq 0 ; then\n \techo Merging the files: $files\n \tgit ls-files -u | sed -e 's/^[^\t]*\t//' | sort -u | while read i\n \tdo\n-\t\techo \"\"\n+\t\tprintf \"\\n\"\n \t\tmerge_file \"$i\" < /dev/tty > /dev/tty\n \tdone\n else\n \twhile test $# -gt 0; do\n-\t\techo \"\"\n+\t\tprintf \"\\n\"\n \t\tmerge_file \"$1\"\n \t\tshift\n \tdone\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38327","messageId":"11751830653157-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830651770-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: Don't error out in the merge case where the local file is deleted","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:17Z","receivedAt":"2007-03-29T15:44:17Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"If the file we are trying to merge resolve is in git-ls-files -u, then\nskip the file existence test.  If the file isn't reported in\ngit-ls-files, then check to see if the file exists or not to give an\nappropriate error message.\n\nSigned-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |   11 +++++------\n 1 files changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 3cc428c..9d959a9 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -111,14 +111,13 @@ resolve_deleted_merge () {\n merge_file () {\n     path=\"$1\"\n \n-    if test ! -f \"$path\" ; then\n-\techo \"$path: file not found\"\n-\texit 1\n-    fi\n-\n     f=`git-ls-files -u -- \"$path\"`\n     if test -z \"$f\" ; then\n-\techo \"$path: file does not need merging\"\n+        if test ! -f \"$path\" ; then\n+\t    echo \"$path: file not found\"\n+\telse\n+\t    echo \"$path: file does not need merging\"\n+\tfi\n \texit 1\n     fi\n \n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38322","messageId":"1175183065710-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830653157-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: portability fix: don't assume true is in /bin","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:18Z","receivedAt":"2007-03-29T15:44:18Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 9d959a9..7d2dadd 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -63,7 +63,7 @@ function describe_file () {\n \n \n resolve_symlink_merge () {\n-    while /bin/true; do\n+    while true; do\n \tprintf \"Use (r)emote or (l)ocal, or (a)bort? \"\n \tread ans\n \tcase \"$ans\" in\n@@ -87,7 +87,7 @@ resolve_symlink_merge () {\n }\n \n resolve_deleted_merge () {\n-    while /bin/true; do\n+    while true; do\n \tprintf \"Use (m)odified or (d)eleted file, or (a)bort? \"\n \tread ans\n \tcase \"$ans\" in\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38329","messageId":"11751830651361-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"1175183065710-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: portability fix: don't use reserved word function","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:19Z","receivedAt":"2007-03-29T15:44:19Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 7d2dadd..8a87f5e 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -14,19 +14,19 @@ SUBDIRECTORY_OK=Yes\n require_work_tree\n \n # Returns true if the mode reflects a symlink\n-function is_symlink () {\n+is_symlink () {\n     test \"$1\" = 120000\n }\n \n-function local_present () {\n+local_present () {\n     test -n \"$local_mode\"\n }\n \n-function remote_present () {\n+remote_present () {\n     test -n \"$remote_mode\"\n }\n \n-function base_present () {\n+base_present () {\n     test -n \"$base_mode\"\n }\n \n@@ -39,7 +39,7 @@ cleanup_temp_files () {\n     fi\n }\n \n-function describe_file () {\n+describe_file () {\n     mode=\"$1\"\n     branch=\"$2\"\n     file=\"$3\"\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38323","messageId":"11751830654112-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830651361-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: factor out common code","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:20Z","receivedAt":"2007-03-29T15:44:20Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Create common function check_unchanged(), save_backup() and\nremove_backup().\n\nAlso fix some minor whitespace issues while we're at it.\n\nSigned-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |   80 +++++++++++++++++++++++++-----------------------------\n 1 files changed, 37 insertions(+), 43 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 8a87f5e..aeb32ef 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -46,7 +46,7 @@ describe_file () {\n \n     printf \"    \"\n     if test -z \"$mode\"; then\n-\tprintf  \"'$path' was deleted\"\n+\tprintf \"'$path' was deleted\"\n     elif is_symlink \"$mode\" ; then\n \tprintf \"'$path' is a symlink containing '\"\n \tcat \"$file\"\n@@ -108,12 +108,40 @@ resolve_deleted_merge () {\n \tdone\n }\n \n+check_unchanged () {\n+    if test \"$path\" -nt \"$BACKUP\" ; then\n+\tstatus=0;\n+    else\n+\twhile true; do\n+\t    echo \"$path seems unchanged.\"\n+\t    printf \"Was the merge successful? [y/n] \"\n+\t    read answer < /dev/tty\n+\t    case \"$answer\" in\n+\t\ty*|Y*) status=0; break ;;\n+\t\tn*|N*) status=1; break ;;\n+\t    esac\n+\tdone\n+    fi\n+}\n+\n+save_backup () {\n+    if test \"$status\" -eq 0; then\n+\tmv -- \"$BACKUP\" \"$path.orig\"\n+    fi\n+}\n+\n+remove_backup () {\n+    if test \"$status\" -eq 0; then\n+\trm \"$BACKUP\"\n+    fi\n+}\n+\n merge_file () {\n     path=\"$1\"\n \n     f=`git-ls-files -u -- \"$path\"`\n     if test -z \"$f\" ; then\n-        if test ! -f \"$path\" ; then\n+\tif test ! -f \"$path\" ; then\n \t    echo \"$path: file not found\"\n \telse\n \t    echo \"$path: file does not need merging\"\n@@ -169,9 +197,7 @@ merge_file () {\n \t\t    -o \"$path\" -- \"$LOCAL\" \"$REMOTE\" > /dev/null 2>&1)\n \t    fi\n \t    status=$?\n-\t    if test \"$status\" -eq 0; then\n-\t\trm \"$BACKUP\"\n-\t    fi\n+\t    remove_backup\n \t    ;;\n \ttkdiff)\n \t    if base_present ; then\n@@ -180,29 +206,13 @@ merge_file () {\n \t\ttkdiff -o \"$path\" -- \"$LOCAL\" \"$REMOTE\"\n \t    fi\n \t    status=$?\n-\t    if test \"$status\" -eq 0; then\n-\t\tmv -- \"$BACKUP\" \"$path.orig\"\n-\t    fi\n+\t    save_backup\n \t    ;;\n \tmeld|vimdiff)\n \t    touch \"$BACKUP\"\n \t    $merge_tool -- \"$LOCAL\" \"$path\" \"$REMOTE\"\n-\t    if test \"$path\" -nt \"$BACKUP\" ; then\n-\t\tstatus=0;\n-\t    else\n-\t\twhile true; do\n-\t\t    echo \"$path seems unchanged.\"\n-\t\t    printf \"Was the merge successful? [y/n] \"\n-\t\t    read answer < /dev/tty\n-\t\t    case \"$answer\" in\n-\t\t\ty*|Y*) status=0; break ;;\n-\t\t\tn*|N*) status=1; break ;;\n-\t\t    esac\n-\t\tdone\n-\t    fi\n-\t    if test \"$status\" -eq 0; then\n-\t\tmv -- \"$BACKUP\" \"$path.orig\"\n-\t    fi\n+\t    check_unchanged\n+\t    save_backup\n \t    ;;\n \txxdiff)\n \t    touch \"$BACKUP\"\n@@ -219,22 +229,8 @@ merge_file () {\n \t\t    -R 'Accel.SearchForward: \"Ctrl-G\"' \\\n \t\t    --merged-file \"$path\" -- \"$LOCAL\" \"$REMOTE\"\n \t    fi\n-\t    if test \"$path\" -nt \"$BACKUP\" ; then\n-\t\tstatus=0;\n-\t    else\n-\t\twhile true; do\n-\t\t    echo \"$path seems unchanged.\"\n-\t\t    printf \"Was the merge successful? [y/n] \"\n-\t\t    read answer < /dev/tty\n-\t\t    case \"$answer\" in\n-\t\t\ty*|Y*) status=0; break ;;\n-\t\t\tn*|N*) status=1; break ;;\n-\t\t    esac\n-\t\tdone\n-\t    fi\n-\t    if test \"$status\" -eq 0; then\n-\t\tmv -- \"$BACKUP\" \"$path.orig\"\n-\t    fi\n+\t    check_unchanged\n+\t    save_backup\n \t    ;;\n \temerge)\n \t    if base_present ; then\n@@ -243,9 +239,7 @@ merge_file () {\n \t\temacs -f emerge-files-command \"$LOCAL\" \"$REMOTE\" \"$path\"\n \t    fi\n \t    status=$?\n-\t    if test \"$status\" -eq 0; then\n-\t\tmv -- \"$BACKUP\" \"$path.orig\"\n-\t    fi\n+\t    save_backup\n \t    ;;\n     esac\n     if test \"$status\" -ne 0; then\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38331","messageId":"11751830652803-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830654112-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: Remove spurious error message if merge.tool config option not set","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:21Z","receivedAt":"2007-03-29T15:44:21Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex aeb32ef..5de2433 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -282,7 +282,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 | emerge | vimdiff)\n+\tkdiff3 | tkdiff | xxdiff | meld | emerge | vimdiff | \"\")\n \t    ;; # happy\n \t*)\n \t    echo >&2 \"git config option merge.tool set to unknown tool: $merge_tool\"\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38320","messageId":"11751830653835-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830652803-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: Fix abort command when resolving symlinks and deleted files","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:22Z","receivedAt":"2007-03-29T15:44:22Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 5de2433..f73072a 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -73,13 +73,13 @@ resolve_symlink_merge () {\n \t\tcleanup_temp_files --save-backup\n \t\treturn\n \t\t;;\n-\t   [rR]*)\n+\t    [rR]*)\n \t\tgit-checkout-index -f --stage=3 -- \"$path\"\n \t\tgit-add -- \"$path\"\n \t\tcleanup_temp_files --save-backup\n \t\treturn\n \t\t;;\n-\t    [qQ]*)\n+\t    [aA]*)\n \t\texit 1\n \t\t;;\n \t    esac\n@@ -96,12 +96,12 @@ resolve_deleted_merge () {\n \t\tcleanup_temp_files --save-backup\n \t\treturn\n \t\t;;\n-\t   [dD]*)\n+\t    [dD]*)\n \t\tgit-rm -- \"$path\"\n \t\tcleanup_temp_files\n \t\treturn\n \t\t;;\n-\t    [qQ]*)\n+\t    [aA]*)\n \t\texit 1\n \t\t;;\n \t    esac\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38324","messageId":"11751830651076-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830653835-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: Add support for Apple Mac OS X's opendiff command","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:23Z","receivedAt":"2007-03-29T15:44:23Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: Arjen Laarhoven <arjen@yaph.org>\nSigned-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |   16 ++++++++++++++--\n 1 files changed, 14 insertions(+), 2 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex f73072a..b0d28fd 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -232,6 +232,16 @@ merge_file () {\n \t    check_unchanged\n \t    save_backup\n \t    ;;\n+\topendiff)\n+\t    touch \"$BACKUP\"\n+\t    if base_present; then\n+\t\topendiff \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$path\" | cat\n+\t    else\n+\t\topendiff \"$LOCAL\" \"$REMOTE\" -merge \"$path\" | cat\n+\t    fi\n+\t    check_unchanged\n+\t    save_backup\n+\t    ;;\n \temerge)\n \t    if base_present ; then\n \t\temacs -f emerge-files-with-ancestor-command \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$path\"\n@@ -282,7 +292,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 | emerge | vimdiff | \"\")\n+\tkdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | \"\")\n \t    ;; # happy\n \t*)\n \t    echo >&2 \"git config option merge.tool set to unknown tool: $merge_tool\"\n@@ -301,6 +311,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 opendiff >/dev/null 2>&1; then\n+\tmerge_tool=opendiff\n     elif type emacs >/dev/null 2>&1; then\n \tmerge_tool=emerge\n     elif type vimdiff >/dev/null 2>&1; then\n@@ -312,7 +324,7 @@ if test -z \"$merge_tool\" ; then\n fi\n \n case \"$merge_tool\" in\n-    kdiff3|tkdiff|meld|xxdiff|vimdiff)\n+    kdiff3|tkdiff|meld|xxdiff|vimdiff|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.1.rc2.1.g8afe-dirty\n"},{"id":"38328","messageId":"11751830652512-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830651076-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: Make git-rm quiet when resolving a deleted file conflict","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:24Z","receivedAt":"2007-03-29T15:44:24Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Signed-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex b0d28fd..b9d81f5 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -97,7 +97,7 @@ resolve_deleted_merge () {\n \t\treturn\n \t\t;;\n \t    [dD]*)\n-\t\tgit-rm -- \"$path\"\n+\t\tgit-rm -- \"$path\" > /dev/null\n \t\tcleanup_temp_files\n \t\treturn\n \t\t;;\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38325","messageId":"11751830652230-git-send-email-tytso@mit.edu","threadId":"7475","inReplyTo":"11751830652512-git-send-email-tytso@mit.edu","subject":"[PATCH] mergetool: Clean up description of files and prompts for merge resolutions","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T15:44:25Z","receivedAt":"2007-03-29T15:44:25Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"This fixes complaints from Junio for how messages and prompts are\nprinted when resolving symlink and deleted file merges.\n\nSigned-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\n---\n git-mergetool.sh |   29 +++++++++++++++--------------\n 1 files changed, 15 insertions(+), 14 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex b9d81f5..9b824ac 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -44,27 +44,24 @@ describe_file () {\n     branch=\"$2\"\n     file=\"$3\"\n \n-    printf \"    \"\n+    printf \"  {$branch}: \"\n     if test -z \"$mode\"; then\n-\tprintf \"'$path' was deleted\"\n+\techo \"deleted\"\n     elif is_symlink \"$mode\" ; then\n-\tprintf \"'$path' is a symlink containing '\"\n-\tcat \"$file\"\n-\tprintf \"'\"\n+\techo \"a symbolic link -> '$(cat \"$file\")'\"\n     else\n \tif base_present; then\n-\t    printf \"'%s' was created\" \"$path\"\n+\t    echo \"modified\"\n \telse\n-\t    printf \"'%s' was modified\" \"$path\"\n+\t    echo \"created\"\n \tfi\n     fi\n-    echo \" in the $branch branch\"\n }\n \n \n resolve_symlink_merge () {\n     while true; do\n-\tprintf \"Use (r)emote or (l)ocal, or (a)bort? \"\n+\tprintf \"Use (l)ocal or (r)emote, or (a)bort? \"\n \tread ans\n \tcase \"$ans\" in\n \t    [lL]*)\n@@ -88,10 +85,14 @@ resolve_symlink_merge () {\n \n resolve_deleted_merge () {\n     while true; do\n-\tprintf \"Use (m)odified or (d)eleted file, or (a)bort? \"\n+\tif base_present; then\n+\t    printf \"Use (m)odified or (d)eleted file, or (a)bort? \"\n+\telse\n+\t    printf \"Use (c)reated or (d)eleted file, or (a)bort? \"\n+\tfi\n \tread ans\n \tcase \"$ans\" in\n-\t    [mM]*)\n+\t    [mMcC]*)\n \t\tgit-add -- \"$path\"\n \t\tcleanup_temp_files --save-backup\n \t\treturn\n@@ -166,7 +167,7 @@ merge_file () {\n     remote_present && git cat-file blob \":3:$path\" > \"$REMOTE\" 2>/dev/null\n \n     if test -z \"$local_mode\" -o -z \"$remote_mode\"; then\n-\techo \"Deleted merge conflict for $path:\"\n+\techo \"Deleted merge conflict for '$path':\"\n \tdescribe_file \"$local_mode\" \"local\" \"$LOCAL\"\n \tdescribe_file \"$remote_mode\" \"remote\" \"$REMOTE\"\n \tresolve_deleted_merge\n@@ -174,14 +175,14 @@ merge_file () {\n     fi\n \n     if is_symlink \"$local_mode\" || is_symlink \"$remote_mode\"; then\n-\techo \"Symlink merge conflict for $path:\"\n+\techo \"Symbolic link merge conflict for '$path':\"\n \tdescribe_file \"$local_mode\" \"local\" \"$LOCAL\"\n \tdescribe_file \"$remote_mode\" \"remote\" \"$REMOTE\"\n \tresolve_symlink_merge\n \treturn\n     fi\n \n-    echo \"Normal merge conflict for $path:\"\n+    echo \"Normal merge conflict for '$path':\"\n     describe_file \"$local_mode\" \"local\" \"$LOCAL\"\n     describe_file \"$remote_mode\" \"remote\" \"$REMOTE\"\n     printf \"Hit return to start merge resolution tool ($merge_tool): \"\n-- \n1.5.1.rc2.1.g8afe-dirty\n"},{"id":"38332","messageId":"20070329155741.GA18413@moooo.ath.cx","threadId":"7475","inReplyTo":"11751830651770-git-send-email-tytso@mit.edu","subject":"Re: [PATCH] mergetool: Replace use of \"echo -n\" with printf(3) to be more portable","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2007-03-29T15:57:41Z","receivedAt":"2007-03-29T15:57:41Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"The subject should probably refer to printf(1) instead of printf(3).\n\nTheodore Ts'o <tytso@mit.edu> wrote:\n> -\techo -n \"'$path' was deleted\"\n> +\tprintf  \"'$path' was deleted\"\nHere is one space too much after printf.\n\n> -\techo -n \"'$path' is a symlink containing '\"\n> +\tprintf \"'$path' is a symlink containing '\"\nYou should use printf \"'%s' [..]\" \"$path\" as you do in some other\nplaces (in case $path contains conversion specifiers).\n\n> -    echo -n \"Hit return to start merge resolution tool ($merge_tool): \"\n> +    printf \"Hit return to start merge resolution tool ($merge_tool): \"\nHere it is much more unlikely that $merge_tool contains a conversion\nspecifier but anyway I'd prefer to use %s.\n"},{"id":"38337","messageId":"20070329170914.GA9435@thunk.org","threadId":"7475","inReplyTo":"20070329155741.GA18413@moooo.ath.cx","subject":"Re: [PATCH] mergetool: Replace use of \"echo -n\" with printf(3) to be more portable","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T17:09:14Z","receivedAt":"2007-03-29T17:09:14Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Thu, Mar 29, 2007 at 05:57:41PM +0200, Matthias Lederhofer wrote:\n> The subject should probably refer to printf(1) instead of printf(3).\n\nYep.\n\n> Theodore Ts'o <tytso@mit.edu> wrote:\n> > +\tprintf  \"'$path' was deleted\"\n> Here is one space too much after printf.\n\nThis was fixed in a later patch.\n\n> > +\tprintf \"'$path' is a symlink containing '\"\n> You should use printf \"'%s' [..]\" \"$path\" as you do in some other\n> places (in case $path contains conversion specifiers).\n\nThis was also obsoleted in a later patch, but you're right.\n\n> > +    printf \"Hit return to start merge resolution tool ($merge_tool): \"\n> Here it is much more unlikely that $merge_tool contains a conversion\n> specifier but anyway I'd prefer to use %s.\n\nYep, agreed.\n\nJunio, I've prepared an alterate patch series.  If you haven't pulled\nfrom repo.or.cz, I'd appreciate it if you could pull from the\nmergetool branch (instead of master) instead:\n\n\thttp://repo.or.cz/w/git/mergetool.git\n\nThe differences between the patch series in the master and mergetool\nbranch are:\n\n\t* Change the description of the printf patch to say: \n\t\tprintf(3)->printf(1)\n\t* Fix the double space after printf and symlink %s conversion\n\t\tearlier in the patch series (only to have it disappear\n\t\tin the last patch, so this is a no-op at the end of\n\t\tthe day, but more of an excuse to go play with stgit\n\t\tand in the name of anal-rententive correctness)\n\t* Use a %s printf conversion for the \"Hit return to start merge...\"\n\t\tstatement as noted above in the last patch.\n\nThanks!!\n\n(Apparently there's no way to forcibly reset the pointer of the master\nhead on repo.or.cz, probably for security/sanity reasons, without\ngoing through an administrator.)\n\n\t\t\t\t\t\t- Ted\n"},{"id":"38360","messageId":"7vwt0z1zel.fsf@assigned-by-dhcp.cox.net","threadId":"7475","inReplyTo":"20070329170914.GA9435@thunk.org","subject":"Re: [PATCH] mergetool: Replace use of \"echo -n\" with printf(3) to be more portable","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-29T22:02:42Z","receivedAt":"2007-03-29T22:02:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Theodore Tso <tytso@mit.edu> writes:\n\n> Junio, I've prepared an alterate patch series.  If you haven't pulled\n> from repo.or.cz, I'd appreciate it if you could pull from the\n> mergetool branch (instead of master) instead:\n>\n> \thttp://repo.or.cz/w/git/mergetool.git\n\nThanks; will do later tonight after I got home.\n\n> (Apparently there's no way to forcibly reset the pointer of the master\n> head on repo.or.cz, probably for security/sanity reasons, without\n> going through an administrator.)\n\nReally?  I push with '+' (aka \"single force\") all the time to\nalt-git.git repository and haven't noticed that:\n\n    [remote \"repo\"]\n            url = repo.or.cz:srv/git/alt-git.git/\n            push = refs/tags/ko-master:refs/heads/master\n            push = refs/tags/ko-next:refs/heads/next\n            push = +refs/tags/ko-pu:refs/heads/pu\n            push = refs/tags/ko-maint:refs/heads/maint\n\nHere, tags/ko-* keeps track of what I pushed out the official\nk.org repositories, and my workflow has been:\n\n    $ git push ko ;# push to k.org refs/heads/{master,next,...}\n    $ git fetch ko ;# fetch them back to refs/tags/ko-*\n    $ git push repo ;# update alt-git.git\n"},{"id":"38382","messageId":"20070329221544.GB30858@thunk.org","threadId":"7475","inReplyTo":"7vwt0z1zel.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] mergetool: Replace use of \"echo -n\" with printf(3) to be more portable","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-03-29T22:15:44Z","receivedAt":"2007-03-29T22:15:44Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Thu, Mar 29, 2007 at 03:02:42PM -0700, Junio C Hamano wrote:\n> Really?  I push with '+' (aka \"single force\") all the time to\n> alt-git.git repository and haven't noticed that:\n\nOh, cool, it never occurred to me that it would work with push on a\nremote repository (but that makes perfect sense in retrospect :-).\n\n\t\t\t\t\t\t- Ted\n"},{"id":"38364","messageId":"20070329222905.GA25347@moooo.ath.cx","threadId":"7475","inReplyTo":"11751830652230-git-send-email-tytso@mit.edu","subject":"Re: [PATCH] mergetool: Clean up description of files and prompts for merge resolutions","fromName":"Matthias Lederhofer","fromEmail":"matled@gmx.net","sentAt":"2007-03-29T22:29:05Z","receivedAt":"2007-03-29T22:29:05Z","isPatch":true,"sender":{"key":"matled@gmx.net","avatar":null},"body":"Theodore Ts'o <tytso@mit.edu> wrote:\n> +    printf \"  {$branch}: \"\nThis should use %s too.\n"},{"id":"38381","messageId":"20070330025411.GD3198@thunk.org","threadId":"7475","inReplyTo":"20070329222905.GA25347@moooo.ath.cx","subject":"Re: [PATCH] mergetool: Clean up description of files and prompts for merge resolutions","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-03-30T02:54:11Z","receivedAt":"2007-03-30T02:54:11Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Fri, Mar 30, 2007 at 12:29:05AM +0200, Matthias Lederhofer wrote:\n> Theodore Ts'o <tytso@mit.edu> wrote:\n> > +    printf \"  {$branch}: \"\n> This should use %s too.\n\nIt's strictly not necessary since $branch is either \"local\" or \"remote\".\n\n\t\t\t\t\t\t- Ted\n"},{"id":"38391","messageId":"86648ikcvc.fsf@blue.stonehenge.com","threadId":"7475","inReplyTo":"20070330025411.GD3198@thunk.org","subject":"Re: [PATCH] mergetool: Clean up description of files and prompts for merge resolutions","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2007-03-30T14:46:47Z","receivedAt":"2007-03-30T14:46:47Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Theodore\" == Theodore Tso <tytso@mit.edu> writes:\n\nTheodore> On Fri, Mar 30, 2007 at 12:29:05AM +0200, Matthias Lederhofer wrote:\n>> Theodore Ts'o <tytso@mit.edu> wrote:\n>> > +    printf \"  {$branch}: \"\n>> This should use %s too.\n\nTheodore> It's strictly not necessary since $branch is either \"local\" or \"remote\".\n\n... this week. :)\n\nBest to be safe, and provide a good model for later cut-n-pasters, I've\nalways said.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"}]}