{"thread":{"id":"15908","subject":"[PATCH] git-mergetool: properly handle \"git mergetool -- filename\"","startedAt":"2008-10-15T07:39:53Z","lastAt":"2008-10-15T07:39:53Z","messageCount":1,"participants":["David Aguilar"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"93071","messageId":"36715524a8e3a4688024cc1e23dd1518c4df71a0.1224056291.git.davvid@gmail.com","threadId":"15908","inReplyTo":null,"subject":"[PATCH] git-mergetool: properly handle \"git mergetool -- filename\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-10-15T07:39:53Z","receivedAt":"2008-10-15T07:39:53Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"git-mergetool has an entry for \"--\" in its command-line parsing code\nto designate the end of option processing.  It was not calling shift,\nthough, which caused git-mergetool to incorrectly use \"--\" as the\nmerge filename.\n\nThis patch fixes this bug and updates the usage and documentation\nto include [--] in the options spec.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n Documentation/git-mergetool.txt |    2 +-\n git-mergetool.sh                |    3 ++-\n 2 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-mergetool.txt b/Documentation/git-mergetool.txt\nindex e0b2703..475db72 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>] [--] [<file>]...\n \n DESCRIPTION\n -----------\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 94187c3..1b0dfec 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] [--] [file to merge] ...'\n SUBDIRECTORY_OK=Yes\n OPTIONS_SPEC=\n . git-sh-setup\n@@ -296,6 +296,7 @@ do\n \t    esac\n \t    ;;\n \t--)\n+\t    shift\n \t    break\n \t    ;;\n \t-*)\n-- \n1.6.0.2.532.g84ed4c\n"}]}