{"thread":{"id":"2001","subject":"[PATCH] Teach git-ls-files about '--' to denote end of options.","startedAt":"2005-10-02T15:33:38Z","lastAt":"2005-10-02T15:33:38Z","messageCount":1,"participants":["Fredrik Kuivinen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9611","messageId":"20051002153338.GA1685@c165.ib.student.liu.se","threadId":"2001","inReplyTo":null,"subject":"[PATCH] Teach git-ls-files about '--' to denote end of options.","fromName":"Fredrik Kuivinen","fromEmail":"freku045@student.liu.se","sentAt":"2005-10-02T15:33:38Z","receivedAt":"2005-10-02T15:33:38Z","isPatch":true,"sender":{"key":"frekui@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13770967?v=4"},"body":"Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>\n\n\n---\n\n Documentation/git-ls-files.txt |    9 ++++++++-\n ls-files.c                     |    5 ++++-\n 2 files changed, 12 insertions(+), 2 deletions(-)\n\n1d1f81648fe42497daff2e95320698fa22ca6440\ndiff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt\n--- a/Documentation/git-ls-files.txt\n+++ b/Documentation/git-ls-files.txt\n@@ -13,7 +13,7 @@ SYNOPSIS\n \t\t(-[c|d|o|i|s|u|k|m])\\*\n \t\t[-x <pattern>|--exclude=<pattern>]\n \t\t[-X <file>|--exclude-from=<file>]\n-\t\t[--exclude-per-directory=<file>]\n+\t\t[--exclude-per-directory=<file>] [--] [<file>]\\*\n \n DESCRIPTION\n -----------\n@@ -77,6 +77,13 @@ OPTIONS\n \tK\tto be killed\n \t?\tother\n \n+--::\n+\tDo not interpret any more arguments as options.\n+\n+<file>:: \n+\tFiles to show. If no files are given all files which match the other\n+\tspecified criteria are shown.\n+\n Output\n ------\n show files just outputs the filename unless '--stage' is specified in\ndiff --git a/ls-files.c b/ls-files.c\n--- a/ls-files.c\n+++ b/ls-files.c\n@@ -530,7 +530,7 @@ static void verify_pathspec(void)\n static const char ls_files_usage[] =\n \t\"git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* \"\n \t\"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] \"\n-\t\"[ --exclude-per-directory=<filename> ]\";\n+\t\"[ --exclude-per-directory=<filename> ] [--] [<file>]*\";\n \n int main(int argc, const char **argv)\n {\n@@ -544,6 +544,9 @@ int main(int argc, const char **argv)\n \tfor (i = 1; i < argc; i++) {\n \t\tconst char *arg = argv[i];\n \n+\t\tif (!strcmp(arg, \"--\")) {\n+\t\t\tbreak;\n+\t\t}\n \t\tif (!strcmp(arg, \"-z\")) {\n \t\t\tline_terminator = 0;\n \t\t\tcontinue;\n"}]}