{"thread":{"id":"3426","subject":"[PATCH] git-add: Add support for --, documentation, and test.","startedAt":"2006-02-21T23:33:49Z","lastAt":"2006-02-21T23:33:49Z","messageCount":1,"participants":["Carl Worth"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16546","messageId":"87pslgs2w2.wl%cworth@cworth.org","threadId":"3426","inReplyTo":null,"subject":"[PATCH] git-add: Add support for --, documentation, and test.","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2006-02-21T23:33:49Z","receivedAt":"2006-02-21T23:33:49Z","isPatch":true,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"This adds support to git-add to allow the common -- to separate\ncommand-line options and file names. It adds documentation and a new\ngit-add test case as well.\n\n---\n\n [In my tree on the git-add-dash-dash branch.]\n\n Documentation/git-add.txt |    7 ++++++-\n git-add.sh                |    4 ++++\n t/t3700-add.sh            |   22 ++++++++++++++++++++++\n 3 files changed, 32 insertions(+), 1 deletions(-)\n create mode 100755 t/t3700-add.sh\n\naf9363cd7aec2b39ad7ba4594e2c4d4757e8f644\ndiff --git a/Documentation/git-add.txt b/Documentation/git-add.txt\nindex 89e4614..7e29383 100644\n--- a/Documentation/git-add.txt\n+++ b/Documentation/git-add.txt\n@@ -7,7 +7,7 @@ git-add - Add files to the index file.\n \n SYNOPSIS\n --------\n-'git-add' [-n] [-v] <file>...\n+'git-add' [-n] [-v] [--] <file>...\n \n DESCRIPTION\n -----------\n@@ -26,6 +26,11 @@ OPTIONS\n -v::\n         Be verbose.\n \n+--::\n+\tThis option can be used to separate command-line options from\n+\tthe list of files, (useful when filenames might be mistaken\n+\tfor command-line options).\n+\n \n DISCUSSION\n ----------\ndiff --git a/git-add.sh b/git-add.sh\nindex 13fad82..d6a4bc7 100755\n--- a/git-add.sh\n+++ b/git-add.sh\n@@ -14,6 +14,10 @@ while : ; do\n     -v)\n \tverbose=--verbose\n \t;;\n+    --)\n+\tshift\n+\tbreak\n+\t;;\n     -*)\n \tusage\n \t;;\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nnew file mode 100755\nindex 0000000..7c61034\n--- /dev/null\n+++ b/t/t3700-add.sh\n@@ -0,0 +1,22 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2006 Carl D. Worth\n+#\n+\n+test_description='Test of git-add, including the -- option.'\n+\n+. ./test-lib.sh\n+\n+test_expect_success \\\n+    'Test of git-add' \\\n+    'touch foo && git-add foo'\n+\n+test_expect_success \\\n+    'Post-check that foo is in the index' \\\n+    'git-ls-files --error-unmatch foo'\n+\n+test_expect_success \\\n+    'Test that \"git-add -- -q\" works' \\\n+    'touch -- -q && git-add -- -q'\n+\n+test_done\n-- \n1.2.2.g0a5f5-dirty\n\n"}]}