{"thread":{"id":"13687","subject":"[PATCH] Ensure that commit/status don't stat all files when core.ignoreStat = true","startedAt":"2008-05-27T09:29:09Z","lastAt":"2008-05-31T06:41:34Z","messageCount":11,"participants":["Marius Storm-Olsen","Junio C Hamano","Simon Hausmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77841","messageId":"1211880549-15758-1-git-send-email-marius@trolltech.com","threadId":"13687","inReplyTo":null,"subject":"[PATCH] Ensure that commit/status don't stat all files when core.ignoreStat = true","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-27T09:29:09Z","receivedAt":"2008-05-27T09:29:09Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"The core.ignoreStat option is used to assume that files in the\nindex are unchanged, thus avoiding expensive lstat()s on slow\nsystems. However, due to refresh_cache_ent still stating but\nignoring the info, and the listing of untracked files in\ncommit/status, we would still lstat() all the files.\n\nThis change shortcuts the refresh_cache_ent(), and makes\ncommit/status not list untracked files, unless the -u option\nis specified.\n\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\n---\n read-cache.c |   10 ++++++++++\n wt-status.c  |   11 ++++++++++-\n 2 files changed, 20 insertions(+), 1 deletions(-)\n\ndiff --git a/read-cache.c b/read-cache.c\nindex 8b467f8..104e387 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -882,6 +882,16 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,\n \tif (ce_uptodate(ce))\n \t\treturn ce;\n \n+\t/*\n+\t * assume_unchanged is used to avoid lstats to check if the\n+\t * file has been modified. When true, the user need to\n+\t * manually update the index.\n+\t */\n+\tif (assume_unchanged) {\n+\t\tce_mark_uptodate(ce);\n+\t\treturn ce;\n+\t}\n+\n \tif (lstat(ce->name, &st) < 0) {\n \t\tif (err)\n \t\t\t*err = errno;\ndiff --git a/wt-status.c b/wt-status.c\nindex a44c543..72db466 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -342,7 +342,14 @@ 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+\n+\tif (assume_unchanged && !s->untracked) {\n+\t\tif (s->commitable)\n+\t\t\tfprintf(s->fp, \"# Untracked files not listed (use -u option to show untracked files)\\n\");\n+\t\t/* !s->commitable message displayed below */\n+\t}\n+\telse\n+\t\twt_status_print_untracked(s);\n \n \tif (s->verbose && !s->is_initial)\n \t\twt_status_print_verbose(s);\n@@ -357,6 +364,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 (assume_unchanged && !s->untracked)\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}\n-- \n1.5.5.1.501.gefb4\n"},{"id":"77880","messageId":"7v7idf1pqy.fsf@gitster.siamese.dyndns.org","threadId":"13687","inReplyTo":"1211880549-15758-1-git-send-email-marius@trolltech.com","subject":"Re: [PATCH] Ensure that commit/status don't stat all files when core.ignoreStat = true","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-27T20:00:37Z","receivedAt":"2008-05-27T20:00:37Z","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> diff --git a/read-cache.c b/read-cache.c\n> index 8b467f8..104e387 100644\n> --- a/read-cache.c\n> +++ b/read-cache.c\n> @@ -882,6 +882,16 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,\n>  \tif (ce_uptodate(ce))\n>  \t\treturn ce;\n>  \n> +\t/*\n> +\t * assume_unchanged is used to avoid lstats to check if the\n> +\t * file has been modified. When true, the user need to\n> +\t * manually update the index.\n> +\t */\n> +\tif (assume_unchanged) {\n> +\t\tce_mark_uptodate(ce);\n> +\t\treturn ce;\n> +\t}\n> +\n\nThe description for core.ignorestat in Documentation/config.txt is quite\nbogus.  That single bit does _not_ determine globally if we lstat(2) or\nnot.  The description in Documentation/git-update-index.txt about it (look\nfor the section \"Using assume unchanged bit\") accurately describes what it\nis meant to do.  The rules are:\n\n - (ce->ce_flags & CE_VALID) is the only thing that decides if we can omit\n   lstat(2) for _that particular path_.  There is no global \"we would\n   never ever run lstat(2)\" option, and core.ignorestat certainly isn't\n   it.\n\n - you can use the assume-unchanged mechanism without setting\n   core.ignorestat.  You flip the CE_VALID bit for selected paths manually\n   and forget about them afterwards, when you would want all of your usual\n   \"active\" changes noticed by git, while skipping lstat(2) overhead in\n   areas you are not interested in.\n\n - when you say \"git update-index\" (or \"git add\") for a path, if you have\n   core.ignorestat set, that path is automatically marked with CE_VALID,\n   so that later lstat(2) will be omitted for that particular path.  IOW,\n   by having core.ignorestat set, you are promising that you are not going\n   to _further_ change the work tree contents _without_ telling git --- or\n   at least you are promising that you _will_ tell git if you change it\n   when it matters.  But you have to tell git at least once what the\n   contents are.\n\nWould it be sufficient for what you are trying to do if you changed that\ntest to something like this?\n\n        /*\n         * CE_VALID means the user promised us that the change to\n         * the work tree does not matter and told us not to worry.\n         */\n\tif (!ignore_valid && (ce->ce_flags & CE_VALID)) {\n        \tce_mark_uptodate(ce);\n\t\treturn ce;\n\t}\n\n> diff --git a/wt-status.c b/wt-status.c\n> index a44c543..72db466 100644\n> --- a/wt-status.c\n> +++ b/wt-status.c\n> @@ -342,7 +342,14 @@ 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> +\n> +\tif (assume_unchanged && !s->untracked) {\n> +\t\tif (s->commitable)\n> +\t\t\tfprintf(s->fp, \"# Untracked files not listed (use -u option to show untracked files)\\n\");\n> +\t\t/* !s->commitable message displayed below */\n> +\t}\n> +\telse\n> +\t\twt_status_print_untracked(s);\n>  \n>  \tif (s->verbose && !s->is_initial)\n>  \t\twt_status_print_verbose(s);\n> @@ -357,6 +364,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 (assume_unchanged && !s->untracked)\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}\n\nThe core.ignorestat variable does not have anything to do with showing\nuntracked files.  It is about \"do we mark the added path as CE_VALID,\nmeaning that we do not have to lstat(2) them?\"  IOW, it is about tracked\nfiles.\n\nWhile it might be useful in certain workflows to ignore untracked files, I\ndo not think it is a good idea to overload such an unrelated meaning to\nthe variable.\n"},{"id":"77882","messageId":"483C6D60.7090705@trolltech.com","threadId":"13687","inReplyTo":"7v7idf1pqy.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Ensure that commit/status don't stat all files when core.ignoreStat = true","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-27T20:21:52Z","receivedAt":"2008-05-27T20:21:52Z","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 27.05.2008 22:00:\n> Marius Storm-Olsen <marius@trolltech.com> writes:\n> The description for core.ignorestat in Documentation/config.txt is quite\n> bogus.  That single bit does _not_ determine globally if we lstat(2) or\n> not.  The description in Documentation/git-update-index.txt about it (look\n> for the section \"Using assume unchanged bit\") accurately describes what it\n> is meant to do.  The rules are:\n\nAha! Thanks for the detailed explanation of core.ignoreStat. Given \nyour description, the patch is certainly bogus.\n\n> Would it be sufficient for what you are trying to do if you changed that\n> test to something like this?\n> \n>         /*\n>          * CE_VALID means the user promised us that the change to\n>          * the work tree does not matter and told us not to worry.\n>          */\n> \tif (!ignore_valid && (ce->ce_flags & CE_VALID)) {\n>         \tce_mark_uptodate(ce);\n> \t\treturn ce;\n> \t}\n\nI'll give it a shot tomorrow, to see how it affects my use-cases.\nThanks.\n\n\n>> diff --git a/wt-status.c b/wt-status.c\n>> index a44c543..72db466 100644\n>> --- a/wt-status.c\n>> +++ b/wt-status.c\n...\n\n> The core.ignorestat variable does not have anything to do with showing\n> untracked files.  It is about \"do we mark the added path as CE_VALID,\n> meaning that we do not have to lstat(2) them?\"  IOW, it is about tracked\n> files.\n> \n> While it might be useful in certain workflows to ignore untracked files, I\n> do not think it is a good idea to overload such an unrelated meaning to\n> the variable.\n\nIndeed. I'll resend a new patch tomorrow with a new variable which \nwill only affect the stat'ing of untracked files, if you think that's \nreasonable. IMO, we certainly need a way of avoiding to stat the whole \nfiletree on commits and status. I mean, that's what you have the -u \noption for, right? :-) In any case, an opt-in feature, of course.\n\nThanks for checking the patch!\n\n--\n.marius\n"},{"id":"78137","messageId":"3088e5a9507aa55ee55f512fb3bd554f1658d2e3.1212152269.git.marius@trolltech.com","threadId":"13687","inReplyTo":"043361f81946d5657217e6be0f22f4df350fd13f.1212152269.git.marius@trolltech.com","subject":"[PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files.","fromName":"Simon Hausmann","fromEmail":"simon@lst.de","sentAt":"2008-05-30T08:54:35Z","receivedAt":"2008-05-30T08:54:35Z","isPatch":true,"sender":{"key":"hausmann@kde.org","avatar":"https://gravatar.com/avatar/bc9aad4fb31dce17eb66e690e7b51fe980c62da3c225c785da35dd806b8da778?d=mp&s=160"},"body":"Determining untracked files can be a very slow operation on large trees. This commit introduces\na configuration variable that makes it possible to disable showing of untracked files by default\nas well as a -U commandline option to override this.\n\nSigned-off-by: Simon Hausmann <simon@lst.de>\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\n---\n Documentation/config.txt     |    5 +++++\n Documentation/git-commit.txt |   11 ++++++++---\n builtin-commit.c             |    1 +\n config.c                     |    7 +++++++\n environment.c                |    1 +\n wt-status.c                  |    7 ++++++-\n wt-status.h                  |    1 +\n 7 files changed, 29 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 5331b45..e42ead0 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -214,6 +214,11 @@ core.ignoreStat::\n \tSee linkgit:git-update-index[1].\n \tFalse by default.\n \n+core.showUntrackedFiles::\n+\tA boolean to enable/disable displaying untracked files in the output\n+\tof linkgit:git-status[1] and linkgit:git-commit[1].\n+\tDefaults to true.\n+\n core.preferSymlinkRefs::\n \tInstead of the default \"symref\" format for HEAD\n \tand other symbolic reference files, use symbolic links.\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex c3c9f5b..a3174e4 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -150,12 +150,17 @@ 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::\n+\tShow untracked files, in the \"Untracked files:\" section of commit\n+\tmessage template.\n+\tThis option overrides the core.showUntrackedFiles\n+\tconfiguration option, and is normally not needed.\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+\tdirectories.  Without this option only its name and\n \ta trailing slash are displayed for each untracked\n-\tdirectory.\n+\tdirectory. This option implies --untracked.\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 b294c1f..28cc170 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -103,6 +103,7 @@ static struct option builtin_commit_options[] = {\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+\tOPT_BOOLEAN('U', \"untracked\", &show_untracked_files, \"show untracked files\"),\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 \ndiff --git a/config.c b/config.c\nindex c2f2bbb..ba3efd1 100644\n--- a/config.c\n+++ b/config.c\n@@ -7,6 +7,7 @@\n  */\n #include \"cache.h\"\n #include \"exec_cmd.h\"\n+#include \"wt-status.h\"\n \n #define MAXNAME (256)\n \n@@ -511,6 +512,12 @@ int git_default_config(const char *var, const char *value, void *dummy)\n \t\t\treturn error(\"Malformed value for %s\", var);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"core.showuntrackedfiles\")) {\n+\t\tif (!value)\n+\t\t\treturn config_error_nonbool(var);\n+\t\tshow_untracked_files = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n \n \t/* Add other config variables here and to Documentation/config.txt. */\n \treturn 0;\ndiff --git a/environment.c b/environment.c\nindex 73feb2d..210ae17 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -41,6 +41,7 @@ enum safe_crlf safe_crlf = SAFE_CRLF_WARN;\n unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;\n enum branch_track git_branch_track = BRANCH_TRACK_REMOTE;\n enum rebase_setup_type autorebase = AUTOREBASE_NEVER;\n+int show_untracked_files = 1;\n \n /* This is set by setup_git_dir_gently() and/or git_default_config() */\n char *git_work_tree_cfg;\ndiff --git a/wt-status.c b/wt-status.c\nindex 5b4d74c..819fe2d 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -347,7 +347,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 +365,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..4b643b4 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -33,5 +33,6 @@ extern int wt_status_use_color;\n extern int wt_status_relative_paths;\n void wt_status_prepare(struct wt_status *s);\n void wt_status_print(struct wt_status *s);\n+extern int show_untracked_files;\n \n #endif /* STATUS_H */\n-- \n1.5.5.GIT\n"},{"id":"78136","messageId":"043361f81946d5657217e6be0f22f4df350fd13f.1212152269.git.marius@trolltech.com","threadId":"13687","inReplyTo":"483C6D60.7090705@trolltech.com","subject":"[PATCH 1/3] Clearify the documentation for core.ignoreStat","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-30T11:14:24Z","receivedAt":"2008-05-30T11:14:24Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"The previous documentation didn't make it clear that the\n\"assume unchanged\" was on per file basis, and not a global\nflag.\n\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\n---\n Documentation/config.txt |   11 +++++++----\n 1 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex c298dc2..5331b45 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -205,10 +205,13 @@ Can be overridden by the 'GIT_PROXY_COMMAND' environment variable\n handling).\n \n core.ignoreStat::\n-\tThe working copy files are assumed to stay unchanged until you\n-\tmark them otherwise manually - Git will not detect the file changes\n-\tby lstat() calls. This is useful on systems where those are very\n-\tslow, such as Microsoft Windows.  See linkgit:git-update-index[1].\n+\tIf true, commands which modify both the working tree and the index\n+\twill mark the updated paths with the \"assume unchanged\" bit in the\n+\tindex. These marked files are then assumed to stay unchanged in the\n+\tworking copy, until you\tmark them otherwise manually - Git will not\n+\tdetect the file changes\tby lstat() calls. This is useful on systems\n+\twhere those are very slow, such as Microsoft Windows.\n+\tSee linkgit:git-update-index[1].\n \tFalse by default.\n \n core.preferSymlinkRefs::\n-- \n1.5.5.GIT\n"},{"id":"78138","messageId":"c581c03d8d8bfc76753018d4399a79b02a057186.1212152269.git.marius@trolltech.com","threadId":"13687","inReplyTo":"3088e5a9507aa55ee55f512fb3bd554f1658d2e3.1212152269.git.marius@trolltech.com","subject":"[PATCH 3/3] Add shortcut in refresh_cache_ent() for marked entries.","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-30T12:38:35Z","receivedAt":"2008-05-30T12:38:35Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"When a cache entry has been marked as CE_VALID, the user has\npromised us that any change in the work tree does not matter.\nJust mark the entry as up-to-date, and continue.\n\nDone-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Marius Storm-Olsen <marius@trolltech.com>\n---\n read-cache.c |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/read-cache.c b/read-cache.c\nindex ac9a8e7..8e5fbb6 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -893,6 +893,15 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,\n \tif (ce_uptodate(ce))\n \t\treturn ce;\n \n+\t/*\n+\t * CE_VALID means the user promised us that the change to\n+\t * the work tree does not matter and told us not to worry.\n+\t */\n+\tif (!ignore_valid && (ce->ce_flags & CE_VALID)) {\n+\t\tce_mark_uptodate(ce);\n+\t\treturn ce;\n+\t}\n+\n \tif (lstat(ce->name, &st) < 0) {\n \t\tif (err)\n \t\t\t*err = errno;\n-- \n1.5.5.GIT\n"},{"id":"78139","messageId":"483FFCDB.9010902@trolltech.com","threadId":"13687","inReplyTo":"3088e5a9507aa55ee55f512fb3bd554f1658d2e3.1212152269.git.marius@trolltech.com","subject":"Re: [PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files.","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-30T13:10:51Z","receivedAt":"2008-05-30T13:10:51Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"(Err.. Sent from me, and should have had a:)\nFrom: Simon Hausmann <simon@lst.de>\n> Determining untracked files can be a very slow operation on large trees. This commit introduces\n> a configuration variable that makes it possible to disable showing of untracked files by default\n> as well as a -U commandline option to override this.\n> \n> Signed-off-by: Simon Hausmann <simon@lst.de>\n> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>\n\nSorry for the confusion...\n\n-- \n.marius [@trolltech.com]\n'if you know what you're doing, it's not research'\n\n"},{"id":"78140","messageId":"483FFDAC.8090606@trolltech.com","threadId":"13687","inReplyTo":"c581c03d8d8bfc76753018d4399a79b02a057186.1212152269.git.marius@trolltech.com","subject":"Re: [PATCH 3/3] Add shortcut in refresh_cache_ent() for marked entries.","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-30T13:14:20Z","receivedAt":"2008-05-30T13:14:20Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Marius Storm-Olsen said the following on 30.05.2008 14:38:\n> When a cache entry has been marked as CE_VALID, the user has\n> promised us that any change in the work tree does not matter.\n> Just mark the entry as up-to-date, and continue.\n> \n> Done-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>\n\nThis patch actually cuts the commit/status time in half for me, on my \nWindows machine, when the whole work tree is validated, and \ncore.ignoreStat == true.\n\n-- \n.marius [@trolltech.com]\n'if you know what you're doing, it's not research'\n\n"},{"id":"78142","messageId":"483FFE1B.1020507@trolltech.com","threadId":"13687","inReplyTo":"3088e5a9507aa55ee55f512fb3bd554f1658d2e3.1212152269.git.marius@trolltech.com","subject":"Re: [PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files.","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-30T13:16:11Z","receivedAt":"2008-05-30T13:16:11Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Simon Hausmann said the following on 30.05.2008 10:54:\n> Determining untracked files can be a very slow operation on large trees. This commit introduces\n> a configuration variable that makes it possible to disable showing of untracked files by default\n> as well as a -U commandline option to override this.\n> \n> Signed-off-by: Simon Hausmann <simon@lst.de>\n> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>\n> ---\n\nThis gives me ~80% improvement on commit/status. Reasonable, since my \nwork tree nearly doubles in size on a full build.\n\n-- \n.marius [@trolltech.com]\n'if you know what you're doing, it's not research'\n\n"},{"id":"78168","messageId":"7viqwvk04y.fsf@gitster.siamese.dyndns.org","threadId":"13687","inReplyTo":"3088e5a9507aa55ee55f512fb3bd554f1658d2e3.1212152269.git.marius@trolltech.com","subject":"Re: [PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-05-30T20:27:57Z","receivedAt":"2008-05-30T20:27:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Simon Hausmann <simon@lst.de> writes:\n\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 5331b45..e42ead0 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -214,6 +214,11 @@ core.ignoreStat::\n>  \tSee linkgit:git-update-index[1].\n>  \tFalse by default.\n>  \n> +core.showUntrackedFiles::\n> +\tA boolean to enable/disable displaying untracked files in the output\n> +\tof linkgit:git-status[1] and linkgit:git-commit[1].\n> +\tDefaults to true.\n> +\n\nThis does not belong to the 'core.*', which is about the low-level\nplumbing.  It perhaps could live in 'status.*' section, but I think you\ncan do better than introducing this as a boolean.\n\n> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\n> index c3c9f5b..a3174e4 100644\n> --- a/Documentation/git-commit.txt\n> +++ b/Documentation/git-commit.txt\n> @@ -150,12 +150,17 @@ 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::\n> +\tShow untracked files, in the \"Untracked files:\" section of commit\n> +\tmessage template.\n> +\tThis option overrides the core.showUntrackedFiles\n> +\tconfiguration option, and is normally not needed.\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> +\tdirectories.  Without this option only its name and\n>  \ta trailing slash are displayed for each untracked\n> -\tdirectory.\n> +\tdirectory. This option implies --untracked.\n\nI wonder if we really need a new option that is half independent to an\nexisting one.\n\nStep back a bit and think.  You have three choice:\n\n (1) Do not show untracked files at all; or\n\n (2) Show untracked but summarize untracked directories; or\n\n (3) Show all untracked files.\n\nWe have had (2) and (3) so far, and you are adding (1) as a new feature.\nHow about allowing -u on the command line to take an optional parameter to\nsay what kind the user wants?  I.e.\n\n        -u=none\t\tshows nothing (i.e. (1))\n        -u=normal\tshows summarized report (i.e. (2))\n\t-u=all\t\tshows all untracked files (i.e. (3))\n\nAnd (3) can also be spelled as \"-u without parameter\"; absense of -u\nanywhere defaults to (2).  That would be the first patch.\n\nThen, in the second patch, you can add support to 'status.showuntracked';\nyou pretend that it is set to 'normal' if it is not defined in the\nconfiguration file.\n\nHmm?\n"},{"id":"78207","messageId":"4840F31E.7090801@trolltech.com","threadId":"13687","inReplyTo":"7viqwvk04y.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files.","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-05-31T06:41:34Z","receivedAt":"2008-05-31T06:41:34Z","isPatch":true,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> I wonder if we really need a new option that is half independent to an\n> existing one.\n...\n>         -u=none\t\tshows nothing (i.e. (1))\n>         -u=normal\tshows summarized report (i.e. (2))\n> \t-u=all\t\tshows all untracked files (i.e. (3))\n...\n> Then, in the second patch, you can add support to 'status.showuntracked';\n> you pretend that it is set to 'normal' if it is not defined in the\n> configuration file.\n> \n> Hmm?\n\nSounds good to me. Will redo the patch. Thanks!\n\n--\n.marius\n\n"}]}