{"thread":{"id":"15992","subject":"[PATCH 1/3] Fix some tab/space inconsistencies in git-mergetool.sh","startedAt":"2008-10-21T10:13:17Z","lastAt":"2008-11-13T12:28:44Z","messageCount":13,"participants":["Charles Bailey","Jeff King","Andreas Ericsson","Junio C Hamano","William Pursell"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"93586","messageId":"1224583999-26279-1-git-send-email-charles@hashpling.org","threadId":"15992","inReplyTo":null,"subject":"[PATCH 1/3] Fix some tab/space inconsistencies in git-mergetool.sh","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-10-21T10:13:17Z","receivedAt":"2008-10-21T10:13:17Z","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":"93587","messageId":"1224583999-26279-2-git-send-email-charles@hashpling.org","threadId":"15992","inReplyTo":"1224583999-26279-1-git-send-email-charles@hashpling.org","subject":"[PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-10-21T10:13:18Z","receivedAt":"2008-10-21T10:13:18Z","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 response 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 29369d0..b4e4ee4 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..6d6bfe0 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>] [-n|--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+-n 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..8bc5366 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] [-n|--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-n|--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":"93588","messageId":"1224583999-26279-3-git-send-email-charles@hashpling.org","threadId":"15992","inReplyTo":"1224583999-26279-2-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-10-21T10:13:19Z","receivedAt":"2008-10-21T10:13:19Z","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 b4e4ee4..789c88a 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 6d6bfe0..15466f3 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>] [-n|--no-prompt|--prompt] [<file>]...\n+'git mergetool' [--tool=<tool>] [-n|--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 8bc5366..c1e2de9 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] [-n|--no-prompt|--prompt] [file to merge] ...'\n+USAGE='[--tool=tool] [-n|--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":"93591","messageId":"20081021111201.GA17363@coredump.intra.peff.net","threadId":"15992","inReplyTo":"1224583999-26279-3-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-10-21T11:12:02Z","receivedAt":"2008-10-21T11:12:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 21, 2008 at 11:13:19AM +0100, 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\nAll 3 patches look good to me, and match what I expected from our\nearlier discussion. But I am not too familiar with mergetool, so take my\napproval with a grain of salt. :)\n\n-Peff\n"},{"id":"93600","messageId":"48FDC1CA.2080800@op5.se","threadId":"15992","inReplyTo":"1224583999-26279-2-git-send-email-charles@hashpling.org","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-10-21T11:49:30Z","receivedAt":"2008-10-21T11:49:30Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Charles Bailey wrote:\n> This option lets git mergetool invoke the conflict resolution program\n> without waiting for a user response each time.\n> \n> Also added a mergetool.prompt (default true) configuration variable\n> controlling the same behaviour.\n> \n> Signed-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> \n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 29369d0..b4e4ee4 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.\n> diff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\n> index e0b2703..6d6bfe0 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>] [-n|--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> +-n or --no-prompt::\n> +\tDon't prompt before each invocation of the merge resolution\n> +\tprogram.\n> +\n\nThere is discussion already about \"-n should be for dry-run!\" and git's\ninconsistencies in such matters. Wouldn't -y (\"assume yes on prompt\")\nbe better?\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"93602","messageId":"20081021122655.GA29294@hashpling.org","threadId":"15992","inReplyTo":"48FDC1CA.2080800@op5.se","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-10-21T12:26:55Z","receivedAt":"2008-10-21T12:26:55Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Tue, Oct 21, 2008 at 01:49:30PM +0200, Andreas Ericsson wrote:\n>\n> There is discussion already about \"-n should be for dry-run!\" and git's\n> inconsistencies in such matters. Wouldn't -y (\"assume yes on prompt\")\n> be better?\n>\n\nI must have missed this discussion. I've just had a very quick look at\na handful of basic modifying git commands (merge, pull, commit,\ncheckout, reset, revert) and only found 'add' that used -n as\n--dry-run.\n\nThat said, I've no real objections to -y if that makes for a better\nconsensus.\n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"},{"id":"93732","messageId":"20081022211720.GA23146@hashpling.org","threadId":"15992","inReplyTo":"20081021122655.GA29294@hashpling.org","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-10-22T21:17:20Z","receivedAt":"2008-10-22T21:17:20Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Tue, Oct 21, 2008 at 01:26:55PM +0100, Charles Bailey wrote:\n> On Tue, Oct 21, 2008 at 01:49:30PM +0200, Andreas Ericsson wrote:\n> >\n> > There is discussion already about \"-n should be for dry-run!\" and git's\n> > inconsistencies in such matters. Wouldn't -y (\"assume yes on prompt\")\n> > be better?\n> >\n> \n> I must have missed this discussion. I've just had a very quick look at\n> a handful of basic modifying git commands (merge, pull, commit,\n> checkout, reset, revert) and only found 'add' that used -n as\n> --dry-run.\n> \n> That said, I've no real objections to -y if that makes for a better\n> consensus.\n> \n\nI'm pretty keen on this patch, but have no strong opinions on which\nshort option is used, so are there any votes against -y?\n\nIf I re-roll with the favoured short option is there anything else\nthat would prevent its adoption into next or master?\n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"},{"id":"93744","messageId":"7vr668tdvy.fsf@gitster.siamese.dyndns.org","threadId":"15992","inReplyTo":"20081022211720.GA23146@hashpling.org","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-22T23:21:21Z","receivedAt":"2008-10-22T23:21:21Z","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> I'm pretty keen on this patch, but have no strong opinions on which\n> short option is used, so are there any votes against -y?\n\nBetween 'n' and 'y', I am in favour of the latter, but at the same time I\nhave to wonder if there are other commands that would want \"Assume yes\"\noption.  It could be that this single command that prompts for \"Is this\nOk\" is an oddball and giving it an \"interactive\" option to trigger the\ncurrent behaviour might make things more consistent.  I dunno.\n"},{"id":"93760","messageId":"20081023064455.GA10675@hashpling.org","threadId":"15992","inReplyTo":"7vr668tdvy.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-10-23T06:44:55Z","receivedAt":"2008-10-23T06:44:55Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Wed, Oct 22, 2008 at 04:21:21PM -0700, Junio C Hamano wrote:\n> Charles Bailey <charles@hashpling.org> writes:\n> \n> > I'm pretty keen on this patch, but have no strong opinions on which\n> > short option is used, so are there any votes against -y?\n> \n> Between 'n' and 'y', I am in favour of the latter, but at the same time I\n> have to wonder if there are other commands that would want \"Assume yes\"\n> option.  It could be that this single command that prompts for \"Is this\n> Ok\" is an oddball and giving it an \"interactive\" option to trigger the\n> current behaviour might make things more consistent.  I dunno.\n> \n\nI think that git mergetool probably counts as at least 'unusual', and\nI think that there is some merit in the current default behaviour. It\ngives you a prompt at which you can C-c if it's about to run something\nthat you don't want it to do the first few times that you try\nmergetool.\n\nAfter more thoughts, I'm somewhat in favour of dropping the short\nswitch altogether. As it just saves a single keypress per merge I\nimagine that most mergetool users, once they discover this new\nfeature and decide that they want to use it, will prefer to use a user\nconfig option to switch it on. The command line option then becomes\nsomething that you would only need to use to override your normal\ndefault and something on which to hang the option description in the\nman page. \n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"},{"id":"93893","messageId":"49024CF1.5040406@gmail.com","threadId":"15992","inReplyTo":"20081023064455.GA10675@hashpling.org","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"William Pursell","fromEmail":"bill.pursell@gmail.com","sentAt":"2008-10-24T22:32:17Z","receivedAt":"2008-10-24T22:32:17Z","isPatch":true,"sender":{"key":"bill.pursell@gmail.com","avatar":"https://gravatar.com/avatar/3ab4313e5dfdc1fedb65206d829ba33f71f56f26e11326979d1b99d5e1c403c9?d=mp&s=160"},"body":"Charles Bailey wrote:\n> \n> After more thoughts, I'm somewhat in favour of dropping the short\n> switch altogether. As it just saves a single keypress per merge I\n> imagine that most mergetool users, once they discover this new\n> feature and decide that they want to use it, will prefer to use a user\n> config option to switch it on. The command line option then becomes\n> something that you would only need to use to override your normal\n> default and something on which to hang the option description in the\n> man page. \n\nIf the short option is dropped, the config option should\nprobably associated with mergetool.<tool>.interactive rather\nthan mergetool.interactive.  (s/interactive/whatever)\n\n\n-- \nWilliam Pursell\n"},{"id":"93896","messageId":"20081024225539.GA6119@hashpling.org","threadId":"15992","inReplyTo":"49024CF1.5040406@gmail.com","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-10-24T22:55:39Z","receivedAt":"2008-10-24T22:55:39Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Fri, Oct 24, 2008 at 11:32:17PM +0100, William Pursell wrote:\n>\n> If the short option is dropped, the config option should\n> probably associated with mergetool.<tool>.interactive rather\n> than mergetool.interactive.  (s/interactive/whatever)\n\nI'm not sure I understand your reasoning. The no-prompt/interactive\noption affects the behaviour of the mergetool script independent of\nwhich particular merge tool is being used. Why should the presence or\nabsence of a short option affect whether the config option is global\nor per tool?\n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"},{"id":"93917","messageId":"4902F0C2.2070709@gmail.com","threadId":"15992","inReplyTo":"20081024225539.GA6119@hashpling.org","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"William Pursell","fromEmail":"bill.pursell@gmail.com","sentAt":"2008-10-25T10:11:14Z","receivedAt":"2008-10-25T10:11:14Z","isPatch":true,"sender":{"key":"bill.pursell@gmail.com","avatar":"https://gravatar.com/avatar/3ab4313e5dfdc1fedb65206d829ba33f71f56f26e11326979d1b99d5e1c403c9?d=mp&s=160"},"body":"Charles Bailey wrote:\n> On Fri, Oct 24, 2008 at 11:32:17PM +0100, William Pursell wrote:\n>> If the short option is dropped, the config option should\n>> probably associated with mergetool.<tool>.interactive rather\n>> than mergetool.interactive.  (s/interactive/whatever)\n> \n> I'm not sure I understand your reasoning. The no-prompt/interactive\n> option affects the behaviour of the mergetool script independent of\n> which particular merge tool is being used. Why should the presence or\n> absence of a short option affect whether the config option is global\n> or per tool?\n> \n\nMy thinking is that when using an interactive tool\nlike vimdiff, the user is probably not going to\ncare as much about being prompted, or may prefer\nto have the prompt in that situation.  However,\nif they've written a script to do the merge\nnon-interactively, then the prompt is undesirable.\n\nSo a person might want to be prompted with\ngit mergetool -t vimdiff, and prefer no prompt\nwith git mergetool -t my-script.  Being able\nto configure the behavior on a per-tool\nbasis would allow that.\n\n-- \nWilliam Pursell\n"},{"id":"95680","messageId":"20081113122844.GA26842@hashpling.org","threadId":"15992","inReplyTo":"4902F0C2.2070709@gmail.com","subject":"Re: [PATCH 2/3] Add -n/--no-prompt option to mergetool","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2008-11-13T12:28:44Z","receivedAt":"2008-11-13T12:28:44Z","isPatch":true,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Sat, Oct 25, 2008 at 11:11:14AM +0100, William Pursell wrote:\n>\n> My thinking is that when using an interactive tool\n> like vimdiff, the user is probably not going to\n> care as much about being prompted, or may prefer\n> to have the prompt in that situation.  However,\n> if they've written a script to do the merge\n> non-interactively, then the prompt is undesirable.\n>\n> So a person might want to be prompted with\n> git mergetool -t vimdiff, and prefer no prompt\n> with git mergetool -t my-script.  Being able\n> to configure the behavior on a per-tool\n> basis would allow that.\n\nI can see your point, although personally I feel that if you've gone\nto the trouble of writing a special script, the extra typing of an\nextra long option (if you prefer prompting normally) is not that big\ncompared with the hassle of maintaining per-tool config settings if\nyou like to regularly swap between merge tools.\n\nBoth scenarios are probably not too common so I wouldn't object\nstrongly to either. (But per tool configs is more dev work!)\n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"}]}