{"thread":{"id":"16303","subject":"[PATCH 1/3] Fix some tab/space inconsistencies in git-mergetool.sh","startedAt":"2008-11-13T12:41:12Z","lastAt":"2008-11-24T22:03:11Z","messageCount":14,"participants":["Charles Bailey","Jeff King","Junio C Hamano","Theodore Tso"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"95682","messageId":"1226580075-29289-1-git-send-email-charles@hashpling.org","threadId":"16303","inReplyTo":null,"subject":"git mergetool enhancements","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-13T12:41:12Z","receivedAt":"2008-11-13T12:41:12Z","isPatch":false,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"Reroll of previously sent mergetool enhancements. Now using -y as the short\noption for --no-prompt, but otherwise the same as before.\n"},{"id":"95681","messageId":"1226580075-29289-2-git-send-email-charles@hashpling.org","threadId":"16303","inReplyTo":"1226580075-29289-1-git-send-email-charles@hashpling.org","subject":"[PATCH 1/3] Fix some tab/space inconsistencies in git-mergetool.sh","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-13T12:41:13Z","receivedAt":"2008-11-13T12:41:13Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"git-mergetool.sh mostly uses 8 space tabs and 4 spaces per indent. This\nchange corrects this in a part of the file affect by a later commit in\nthis patch series. diff -w considers this change is to be a null change.\n\nSigned-off-by: Charles Bailey <charles@hashpling.org>\n---\n git-mergetool.sh |   38 +++++++++++++++++++-------------------\n 1 files changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 94187c3..e2da5fc 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -401,25 +401,25 @@ fi\n \n \n if test $# -eq 0 ; then\n-\tfiles=`git ls-files -u | sed -e 's/^[^\t]*\t//' | sort -u`\n-\tif test -z \"$files\" ; then\n-\t\techo \"No files need merging\"\n-\t\texit 0\n-\tfi\n-\techo Merging the files: \"$files\"\n-\tgit ls-files -u |\n-\tsed -e 's/^[^\t]*\t//' |\n-\tsort -u |\n-\twhile IFS= read i\n-\tdo\n-\t\tprintf \"\\n\"\n-\t\tmerge_file \"$i\" < /dev/tty > /dev/tty\n-\tdone\n+    files=`git ls-files -u | sed -e 's/^[^\t]*\t//' | sort -u`\n+    if test -z \"$files\" ; then\n+\techo \"No files need merging\"\n+\texit 0\n+    fi\n+    echo Merging the files: \"$files\"\n+    git ls-files -u |\n+    sed -e 's/^[^\t]*\t//' |\n+    sort -u |\n+    while IFS= read i\n+    do\n+\tprintf \"\\n\"\n+\tmerge_file \"$i\" < /dev/tty > /dev/tty\n+    done\n else\n-\twhile test $# -gt 0; do\n-\t\tprintf \"\\n\"\n-\t\tmerge_file \"$1\"\n-\t\tshift\n-\tdone\n+    while test $# -gt 0; do\n+\tprintf \"\\n\"\n+\tmerge_file \"$1\"\n+\tshift\n+    done\n fi\n exit 0\n-- \n1.6.0.2.534.g5ab59\n"},{"id":"95684","messageId":"1226580075-29289-3-git-send-email-charles@hashpling.org","threadId":"16303","inReplyTo":"1226580075-29289-2-git-send-email-charles@hashpling.org","subject":"[PATCH 2/3] Add -y/--no-prompt option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-13T12:41:14Z","receivedAt":"2008-11-13T12:41:14Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"This option lets git mergetool invoke the conflict resolution program\nwithout waiting for a user prompt each time.\n\nAlso added a mergetool.prompt (default true) configuration variable\ncontrolling the same behaviour\n\nSigned-off-by: Charles Bailey <charles@hashpling.org>\n---\n Documentation/config.txt        |    3 +++\n Documentation/git-mergetool.txt |   11 ++++++++++-\n git-mergetool.sh                |   16 +++++++++++++---\n 3 files changed, 26 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 965ed74..c5b211a 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -976,6 +976,9 @@ mergetool.keepBackup::\n \tis set to `false` then this file is not preserved.  Defaults to\n \t`true` (i.e. keep the backup files).\n \n+mergetool.prompt::\n+\tPrompt before each invocation of the merge resolution program.\n+\n pack.window::\n \tThe size of the window used by linkgit:git-pack-objects[1] when no\n \twindow size is given on the command line. Defaults to 10.\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e0b2703..176483a 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -7,7 +7,7 @@ git-mergetool - Run merge conflict resolution tools to resolve merge conflicts\n \n SYNOPSIS\n --------\n-'git mergetool' [--tool=<tool>] [<file>]...\n+'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]...\n \n DESCRIPTION\n -----------\n@@ -60,6 +60,15 @@ variable `mergetool.<tool>.trustExitCode` can be set to `true`.\n Otherwise, 'git-mergetool' will prompt the user to indicate the\n success of the resolution after the custom tool has exited.\n \n+-y or --no-prompt::\n+\tDon't prompt before each invocation of the merge resolution\n+\tprogram.\n+\n+--prompt::\n+\tPrompt before each invocation of the merge resolution program.\n+\tThis is the default behaviour; the option is provided to\n+\toverride any configuration settings.\n+\n Author\n ------\n Written by Theodore Y Ts'o <tytso@mit.edu>\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex e2da5fc..507028f 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -8,7 +8,7 @@\n # at the discretion of Junio C Hamano.\n #\n \n-USAGE='[--tool=tool] [file to merge] ...'\n+USAGE='[--tool=tool] [-y|--no-prompt|--prompt] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n OPTIONS_SPEC=\n . git-sh-setup\n@@ -176,8 +176,10 @@ merge_file () {\n     echo \"Normal merge conflict for '$MERGED':\"\n     describe_file \"$local_mode\" \"local\" \"$LOCAL\"\n     describe_file \"$remote_mode\" \"remote\" \"$REMOTE\"\n-    printf \"Hit return to start merge resolution tool (%s): \" \"$merge_tool\"\n-    read ans\n+    if \"$prompt\" = true; then\n+\tprintf \"Hit return to start merge resolution tool (%s): \" \"$merge_tool\"\n+\tread ans\n+    fi\n \n     case \"$merge_tool\" in\n \tkdiff3)\n@@ -280,6 +282,8 @@ merge_file () {\n     cleanup_temp_files\n }\n \n+prompt=$(git config --bool mergetool.prompt || echo true)\n+\n while test $# != 0\n do\n     case \"$1\" in\n@@ -295,6 +299,12 @@ do\n \t\t    shift ;;\n \t    esac\n \t    ;;\n+\t-y|--no-prompt)\n+\t    prompt=false\n+\t    ;;\n+\t--prompt)\n+\t    prompt=true\n+\t    ;;\n \t--)\n \t    break\n \t    ;;\n-- \n1.6.0.2.534.g5ab59\n"},{"id":"95683","messageId":"1226580075-29289-4-git-send-email-charles@hashpling.org","threadId":"16303","inReplyTo":"1226580075-29289-3-git-send-email-charles@hashpling.org","subject":"[PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-13T12:41:15Z","receivedAt":"2008-11-13T12:41:15Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"This option stops git mergetool from aborting at the first failed merge.\nThis allows some additional use patterns. Merge conflicts can now be\npreviewed one at time and merges can also be skipped so that they can be\nperformed in a later pass.\n\nThere is also a mergetool.keepGoing configuration variable covering the\nsame behaviour.\n\nSigned-off-by: Charles Bailey <charles@hashpling.org>\n---\n Documentation/config.txt        |    4 +++\n Documentation/git-mergetool.txt |   12 +++++++++-\n git-mergetool.sh                |   46 ++++++++++++++++++++++++++++++--------\n 3 files changed, 51 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex c5b211a..0b0bc99 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -976,6 +976,10 @@ mergetool.keepBackup::\n \tis set to `false` then this file is not preserved.  Defaults to\n \t`true` (i.e. keep the backup files).\n \n+mergetool.keepGoing::\n+\tContinue to attempt resolution of remaining conflicted files even\n+\tafter a merge has failed or been aborted.\n+\n mergetool.prompt::\n \tPrompt before each invocation of the merge resolution program.\n \ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex 176483a..bd2a5ab 100644\n--- a/Documentation/git-mergetool.txt\n+++ b/Documentation/git-mergetool.txt\n@@ -7,7 +7,8 @@ git-mergetool - Run merge conflict resolution tools to resolve merge conflicts\n \n SYNOPSIS\n --------\n-'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]...\n+'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt]\n+\t[-k|--keep-going|--no-keep-going] [<file>]...\n \n DESCRIPTION\n -----------\n@@ -69,6 +70,15 @@ success of the resolution after the custom tool has exited.\n \tThis is the default behaviour; the option is provided to\n \toverride any configuration settings.\n \n+-k or --keep-going::\n+\tContinue to attempt resolution of remaining conflicted files\n+\teven after a merge has failed or been aborted.\n+\n+--no-keep-going::\n+\tAbort the conflict resolution attempt if any single conflict\n+\tresolution fails or is aborted. This is the default behaviour;\n+\tthe option is provided to override any configuration settings.\n+\n Author\n ------\n Written by Theodore Y Ts'o <tytso@mit.edu>\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 507028f..d60f493 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -8,7 +8,8 @@\n # at the discretion of Junio C Hamano.\n #\n \n-USAGE='[--tool=tool] [-y|--no-prompt|--prompt] [file to merge] ...'\n+USAGE='[--tool=tool] [-y|--no-prompt|--prompt]\n+[-k|--keep-going|--no-keep-going] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n OPTIONS_SPEC=\n . git-sh-setup\n@@ -70,16 +71,16 @@ resolve_symlink_merge () {\n \t\tgit checkout-index -f --stage=2 -- \"$MERGED\"\n \t\tgit add -- \"$MERGED\"\n \t\tcleanup_temp_files --save-backup\n-\t\treturn\n+\t\treturn 0\n \t\t;;\n \t    [rR]*)\n \t\tgit checkout-index -f --stage=3 -- \"$MERGED\"\n \t\tgit add -- \"$MERGED\"\n \t\tcleanup_temp_files --save-backup\n-\t\treturn\n+\t\treturn 0\n \t\t;;\n \t    [aA]*)\n-\t\texit 1\n+\t\treturn 1\n \t\t;;\n \t    esac\n \tdone\n@@ -97,15 +98,15 @@ resolve_deleted_merge () {\n \t    [mMcC]*)\n \t\tgit add -- \"$MERGED\"\n \t\tcleanup_temp_files --save-backup\n-\t\treturn\n+\t\treturn 0\n \t\t;;\n \t    [dD]*)\n \t\tgit rm -- \"$MERGED\" > /dev/null\n \t\tcleanup_temp_files\n-\t\treturn\n+\t\treturn 0\n \t\t;;\n \t    [aA]*)\n-\t\texit 1\n+\t\treturn 1\n \t\t;;\n \t    esac\n \tdone\n@@ -137,7 +138,7 @@ merge_file () {\n \telse\n \t    echo \"$MERGED: file does not need merging\"\n \tfi\n-\texit 1\n+\treturn 1\n     fi\n \n     ext=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n@@ -269,7 +270,8 @@ merge_file () {\n     if test \"$status\" -ne 0; then\n \techo \"merge of $MERGED failed\" 1>&2\n \tmv -- \"$BACKUP\" \"$MERGED\"\n-\texit 1\n+\tcleanup_temp_files\n+\treturn 1\n     fi\n \n     if test \"$merge_keep_backup\" = \"true\"; then\n@@ -280,9 +282,11 @@ merge_file () {\n \n     git add -- \"$MERGED\"\n     cleanup_temp_files\n+    return 0\n }\n \n prompt=$(git config --bool mergetool.prompt || echo true)\n+keep_going=$(git config --bool mergetool.keepGoing || echo false)\n \n while test $# != 0\n do\n@@ -305,6 +309,12 @@ do\n \t--prompt)\n \t    prompt=true\n \t    ;;\n+\t-k|--keep-going)\n+\t    keep_going=true\n+\t    ;;\n+\t--no-keep-going)\n+\t    keep_going=false\n+\t    ;;\n \t--)\n \t    break\n \t    ;;\n@@ -409,6 +419,7 @@ else\n     fi\n fi\n \n+rollup_status=0\n \n if test $# -eq 0 ; then\n     files=`git ls-files -u | sed -e 's/^[^\t]*\t//' | sort -u`\n@@ -424,12 +435,27 @@ if test $# -eq 0 ; then\n     do\n \tprintf \"\\n\"\n \tmerge_file \"$i\" < /dev/tty > /dev/tty\n+\tif test $? -ne 0; then\n+\t    if test \"$keep_going\" = true; then\n+\t\trollup_status=1\n+\t    else\n+\t\texit 1\n+\t    fi\n+\tfi\n     done\n else\n     while test $# -gt 0; do\n \tprintf \"\\n\"\n \tmerge_file \"$1\"\n+\tif test $? -ne 0; then\n+\t    if test \"$keep_going\" = true; then\n+\t\trollup_status=1\n+\t    else\n+\t\texit 1\n+\t    fi\n+\tfi\n \tshift\n     done\n fi\n-exit 0\n+\n+exit $rollup_status\n-- \n1.6.0.2.534.g5ab59\n"},{"id":"95767","messageId":"20081114064756.GB11907@coredump.intra.peff.net","threadId":"16303","inReplyTo":"1226580075-29289-4-git-send-email-charles@hashpling.org","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-11-14T06:47:56Z","receivedAt":"2008-11-14T06:47:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Nov 13, 2008 at 12:41:15PM +0000, Charles Bailey wrote:\n\n> This option stops git mergetool from aborting at the first failed merge.\n> This allows some additional use patterns. Merge conflicts can now be\n> previewed one at time and merges can also be skipped so that they can be\n> performed in a later pass.\n> \n> There is also a mergetool.keepGoing configuration variable covering the\n> same behaviour.\n\nI think this series addresses the questions I remember from the first\nposting, and it looks sane overall to me. My only two complaints are:\n\n>  Documentation/config.txt        |    4 +++\n>  Documentation/git-mergetool.txt |   12 +++++++++-\n>  git-mergetool.sh                |   46 ++++++++++++++++++++++++++++++--------\n>  3 files changed, 51 insertions(+), 11 deletions(-)\n\nThis patch in particular changes some of the innards of mergetool, and\nwhile the changes look good to me via reading, I would feel even more\ncomfortable if there were some tests (it looks like your previous t7610\ngives at least a basic sanity check, but it might be nice to test to\nmake sure we detect merge failures, too).\n\n> -\t\treturn\n> +\t\treturn 0\n> [...]\n> -\t\treturn\n> +\t\treturn 0\n> [...]\n> -\t\texit 1\n> +\t\treturn 1\n> [...]\n> -\texit 1\n> +\treturn 1\n> [...]\n> -\texit 1\n> +\tcleanup_temp_files\n> +\treturn 1\n\nOne of these is not like the others. Is there a reason to add a\ncleanup_temp_files here (and if so, should it be noted in the commit\nmessage, and/or be in a separate commit?).\n\n-Peff\n"},{"id":"95785","messageId":"491D7C38.7070906@hashpling.org","threadId":"16303","inReplyTo":"20081114064756.GB11907@coredump.intra.peff.net","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-14T13:25:12Z","receivedAt":"2008-11-14T13:25:12Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"Jeff King wrote:\n\n>>  Documentation/config.txt        |    4 +++\n>>  Documentation/git-mergetool.txt |   12 +++++++++-\n>>  git-mergetool.sh                |   46\n++++++++++++++++++++++++++++++--------\n>>  3 files changed, 51 insertions(+), 11 deletions(-)\n>\n> This patch in particular changes some of the innards of mergetool, and\n> while the changes look good to me via reading, I would feel even more\n> comfortable if there were some tests (it looks like your previous t7610\n> gives at least a basic sanity check, but it might be nice to test to\n> make sure we detect merge failures, too).\n\nI had a little difficulty thinking of some decently robust tests. git\nmergetool is, by its nature, more interactive than many git commands.\n\nWith --no-prompt it should be easier to make some tests that don't just\nhang when it goes wrong. I'll have a further think on this.\n\n>> [...]\n>> -\texit 1\n>> +\tcleanup_temp_files\n>> +\treturn 1\n>\n> One of these is not like the others. Is there a reason to add a\n> cleanup_temp_files here (and if so, should it be noted in the commit\n> message, and/or be in a separate commit?).\n\nAh yes, it's definitely worthy of at least a comment. This is something\nthat I changed right at the end of testing and I should really have made\nit into a separate commit.\n\nPreviously, if you aborted a merge, you were left with the\nbase/local/remote temporaries for the merge that you aborted.\n\nTo be honest, I found this a little irritating. The base, local and\nremote temporaries are inputs so are accessible from slots 1,2 and 3 of\nthe index, and any intermediate output will be in the target file. You\ncan git clean, but if you have other temporaries you need to keep, you\nend up having to manually clean them up in any case.\n\nWith --keep-going, the problem is compounded. If you make several passes\nthrough a list of complex merges you end up with fistfuls of these\ntemporary trios in your working tree. It goes from slightly annoying to\nvery irritating.\n\nCharles.\n"},{"id":"95797","messageId":"20081114162149.GA19312@coredump.intra.peff.net","threadId":"16303","inReplyTo":"491D7C38.7070906@hashpling.org","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-11-14T16:21:50Z","receivedAt":"2008-11-14T16:21:50Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Nov 14, 2008 at 01:25:12PM +0000, Charles Bailey wrote:\n\n> Previously, if you aborted a merge, you were left with the\n> base/local/remote temporaries for the merge that you aborted.\n> \n> To be honest, I found this a little irritating. The base, local and\n> remote temporaries are inputs so are accessible from slots 1,2 and 3 of\n> the index, and any intermediate output will be in the target file. You\n> can git clean, but if you have other temporaries you need to keep, you\n> end up having to manually clean them up in any case.\n> \n> With --keep-going, the problem is compounded. If you make several passes\n> through a list of complex merges you end up with fistfuls of these\n> temporary trios in your working tree. It goes from slightly annoying to\n> very irritating.\n\nI agree; I have never found the temporary files left by mergetool from a\nfailed merge to be useful, and get a little annoyed that I have to \"git\nclean\" them away afterwards. Even without --keep-going, I would often\nlook at and abort a merge several times before resolving it and end up\nwith several copies.\n\nBut I definitely think that is an issue for a separate patch, and one\nthat needs input from Ted and from other mergetool users.\n\n-Peff\n"},{"id":"95858","messageId":"7vy6zl7drn.fsf@gitster.siamese.dyndns.org","threadId":"16303","inReplyTo":"1226580075-29289-4-git-send-email-charles@hashpling.org","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-15T05:35:08Z","receivedAt":"2008-11-15T05:35:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Charles Bailey <charles@hashpling.org> writes:\n\n> This option stops git mergetool from aborting at the first failed merge.\n> This allows some additional use patterns. Merge conflicts can now be\n> previewed one at time and merges can also be skipped so that they can be\n> performed in a later pass.\n\nHmm, with this command line:\n\n> -'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]...\n\nI wonder why this even needs to be an option.  If you do not want to\nresolve all of them, you can limit the amount of work you would do by\ngiving list of paths to work on, can't you?\n"},{"id":"95859","messageId":"20081115053841.GA20763@coredump.intra.peff.net","threadId":"16303","inReplyTo":"7vy6zl7drn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-11-15T05:38:41Z","receivedAt":"2008-11-15T05:38:41Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Nov 14, 2008 at 09:35:08PM -0800, Junio C Hamano wrote:\n\n> > -'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]...\n> \n> I wonder why this even needs to be an option.  If you do not want to\n> resolve all of them, you can limit the amount of work you would do by\n> giving list of paths to work on, can't you?\n\nI don't know about Charles, but I often don't know that I don't want to\nmerge a file using the graphical tool until I see it in the graphical\ntool. IOW, I start trying to merge it there and realize the conflict is\nsuch that I am better off doing it in my editor with conflict markers.\n\n-Peff\n"},{"id":"95886","messageId":"20081115155048.GC22948@mit.edu","threadId":"16303","inReplyTo":"1226580075-29289-3-git-send-email-charles@hashpling.org","subject":"Re: [PATCH 2/3] Add -y/--no-prompt option to mergetool","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2008-11-15T15:50:48Z","receivedAt":"2008-11-15T15:50:48Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Thu, Nov 13, 2008 at 12:41:14PM +0000, Charles Bailey wrote:\n> This option lets git mergetool invoke the conflict resolution program\n> without waiting for a user prompt each time.\n> \n> Also added a mergetool.prompt (default true) configuration variable\n> controlling the same behaviour\n\nMy apologies for not commeting earlier on your patches; I've been a\nbit overloaded as of late --- way too much conference travel!  :-(\n\nI can see why this should perhaps be the default for gui-based merge\nprogram.  The one place where it should perhaps not be the default is if\nthe tool could be text based (i.e., if you are using text-based emacs\nto do the emerge).   So perhaps what we should do is \n\n1) Make the question of whether or not a particular back-end merge\nprogram should require the user to hit return first to be configured\non a per-gui tool basis.\n\n2) For all of the gui tools default the answer to be to _not_ prompt\nfirst.\n\n3) For the emacs-based merge, make the default be based on whether or\nnot $DISPLAY is set.  (But allow an overide based on\nmergetool.emerge.prompt.)\n\nI think this much more accurately would model what users want, and if\nwe get the default right for most users, that's definitely a win.\n\nRegards,\n\n\t\t\t\t\t\t\t- Ted\n"},{"id":"95887","messageId":"20081115155603.GD22948@mit.edu","threadId":"16303","inReplyTo":"1226580075-29289-4-git-send-email-charles@hashpling.org","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2008-11-15T15:56:03Z","receivedAt":"2008-11-15T15:56:03Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Thu, Nov 13, 2008 at 12:41:15PM +0000, Charles Bailey wrote:\n> This option stops git mergetool from aborting at the first failed merge.\n> This allows some additional use patterns. Merge conflicts can now be\n> previewed one at time and merges can also be skipped so that they can be\n> performed in a later pass.\n> \n> There is also a mergetool.keepGoing configuration variable covering the\n> same behaviour.\n\nInstead of making this be a command-line and configuration option,\nmaybe it would be better to prompt the user after an aborted merge,\nand give the user the opportunity to continue or abort?  i.e., instead\nof just saying \"merge of foo.c failed\" and then exiting, to ask the\nuser instad something like, \"Merge of foo.c failed; continue\nattempting to merge the rest of the files? <y>\"\n\nI suspect this might be more friendly than Yet Another command-line\noption and configuration parameter.  What do you think?\n\n       \t   \t\t \t     \t     \t - Ted\n"},{"id":"95888","messageId":"20081115161227.GE22948@mit.edu","threadId":"16303","inReplyTo":"491D7C38.7070906@hashpling.org","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2008-11-15T16:12:27Z","receivedAt":"2008-11-15T16:12:27Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Fri, Nov 14, 2008 at 01:25:12PM +0000, Charles Bailey wrote:\n> Previously, if you aborted a merge, you were left with the\n> base/local/remote temporaries for the merge that you aborted.\n> \n> To be honest, I found this a little irritating. The base, local and\n> remote temporaries are inputs so are accessible from slots 1,2 and 3 of\n> the index, and any intermediate output will be in the target file. You\n> can git clean, but if you have other temporaries you need to keep, you\n> end up having to manually clean them up in any case.\n\nI agree.  On occasion it's useful, but more often than not, keeping\nthe temporaries is more annoying than anything else.  At the time when\nI wrote mergetool, it was a pain for me to either do \"git ls-files\n--stage\" and then cut and paste the SHA hash, or to type commands like\n\"git cat-file blob :1:long/pathname/from/the/top.c\" to look one\nvarious staged versions of the file.   \n\nI'd suggest that this is probably worth turning into an option\n(-k|--keep-files), and default the answer to deleting the temporaries\nbefore mergetool exits.\n\n\t\t\t\t\t\t- Ted\n"},{"id":"96438","messageId":"20081124215927.GA5293@hashpling.org","threadId":"16303","inReplyTo":"7vy6zl7drn.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-24T21:59:27Z","receivedAt":"2008-11-24T21:59:27Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Fri, Nov 14, 2008 at 09:35:08PM -0800, Junio C Hamano wrote:\n> Charles Bailey <charles@hashpling.org> writes:\n> \n> > This option stops git mergetool from aborting at the first failed merge.\n> > This allows some additional use patterns. Merge conflicts can now be\n> > previewed one at time and merges can also be skipped so that they can be\n> > performed in a later pass.\n> \n> Hmm, with this command line:\n> \n> > -'git mergetool' [--tool=<tool>] [-y|--no-prompt|--prompt] [<file>]...\n> \n> I wonder why this even needs to be an option.  If you do not want to\n> resolve all of them, you can limit the amount of work you would do by\n> giving list of paths to work on, can't you?\n> \n\nI have to say that since having this in my tree I've benefitted hugely\nfrom using a visual diff tool as a merge preview tool. I'm working on\na (far from ideal) project where two branches are diverging fast due\nto differing goals, yet there is a need for an end product with the\nfunctionality of both branches in it.\n\nThis means that I often end up needing to do frequent large merges.\nOften it is not until I have the merge open in front of me that it\nbecomes obvious that while a particular file needs merging, the best\nmerge strategy will only be obvious after resolving the conflicts in\nother parts of the system.\n\nOften several hours of work will just be four or five invocations of\ngit mergetool until something which compiles emerges. Stopping to view\nwhat the next unmerged file path is and pasting it into another\nmergetool command line seems like an unnecessary distraction.\n\nCharles.\n"},{"id":"96439","messageId":"20081124220311.GB5293@hashpling.org","threadId":"16303","inReplyTo":"20081115155603.GD22948@mit.edu","subject":"Re: [PATCH 3/3] Add -k/--keep-going option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-24T22:03:11Z","receivedAt":"2008-11-24T22:03:11Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Sat, Nov 15, 2008 at 10:56:03AM -0500, Theodore Tso wrote:\n> Instead of making this be a command-line and configuration option,\n> maybe it would be better to prompt the user after an aborted merge,\n> and give the user the opportunity to continue or abort?  i.e., instead\n> of just saying \"merge of foo.c failed\" and then exiting, to ask the\n> user instad something like, \"Merge of foo.c failed; continue\n> attempting to merge the rest of the files? <y>\"\n> \n> I suspect this might be more friendly than Yet Another command-line\n> option and configuration parameter.  What do you think?\n> \n>        \t   \t\t \t     \t     \t - Ted\n\nThis sounds like a really good alternative interface option. The next\ntime I have a moment (could be a while!) I'll try and make a patch\nbased on this idea.\n\nCharles.\n"}]}