{"thread":{"id":"13780","subject":"[PATCH] Add configuration option for default untracked files mode","startedAt":"2008-06-03T13:09:10Z","lastAt":"2008-06-06T06:56:22Z","messageCount":11,"participants":["Marius Storm-Olsen","Junio C Hamano","Jeff King","しらいしななこ","Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"78495","messageId":"c9062d05cabcbd45657e89b03eac9715a46f8b79.1212498900.git.marius@trolltech.com","threadId":"13780","inReplyTo":"7viqwvk04y.fsf@gitster.siamese.dyndns.org","subject":"[PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-06-03T13:09:10Z","receivedAt":"2008-06-03T13:09:10Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Determining untracked files can be a very slow operation on large trees.\nThis commit adds a <mode> argument, which allows you to avoid showing the\nuntracked files in a repository. Possible options are:\n    none   - Show no untracked files\n    normal - Show untracked files and directories\n    all    - Show all untracked files\n\nIf the optional argument is not specified, the option defaults to 'all'.\n\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\n---\n Documentation/git-commit.txt |   15 +++++++++------\n builtin-commit.c             |   18 +++++++++++++++---\n wt-status.c                  |    8 +++++++-\n wt-status.h                  |    7 +++++++\n 4 files changed, 38 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex c3c9f5b..d8a3aa3 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -150,12 +150,15 @@ but can be used to amend a merge commit.\n \tthe last commit without committing changes that have\n \talready been staged.\n \n--u|--untracked-files::\n-\tShow all untracked files, also those in uninteresting\n-\tdirectories, in the \"Untracked files:\" section of commit\n-\tmessage template.  Without this option only its name and\n-\ta trailing slash are displayed for each untracked\n-\tdirectory.\n+-u[<mode>]|--untracked-files[=<mode>]::\n+\tShow all untracked files.\n+\tThe mode parameter is optional, and is used to specify\n+\tthe handling of untracked files. The possible options are:\n+\t\tnone   - Show no untracked files\n+\t\tnormal - Shows untracked files and directories\n+\t\tall    - Also shows individual files in untracked directories.\n+\tIf the mode parameter is not specified, the defaults is\n+\t'all'.\n \n -v|--verbose::\n \tShow unified diff between the HEAD commit and what\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 90200ed..28db2ba 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -49,7 +49,8 @@ static char *logfile, *force_author, *template_file;\n static char *edit_message, *use_message;\n static char *author_name, *author_email, *author_date;\n static int all, edit_flag, also, interactive, only, amend, signoff;\n-static int quiet, verbose, untracked_files, no_verify, allow_empty;\n+static int quiet, verbose, no_verify, allow_empty;\n+static char *untracked_files_arg;\n /*\n  * The default commit message cleanup mode will remove the lines\n  * beginning with # (shell comments) and leading and trailing\n@@ -102,7 +103,7 @@ static struct option builtin_commit_options[] = {\n \tOPT_BOOLEAN('o', \"only\", &only, \"commit only specified files\"),\n \tOPT_BOOLEAN('n', \"no-verify\", &no_verify, \"bypass pre-commit hook\"),\n \tOPT_BOOLEAN(0, \"amend\", &amend, \"amend previous commit\"),\n-\tOPT_BOOLEAN('u', \"untracked-files\", &untracked_files, \"show all untracked files\"),\n+\t{ OPTION_STRING, 'u', \"untracked-files\", &untracked_files_arg, \"mode\", \"show untracked files, optional modes: all, normal, none. (Default: all)\", PARSE_OPT_OPTARG, NULL, (int)\"all\" },\n \tOPT_BOOLEAN(0, \"allow-empty\", &allow_empty, \"ok to record an empty change\"),\n \tOPT_STRING(0, \"cleanup\", &cleanup_arg, \"default\", \"how to strip spaces and #comments from message\"),\n \n@@ -347,7 +348,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int\n \t\ts.reference = \"HEAD^1\";\n \t}\n \ts.verbose = verbose;\n-\ts.untracked = untracked_files;\n+\ts.untracked = (show_untracked_files == ALL_UNTRACKED);\n \ts.index_file = index_file;\n \ts.fp = fp;\n \ts.nowarn = nowarn;\n@@ -795,6 +796,17 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \telse\n \t\tdie(\"Invalid cleanup mode %s\", cleanup_arg);\n \n+\tif (!untracked_files_arg)\n+\t\t; /* default already initialized */\n+\telse if (!strcmp(untracked_files_arg, \"none\"))\n+\t\tshow_untracked_files = NONE_UNTRACKED;\n+\telse if (!strcmp(untracked_files_arg, \"normal\"))\n+\t\tshow_untracked_files = NORMAL_UNTRACKED;\n+\telse if (!strcmp(untracked_files_arg, \"all\"))\n+\t\tshow_untracked_files = ALL_UNTRACKED;\n+\telse\n+\t\tdie(\"Invalid untracked files mode '%s'\", untracked_files_arg);\n+\n \tif (all && argc > 0)\n \t\tdie(\"Paths with -a does not make sense.\");\n \telse if (interactive && argc > 0)\ndiff --git a/wt-status.c b/wt-status.c\nindex 5b4d74c..742a474 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -27,6 +27,7 @@ static const char use_add_rm_msg[] =\n \"use \\\"git add/rm <file>...\\\" to update what will be committed\";\n static const char use_add_to_include_msg[] =\n \"use \\\"git add <file>...\\\" to include in what will be committed\";\n+enum untracked_status_type show_untracked_files = NORMAL_UNTRACKED;\n \n static int parse_status_slot(const char *var, int offset)\n {\n@@ -347,7 +348,10 @@ void wt_status_print(struct wt_status *s)\n \twt_status_print_changed(s);\n \tif (wt_status_submodule_summary)\n \t\twt_status_print_submodule_summary(s);\n-\twt_status_print_untracked(s);\n+\tif (show_untracked_files)\n+\t\twt_status_print_untracked(s);\n+\telse if (s->commitable)\n+\t\tfprintf(s->fp, \"# Untracked files not listed (use -u option to show untracked files)\\n\");\n \n \tif (s->verbose && !s->is_initial)\n \t\twt_status_print_verbose(s);\n@@ -362,6 +366,8 @@ void wt_status_print(struct wt_status *s)\n \t\t\tprintf(\"nothing added to commit but untracked files present (use \\\"git add\\\" to track)\\n\");\n \t\telse if (s->is_initial)\n \t\t\tprintf(\"nothing to commit (create/copy files and use \\\"git add\\\" to track)\\n\");\n+\t\telse if (!show_untracked_files)\n+\t\t\tprintf(\"nothing to commit (use -u to show untracked files)\\n\");\n \t\telse\n \t\t\tprintf(\"nothing to commit (working directory clean)\\n\");\n \t}\ndiff --git a/wt-status.h b/wt-status.h\nindex 597c7ea..343d975 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -11,6 +11,13 @@ enum color_wt_status {\n \tWT_STATUS_NOBRANCH,\n };\n \n+enum untracked_status_type {\n+\tNONE_UNTRACKED,\n+\tNORMAL_UNTRACKED,\n+\tALL_UNTRACKED\n+};\n+extern enum untracked_status_type show_untracked_files;\n+\n struct wt_status {\n \tint is_initial;\n \tchar *branch;\n-- \n1.5.5.GIT\n"},{"id":"78494","messageId":"de684211037cc61f1e0510fcf38a51f571765efd.1212498900.git.marius@trolltech.com","threadId":"13780","inReplyTo":"c9062d05cabcbd45657e89b03eac9715a46f8b79.1212498900.git.marius@trolltech.com","subject":"[PATCH] Add configuration option for default untracked files mode","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-06-03T13:12:50Z","receivedAt":"2008-06-03T13:12:50Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"By default, the untracked files mode for commit/status is 'normal'.\n\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\n---\n Documentation/config.txt     |   15 +++++++++++++++\n Documentation/git-commit.txt |    4 +++-\n wt-status.c                  |   13 +++++++++++++\n 3 files changed, 31 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 5331b45..12c0be3 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1013,6 +1013,21 @@ status.relativePaths::\n \trelative to the repository root (this was the default for git\n \tprior to v1.5.4).\n \n+status.showUntrackedFiles::\n+\tBy default, linkgit:git-status[1] and linkgit:git-commit[1] show\n+\tfiles which are not currently tracked by Git. Directories which\n+\tcontain only untracked files, are shown with the directory name\n+\tonly. Showing untracked files means that Git needs to lstat() all\n+\tall the files in the whole repository, which might be slow on some\n+\tsystems. So, this variable controls how the commands displays\n+\tthe untracked files. Possible values are:\n+\t\tnone   - Show no untracked files\n+\t\tnormal - Shows untracked files and directories\n+\t\tall    - Shows also individual files in untracked directories.\n+\tIf this variable is not specified, it defaults to 'normal'.\n+\tThis variable can be overridden with the -u|--untracked-files option\n+\tof linkgit:git-status[1] and linkgit:git-commit[1].\n+\n tar.umask::\n \tThis variable can be used to restrict the permission bits of\n \ttar archive entries.  The default is 0002, which turns off the\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex d8a3aa3..bcbc2c2 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -158,7 +158,9 @@ but can be used to amend a merge commit.\n \t\tnormal - Shows untracked files and directories\n \t\tall    - Also shows individual files in untracked directories.\n \tIf the mode parameter is not specified, the defaults is\n-\t'all'.\n+\t'all'. See linkgit:git-config[1] for configuration variable\n+\tused to change the default for when the option is not\n+\tspecified.\n \n -v|--verbose::\n \tShow unified diff between the HEAD commit and what\ndiff --git a/wt-status.c b/wt-status.c\nindex 742a474..9ffe1c3 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -397,5 +397,18 @@ int git_status_config(const char *k, const char *v, void *cb)\n \t\twt_status_relative_paths = git_config_bool(k, v);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(k, \"status.showuntrackedfiles\")) {\n+\t\tif (!v)\n+\t\t\treturn config_error_nonbool(v);\n+\t\telse if (!strcmp(v, \"none\"))\n+\t\t\tshow_untracked_files = NONE_UNTRACKED;\n+\t\telse if (!strcmp(v, \"normal\"))\n+\t\t\tshow_untracked_files = NORMAL_UNTRACKED;\n+\t\telse if (!strcmp(v, \"all\"))\n+\t\t\tshow_untracked_files = ALL_UNTRACKED;\n+\t\telse\n+\t\t\treturn error(\"Invalid untracked files mode '%s'\", v);\n+\t\treturn 0;\n+\t}\n \treturn git_color_default_config(k, v, cb);\n }\n-- \n1.5.5.GIT\n"},{"id":"78537","messageId":"7vod6i1e3p.fsf@gitster.siamese.dyndns.org","threadId":"13780","inReplyTo":"c9062d05cabcbd45657e89b03eac9715a46f8b79.1212498900.git.marius@trolltech.com","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-03T20:02:34Z","receivedAt":"2008-06-03T20:02:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marius Storm-Olsen <marius@trolltech.com> writes:\n\n> Determining untracked files can be a very slow operation on large trees.\n> This commit adds a <mode> argument, which allows you to avoid showing the\n> untracked files in a repository. Possible options are:\n>     none   - Show no untracked files\n>     normal - Show untracked files and directories\n>     all    - Show all untracked files\n>\n> If the optional argument is not specified, the option defaults to 'all'.\n\nYou got me worried.  You are defaulting the parameter of \"-u\" to 'all',\nnot making the command default (in the absense of -u anything) to \"-u\nall\", which was what I misunderstood on my first reading.  \"the optional\nparameter defaults to 'all'\" is what you meant...\n\nenum {NONE,NORMAL,ALL}_UNTRACKED are named (1) too generic, in a sense\nthat it is not clear _what_ is done to the class of untracked worktree\nentities, and/or (2) opposite from other enums where common prefix is\nfollowed by differing part.\n\nPerhaps renaming them to SHOW_{NONE,NORMAL,ALL}_UNTRACKED would make it\neasier to read.\n\nIt would have been nicer if this patch was further split into two; the\nfirst one to introduce NORMAL and ALL without changing any behaviour, then\nthe second one to add NONE to introduce a new behaviour, with tests so\nthat other people will not break this new feature in their later changes.\n\n> @@ -150,12 +150,15 @@ but can be used to amend a merge commit.\n>  \tthe last commit without committing changes that have\n>  \talready been staged.\n>  \n> --u|--untracked-files::\n> -\tShow all untracked files, also those in uninteresting\n> -\tdirectories, in the \"Untracked files:\" section of commit\n> -\tmessage template.  Without this option only its name and\n> -\ta trailing slash are displayed for each untracked\n> -\tdirectory.\n> +-u[<mode>]|--untracked-files[=<mode>]::\n> +\tShow all untracked files.\n> +\tThe mode parameter is optional, and is used to specify\n> +\tthe handling of untracked files. The possible options are:\n> +\t\tnone   - Show no untracked files\n> +\t\tnormal - Shows untracked files and directories\n> +\t\tall    - Also shows individual files in untracked directories.\n> +\tIf the mode parameter is not specified, the defaults is\n> +\t'all'.\n\nDoes this mark-up actually work?\n"},{"id":"78539","messageId":"20080603201421.GB17260@sigill.intra.peff.net","threadId":"13780","inReplyTo":"c9062d05cabcbd45657e89b03eac9715a46f8b79.1212498900.git.marius@trolltech.com","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-03T20:14:22Z","receivedAt":"2008-06-03T20:14:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 03, 2008 at 03:09:10PM +0200, Marius Storm-Olsen wrote:\n\n> +-u[<mode>]|--untracked-files[=<mode>]::\n> +\tShow all untracked files.\n> +\tThe mode parameter is optional, and is used to specify\n> +\tthe handling of untracked files. The possible options are:\n> +\t\tnone   - Show no untracked files\n> +\t\tnormal - Shows untracked files and directories\n> +\t\tall    - Also shows individual files in untracked directories.\n> +\tIf the mode parameter is not specified, the defaults is\n> +\t'all'.\n\nHmm. Doesn't this change bundling semantics of \"git commit -us\"? Do we\ncare?\n\n-Peff\n"},{"id":"78550","messageId":"4845B0E7.2090502@trolltech.com","threadId":"13780","inReplyTo":"7vod6i1e3p.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-06-03T21:00:23Z","receivedAt":"2008-06-03T21:00:23Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Junio C Hamano said the following on 03.06.2008 22:02:\n> Marius Storm-Olsen <marius@trolltech.com> writes:\n> \n>> Determining untracked files can be a very slow operation on large trees.\n>> This commit adds a <mode> argument, which allows you to avoid showing the\n>> untracked files in a repository. Possible options are:\n>>     none   - Show no untracked files\n>>     normal - Show untracked files and directories\n>>     all    - Show all untracked files\n>>\n>> If the optional argument is not specified, the option defaults to 'all'.\n> \n> You got me worried.  You are defaulting the parameter of \"-u\" to 'all',\n> not making the command default (in the absense of -u anything) to \"-u\n> all\", which was what I misunderstood on my first reading.  \"the optional\n> parameter defaults to 'all'\" is what you meant...\n\nOk, I'll rewrite it to make it more clear.\n\n> enum {NONE,NORMAL,ALL}_UNTRACKED are named (1) too generic, in a sense\n> that it is not clear _what_ is done to the class of untracked worktree\n> entities, and/or (2) opposite from other enums where common prefix is\n> followed by differing part.\n> \n> Perhaps renaming them to SHOW_{NONE,NORMAL,ALL}_UNTRACKED would make it\n> easier to read.\n\nSure.\n\n> It would have been nicer if this patch was further split into two; the\n> first one to introduce NORMAL and ALL without changing any behaviour, then\n> the second one to add NONE to introduce a new behaviour, with tests so\n> that other people will not break this new feature in their later changes.\n\nOk, will do.\n\n>> @@ -150,12 +150,15 @@ but can be used to amend a merge commit.\n>>  \tthe last commit without committing changes that have\n>>  \talready been staged.\n>>  \n>> --u|--untracked-files::\n>> -\tShow all untracked files, also those in uninteresting\n>> -\tdirectories, in the \"Untracked files:\" section of commit\n>> -\tmessage template.  Without this option only its name and\n>> -\ta trailing slash are displayed for each untracked\n>> -\tdirectory.\n>> +-u[<mode>]|--untracked-files[=<mode>]::\n>> +\tShow all untracked files.\n>> +\tThe mode parameter is optional, and is used to specify\n>> +\tthe handling of untracked files. The possible options are:\n>> +\t\tnone   - Show no untracked files\n>> +\t\tnormal - Shows untracked files and directories\n>> +\t\tall    - Also shows individual files in untracked directories.\n>> +\tIf the mode parameter is not specified, the defaults is\n>> +\t'all'.\n> \n> Does this mark-up actually work?\n\nI haven't actually run it through AsciiDoc. I'll make sure that it \nhandles the next version of the patch(es).\n\nThanks for checking the patches!\n\n--\n.marius\n"},{"id":"78553","messageId":"4845B4E8.1040402@trolltech.com","threadId":"13780","inReplyTo":"20080603201421.GB17260@sigill.intra.peff.net","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-06-03T21:17:28Z","receivedAt":"2008-06-03T21:17:28Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Jeff King said the following on 03.06.2008 22:14:\n> On Tue, Jun 03, 2008 at 03:09:10PM +0200, Marius Storm-Olsen wrote:\n> \n>> +-u[<mode>]|--untracked-files[=<mode>]::\n>> +\tShow all untracked files.\n>> +\tThe mode parameter is optional, and is used to specify\n>> +\tthe handling of untracked files. The possible options are:\n>> +\t\tnone   - Show no untracked files\n>> +\t\tnormal - Shows untracked files and directories\n>> +\t\tall    - Also shows individual files in untracked directories.\n>> +\tIf the mode parameter is not specified, the defaults is\n>> +\t'all'.\n> \n> Hmm. Doesn't this change bundling semantics of \"git commit -us\"? Do we\n> care?\n\nYou are right. This is the joy of the parse-options() handling of \nshort-options with optional arguments.\n\n-us before meant:\n     1) commit\n     2) show all untracked files\n     3) sign-of the commit\n\nI guess it would be possible to reparse the options without the -u, if \nthe argument is not one of the three (none,normal,all), but I'm not \nsure it's _that_ critical. Opinions?\n\n--\n.marius\n"},{"id":"78561","messageId":"200806032227.m53MRLeC005668@mi0.bluebottle.com","threadId":"13780","inReplyTo":"4845B4E8.1040402@trolltech.com","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"しらいしななこ","fromEmail":"nanako3@bluebottle.com","sentAt":"2008-06-03T22:26:48Z","receivedAt":"2008-06-03T22:26:48Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Marius Storm-Olsen <marius@trolltech.com> writes:\n\n> Jeff King said the following on 03.06.2008 22:14:\n>> On Tue, Jun 03, 2008 at 03:09:10PM +0200, Marius Storm-Olsen wrote:\n>>\n>>> +-u[<mode>]|--untracked-files[=<mode>]::\n>>> +\tShow all untracked files.\n>>> +\tThe mode parameter is optional, and is used to specify\n>>> +\tthe handling of untracked files. The possible options are:\n>>> +\t\tnone   - Show no untracked files\n>>> +\t\tnormal - Shows untracked files and directories\n>>> +\t\tall    - Also shows individual files in untracked directories.\n>>> +\tIf the mode parameter is not specified, the defaults is\n>>> +\t'all'.\n>>\n>> Hmm. Doesn't this change bundling semantics of \"git commit -us\"? Do we\n>> care?\n>\n> You are right. This is the joy of the parse-options() handling of\n> short-options with optional arguments.\n>\n> -us before meant:\n>     1) commit\n>     2) show all untracked files\n>     3) sign-of the commit\n>\n> I guess it would be possible to reparse the options without the -u, if\n> the argument is not one of the three (none,normal,all), but I'm not\n> sure it's _that_ critical. Opinions?\n\nIsn't the second bullet point in the description in:\n\n    http://www.kernel.org/pub/software/scm/git/docs/gitcli.html\n\ngood enough?\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n\n----------------------------------------------------------------------\nFind out how you can get spam free email.\nhttp://www.bluebottle.com/tag/3\n"},{"id":"78560","messageId":"20080603222704.GA20256@sigill.intra.peff.net","threadId":"13780","inReplyTo":"4845B4E8.1040402@trolltech.com","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-03T22:27:04Z","receivedAt":"2008-06-03T22:27:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jun 03, 2008 at 11:17:28PM +0200, Marius Storm-Olsen wrote:\n\n> You are right. This is the joy of the parse-options() handling of  \n> short-options with optional arguments.\n>\n> -us before meant:\n>     1) commit\n>     2) show all untracked files\n>     3) sign-of the commit\n>\n> I guess it would be possible to reparse the options without the -u, if  \n> the argument is not one of the three (none,normal,all), but I'm not sure \n> it's _that_ critical. Opinions?\n\nI think it would be reasonable to make \"-u\" mean the same as always, and\nfor \"--untracked-files\" to have an optional argument. There isn't direct\nsupport for that construct in parse_options, but you could just make it\ntwo separate options that happen to tweak the same value (though I guess\nthey would be displayed separately in the auto-generated usage).\n\nSome GNU utils use this strategy to extend existing options. E.g., \"ls\n-p\" comes from XSI and takes no argument, but the long-option form of\n--indicator-style=<none|slash|file-type|classify> gives more options.\n\nThat makes it a little less pleasant to type the extended version, but\ncompatibility is maintained.  Though I tend to wonder about this option\nin particular...isn't this generally a user preference? Should it\nperhaps be found in the config file instead?\n\n-Peff\n"},{"id":"78565","messageId":"20080603225303.GA20877@sigill.intra.peff.net","threadId":"13780","inReplyTo":"200806032227.m53MRLeD005668@mi0.bluebottle.com","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-06-03T22:53:03Z","receivedAt":"2008-06-03T22:53:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 04, 2008 at 07:26:48AM +0900, しらいしななこ wrote:\n\n> > I guess it would be possible to reparse the options without the -u, if\n> > the argument is not one of the three (none,normal,all), but I'm not\n> > sure it's _that_ critical. Opinions?\n> \n> Isn't the second bullet point in the description in:\n> \n>     http://www.kernel.org/pub/software/scm/git/docs/gitcli.html\n> \n> good enough?\n\nAh, that is a fair point. I failed to realize we were telling people\nthat.\n\n-Peff\n"},{"id":"78871","messageId":"20080606063206.GA4181@steel.home","threadId":"13780","inReplyTo":"c9062d05cabcbd45657e89b03eac9715a46f8b79.1212498900.git.marius@trolltech.com","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2008-06-06T06:32:06Z","receivedAt":"2008-06-06T06:32:06Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Marius Storm-Olsen, Tue, Jun 03, 2008 15:09:10 +0200:\n> Determining untracked files can be a very slow operation on large trees.\n> This commit adds a <mode> argument, which allows you to avoid showing the\n> untracked files in a repository. Possible options are:\n>     none   - Show no untracked files\n>     normal - Show untracked files and directories\n>     all    - Show all untracked files\n> \n> If the optional argument is not specified, the option defaults to 'all'.\n\nLooks very familiar:\n\n    http://thread.gmane.org/gmane.comp.version-control.git/66183\n"},{"id":"78873","messageId":"4848DF96.3010007@trolltech.com","threadId":"13780","inReplyTo":"20080606063206.GA4181@steel.home","subject":"Re: [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-06-06T06:56:22Z","receivedAt":"2008-06-06T06:56:22Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Alex Riesen said the following on 06.06.2008 08:32:\n> Marius Storm-Olsen, Tue, Jun 03, 2008 15:09:10 +0200:\n>> Determining untracked files can be a very slow operation on large trees.\n>> This commit adds a <mode> argument, which allows you to avoid showing the\n>> untracked files in a repository. Possible options are:\n>>     none   - Show no untracked files\n>>     normal - Show untracked files and directories\n>>     all    - Show all untracked files\n>>\n>> If the optional argument is not specified, the option defaults to 'all'.\n> \n> Looks very familiar:\n> \n>     http://thread.gmane.org/gmane.comp.version-control.git/66183\n\nSimilar, but not quite. This patch doesn't care about the index, just \nproviding the option to avoid looking for untracked files.\n\nImproving the index handling was done in the other patch\n     Add shortcut in refresh_cache_ent() for marked entries.\n(which is already in master, aa9349d4), so the core.ignoreStat option \nis more effective.\n\n-- \n.marius [@trolltech.com]\n'if you know what you're doing, it's not research'\n\n"}]}