{"thread":{"id":"40917","subject":"[RFC/PATCH 0/8] Untracked cache improvements","startedAt":"2015-12-01T20:31:31Z","lastAt":"2015-12-07T10:32:40Z","messageCount":24,"participants":["Christian Couder","Torsten Bögershausen","Ævar Arnfjörð Bjarmason","Duy Nguyen"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"273865","messageId":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":null,"subject":"[RFC/PATCH 0/8] Untracked cache improvements","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:31Z","receivedAt":"2015-12-01T20:31:31Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Following the discussions on the \"config: add core.trustmtime\"\npatch I previously sent, here is a patch series that tries to\nimprove the untracked cache feature.\n\nThis patch series implements core.untrackedCache instead of\ncore.trustmtime. core.untrackedCache is more complex because\nbasically when it's set to true git should always try to use\nthe untracked cache, and when set to false git should never\nuse it.\n\nPatchs 1/8 and 2/8 add some features that are missing.\nPatchs 3/8, 4/8 and 5/8 are some refactoring to prepare for\npatch 6/8 which implements core.untrackedCache.\n\nUp to patch 6/8 backward compatibility is preserved.\nPatchs 7/8 and 8/8 are trying to improve usability by making\nthe untracked cache cli and config options more in line with\nother git cli and config options, but this sacrifies some\nbackward compatibility.\n\nChristian Couder (8):\n  update-index: add untracked cache notifications\n  update-index: add --test-untracked-cache\n  update-index: move 'uc' var declaration\n  dir: add add_untracked_cache()\n  dir: add remove_untracked_cache()\n  config: add core.untrackedCache\n  update-index: prevent --untracked-cache from performing tests\n  update-index: make core.untrackedCache a bool\n\n Documentation/config.txt               | 10 +++++++++\n Documentation/git-update-index.txt     | 30 +++++++++++++++++++-------\n builtin/update-index.c                 | 39 ++++++++++++++++------------------\n cache.h                                |  1 +\n config.c                               |  4 ++++\n contrib/completion/git-completion.bash |  1 +\n dir.c                                  | 22 ++++++++++++++++++-\n dir.h                                  |  2 ++\n environment.c                          |  1 +\n t/t7063-status-untracked-cache.sh      |  2 +-\n wt-status.c                            |  9 ++++++++\n 11 files changed, 90 insertions(+), 31 deletions(-)\n\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273867","messageId":"1449001899-18956-2-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 1/8] update-index: add untracked cache notifications","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:32Z","receivedAt":"2015-12-01T20:31:32Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Doing:\n\n  cd /tmp\n  git --git-dir=/git/somewhere/else/.git update-index --untracked-cache\n\ndoesn't work how one would expect. It hardcodes \"/tmp\" as the directory\nthat \"works\" into the index, so if you use the working tree, you'll\nnever use the untracked cache.\n\nWith this patch \"git update-index --untracked-cache\" tells the user in\nwhich directory tests are performed and in which working directory the\nuntracked cache is allowed.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/update-index.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex 7431938..e568acc 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -121,7 +121,7 @@ static int test_if_untracked_cache_is_supported(void)\n \tif (!mkdtemp(mtime_dir.buf))\n \t\tdie_errno(\"Could not make temporary directory\");\n \n-\tfprintf(stderr, _(\"Testing \"));\n+\tfprintf(stderr, _(\"Testing mtime in '%s' \"), xgetcwd());\n \tatexit(remove_test_directory);\n \txstat_mtime_dir(&st);\n \tfill_stat_data(&base, &st);\n@@ -1122,9 +1122,11 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t}\n \t\tadd_untracked_ident(the_index.untracked);\n \t\tthe_index.cache_changed |= UNTRACKED_CHANGED;\n+\t\tfprintf(stderr, _(\"Untracked cache enabled for '%s'\\n\"), get_git_work_tree());\n \t} else if (!untracked_cache && the_index.untracked) {\n \t\tthe_index.untracked = NULL;\n \t\tthe_index.cache_changed |= UNTRACKED_CHANGED;\n+\t\tfprintf(stderr, _(\"Untracked disabled\\n\"));\n \t}\n \n \tif (active_cache_changed) {\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273866","messageId":"1449001899-18956-3-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 2/8] update-index: add --test-untracked-cache","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:33Z","receivedAt":"2015-12-01T20:31:33Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"It is nice to just be able to test if untracked cache is\nsupported without enabling it.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/git-update-index.txt | 9 ++++++++-\n builtin/update-index.c             | 8 ++++++--\n 2 files changed, 14 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 3df9c26..0ff7396 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -17,7 +17,7 @@ SYNOPSIS\n \t     [--[no-]assume-unchanged]\n \t     [--[no-]skip-worktree]\n \t     [--ignore-submodules]\n-\t     [--[no-|force-]untracked-cache]\n+\t     [--[no-|test-|force-]untracked-cache]\n \t     [--really-refresh] [--unresolve] [--again | -g]\n \t     [--info-only] [--index-info]\n \t     [-z] [--stdin] [--index-version <n>]\n@@ -179,6 +179,13 @@ may not support it yet.\n \tsystem must change `st_mtime` field of a directory if files\n \tare added or deleted in that directory.\n \n+--test-untracked-cache::\n+\tOnly perform tests on the working directory to make sure\n+\tuntracked cache can be used. You have to manually enable\n+\tuntracked cache using `--force-untracked-cache` (or\n+\t`--untracked-cache` but this will run the tests again)\n+\tafterwards if you really want to use it.\n+\n --force-untracked-cache::\n \tFor safety, `--untracked-cache` performs tests on the working\n \tdirectory to make sure untracked cache can be used. These\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex e568acc..b7b5108 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -996,8 +996,10 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t\tN_(\"enable or disable split index\")),\n \t\tOPT_BOOL(0, \"untracked-cache\", &untracked_cache,\n \t\t\tN_(\"enable/disable untracked cache\")),\n+\t\tOPT_SET_INT(0, \"test-untracked-cache\", &untracked_cache,\n+\t\t\t    N_(\"test if the filesystem supports untracked cache\"), 2),\n \t\tOPT_SET_INT(0, \"force-untracked-cache\", &untracked_cache,\n-\t\t\t    N_(\"enable untracked cache without testing the filesystem\"), 2),\n+\t\t\t    N_(\"enable untracked cache without testing the filesystem\"), 3),\n \t\tOPT_END()\n \t};\n \n@@ -1107,10 +1109,12 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \tif (untracked_cache > 0) {\n \t\tstruct untracked_cache *uc;\n \n-\t\tif (untracked_cache < 2) {\n+\t\tif (untracked_cache < 3) {\n \t\t\tsetup_work_tree();\n \t\t\tif (!test_if_untracked_cache_is_supported())\n \t\t\t\treturn 1;\n+\t\t\tif (untracked_cache == 2)\n+\t\t\t\treturn 0;\n \t\t}\n \t\tif (!the_index.untracked) {\n \t\t\tuc = xcalloc(1, sizeof(*uc));\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273869","messageId":"1449001899-18956-4-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 3/8] update-index: move 'uc' var declaration","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:34Z","receivedAt":"2015-12-01T20:31:34Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/update-index.c | 4 +---\n 1 file changed, 1 insertion(+), 3 deletions(-)\n\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex b7b5108..b54ddc3 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -1107,8 +1107,6 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\tthe_index.cache_changed |= SOMETHING_CHANGED;\n \t}\n \tif (untracked_cache > 0) {\n-\t\tstruct untracked_cache *uc;\n-\n \t\tif (untracked_cache < 3) {\n \t\t\tsetup_work_tree();\n \t\t\tif (!test_if_untracked_cache_is_supported())\n@@ -1117,7 +1115,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t\t\treturn 0;\n \t\t}\n \t\tif (!the_index.untracked) {\n-\t\t\tuc = xcalloc(1, sizeof(*uc));\n+\t\t\tstruct untracked_cache *uc = xcalloc(1, sizeof(*uc));\n \t\t\tstrbuf_init(&uc->ident, 100);\n \t\t\tuc->exclude_per_dir = \".gitignore\";\n \t\t\t/* should be the same flags used by git-status */\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273868","messageId":"1449001899-18956-5-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 4/8] dir: add add_untracked_cache()","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:35Z","receivedAt":"2015-12-01T20:31:35Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This new function will be used in a later patch.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/update-index.c | 11 +----------\n dir.c                  | 14 ++++++++++++++\n dir.h                  |  1 +\n 3 files changed, 16 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex b54ddc3..ec67d14 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -1114,16 +1114,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\t\tif (untracked_cache == 2)\n \t\t\t\treturn 0;\n \t\t}\n-\t\tif (!the_index.untracked) {\n-\t\t\tstruct untracked_cache *uc = xcalloc(1, sizeof(*uc));\n-\t\t\tstrbuf_init(&uc->ident, 100);\n-\t\t\tuc->exclude_per_dir = \".gitignore\";\n-\t\t\t/* should be the same flags used by git-status */\n-\t\t\tuc->dir_flags = DIR_SHOW_OTHER_DIRECTORIES | DIR_HIDE_EMPTY_DIRECTORIES;\n-\t\t\tthe_index.untracked = uc;\n-\t\t}\n-\t\tadd_untracked_ident(the_index.untracked);\n-\t\tthe_index.cache_changed |= UNTRACKED_CHANGED;\n+\t\tadd_untracked_cache();\n \t\tfprintf(stderr, _(\"Untracked cache enabled for '%s'\\n\"), get_git_work_tree());\n \t} else if (!untracked_cache && the_index.untracked) {\n \t\tthe_index.untracked = NULL;\ndiff --git a/dir.c b/dir.c\nindex d2a8f06..0f7e293 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -1938,6 +1938,20 @@ void add_untracked_ident(struct untracked_cache *uc)\n \tstrbuf_addch(&uc->ident, 0);\n }\n \n+void add_untracked_cache(void)\n+{\n+\tif (!the_index.untracked) {\n+\t\tstruct untracked_cache *uc = xcalloc(1, sizeof(*uc));\n+\t\tstrbuf_init(&uc->ident, 100);\n+\t\tuc->exclude_per_dir = \".gitignore\";\n+\t\t/* should be the same flags used by git-status */\n+\t\tuc->dir_flags = DIR_SHOW_OTHER_DIRECTORIES | DIR_HIDE_EMPTY_DIRECTORIES;\n+\t\tthe_index.untracked = uc;\n+\t}\n+\tadd_untracked_ident(the_index.untracked);\n+\tthe_index.cache_changed |= UNTRACKED_CHANGED;\n+}\n+\n static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *dir,\n \t\t\t\t\t\t      int base_len,\n \t\t\t\t\t\t      const struct pathspec *pathspec)\ndiff --git a/dir.h b/dir.h\nindex 7b5855d..ee94c76 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -308,4 +308,5 @@ void free_untracked_cache(struct untracked_cache *);\n struct untracked_cache *read_untracked_extension(const void *data, unsigned long sz);\n void write_untracked_extension(struct strbuf *out, struct untracked_cache *untracked);\n void add_untracked_ident(struct untracked_cache *);\n+void add_untracked_cache(void);\n #endif\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273870","messageId":"1449001899-18956-6-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 5/8] dir: add remove_untracked_cache()","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:36Z","receivedAt":"2015-12-01T20:31:36Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This new function will be used in a later patch.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n builtin/update-index.c | 3 +--\n dir.c                  | 6 ++++++\n dir.h                  | 1 +\n 3 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex ec67d14..2cbaee0 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -1117,8 +1117,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\tadd_untracked_cache();\n \t\tfprintf(stderr, _(\"Untracked cache enabled for '%s'\\n\"), get_git_work_tree());\n \t} else if (!untracked_cache && the_index.untracked) {\n-\t\tthe_index.untracked = NULL;\n-\t\tthe_index.cache_changed |= UNTRACKED_CHANGED;\n+\t\tremove_untracked_cache();\n \t\tfprintf(stderr, _(\"Untracked disabled\\n\"));\n \t}\n \ndiff --git a/dir.c b/dir.c\nindex 0f7e293..ffc0286 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -1952,6 +1952,12 @@ void add_untracked_cache(void)\n \tthe_index.cache_changed |= UNTRACKED_CHANGED;\n }\n \n+void remove_untracked_cache(void)\n+{\n+\tthe_index.untracked = NULL;\n+\tthe_index.cache_changed |= UNTRACKED_CHANGED;\n+}\n+\n static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *dir,\n \t\t\t\t\t\t      int base_len,\n \t\t\t\t\t\t      const struct pathspec *pathspec)\ndiff --git a/dir.h b/dir.h\nindex ee94c76..3e5114d 100644\n--- a/dir.h\n+++ b/dir.h\n@@ -309,4 +309,5 @@ struct untracked_cache *read_untracked_extension(const void *data, unsigned long\n void write_untracked_extension(struct strbuf *out, struct untracked_cache *untracked);\n void add_untracked_ident(struct untracked_cache *);\n void add_untracked_cache(void);\n+void remove_untracked_cache(void);\n #endif\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273873","messageId":"1449001899-18956-7-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 6/8] config: add core.untrackedCache","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:37Z","receivedAt":"2015-12-01T20:31:37Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"When we know that mtime is fully supported by the environment, we\nmight want the untracked cache to be always used by default without\nany mtime test or kernel version check being performed.\n\nAlso when we know that mtime is not supported by the environment,\nfor example because the repo is shared over a network file system,\nthen we might want 'git update-index --untracked-cache' to fail\nimmediately instead of it testing if it works (because it might\nwork on some systems using the repo over the network file system\nbut not others).\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/config.txt               | 10 ++++++++++\n Documentation/git-update-index.txt     | 11 +++++++++--\n builtin/update-index.c                 | 28 ++++++++++++++++++----------\n cache.h                                |  1 +\n config.c                               | 10 ++++++++++\n contrib/completion/git-completion.bash |  1 +\n dir.c                                  |  2 +-\n environment.c                          |  1 +\n wt-status.c                            |  9 +++++++++\n 9 files changed, 60 insertions(+), 13 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex b4b0194..bf176ff 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -308,6 +308,16 @@ core.trustctime::\n \tcrawlers and some backup systems).\n \tSee linkgit:git-update-index[1]. True by default.\n \n+core.untrackedCache::\n+\tIf unset or set to 'default' or 'check', untracked cache will\n+\tnot be enabled by default and when\n+\t'update-index --untracked-cache' is called, Git will test if\n+\tmtime is working properly before enabling it. If set to false,\n+\tGit will refuse to enable untracked cache even if\n+\t'--force-untracked-cache' is used. If set to true, Git will\n+\tblindly enabled untracked cache by default without testing if\n+\tit works. See linkgit:git-update-index[1].\n+\n core.checkStat::\n \tDetermines which stat fields to match between the index\n \tand work tree. The user can set this to 'default' or\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 0ff7396..4e6078b 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -177,7 +177,10 @@ may not support it yet.\n \tup for commands that involve determining untracked files such\n \tas `git status`. The underlying operating system and file\n \tsystem must change `st_mtime` field of a directory if files\n-\tare added or deleted in that directory.\n+\tare added or deleted in that directory. If you want to always\n+\tenable, or always disable, untracked cache, you can set the\n+\t`core.untrackedCache` configuration variable to 'true' or\n+\t'false' respectively, (see linkgit:git-config[1]).\n \n --test-untracked-cache::\n \tOnly perform tests on the working directory to make sure\n@@ -190,7 +193,9 @@ may not support it yet.\n \tFor safety, `--untracked-cache` performs tests on the working\n \tdirectory to make sure untracked cache can be used. These\n \ttests can take a few seconds. `--force-untracked-cache` can be\n-\tused to skip the tests.\n+\tused to skip the tests. It cannot enable untracked cache if\n+\t`core.untrackedCache` configuration variable is set to false\n+\t(see linkgit:git-config[1]).\n \n \\--::\n \tDo not interpret any more arguments as options.\n@@ -406,6 +411,8 @@ It can be useful when the inode change time is regularly modified by\n something outside Git (file system crawlers and backup systems use\n ctime for marking files processed) (see linkgit:git-config[1]).\n \n+Untracked cache look at `core.untrackedCache` configuration variable\n+(see linkgit:git-config[1]).\n \n SEE ALSO\n --------\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex 2cbaee0..bf697a5 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -1106,19 +1106,27 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\tthe_index.split_index = NULL;\n \t\tthe_index.cache_changed |= SOMETHING_CHANGED;\n \t}\n+\tif (untracked_cache == 2 || (untracked_cache == 1 && use_untracked_cache == -1)) {\n+\t\tsetup_work_tree();\n+\t\tif (!test_if_untracked_cache_is_supported())\n+\t\t\treturn 1;\n+\t\tif (untracked_cache == 2)\n+\t\t\treturn 0;\n+\t}\n \tif (untracked_cache > 0) {\n-\t\tif (untracked_cache < 3) {\n-\t\t\tsetup_work_tree();\n-\t\t\tif (!test_if_untracked_cache_is_supported())\n-\t\t\t\treturn 1;\n-\t\t\tif (untracked_cache == 2)\n-\t\t\t\treturn 0;\n-\t\t}\n+\t\tif (!use_untracked_cache)\n+\t\t\tdie(\"core.untrackedCache is set to false; \"\n+\t\t\t    \"the untracked cache will not be enabled\");\n \t\tadd_untracked_cache();\n \t\tfprintf(stderr, _(\"Untracked cache enabled for '%s'\\n\"), get_git_work_tree());\n-\t} else if (!untracked_cache && the_index.untracked) {\n-\t\tremove_untracked_cache();\n-\t\tfprintf(stderr, _(\"Untracked disabled\\n\"));\n+\t} else if (!untracked_cache) {\n+\t\tif (use_untracked_cache > 0)\n+\t\t\tdie(\"core.untrackedCache is set to true; \"\n+\t\t\t    \"the untracked cache will not be disabled\");\n+\t\tif (the_index.untracked) {\n+\t\t\tremove_untracked_cache();\n+\t\t\tfprintf(stderr, _(\"Untracked disabled\\n\"));\n+\t\t}\n \t}\n \n \tif (active_cache_changed) {\ndiff --git a/cache.h b/cache.h\nindex 736abc0..b27692d 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -601,6 +601,7 @@ extern void set_alternate_index_output(const char *);\n /* Environment bits from configuration mechanism */\n extern int trust_executable_bit;\n extern int trust_ctime;\n+extern int use_untracked_cache;\n extern int check_stat;\n extern int quote_path_fully;\n extern int has_symlinks;\ndiff --git a/config.c b/config.c\nindex 248a21a..7d50f43 100644\n--- a/config.c\n+++ b/config.c\n@@ -691,6 +691,16 @@ static int git_default_core_config(const char *var, const char *value)\n \t\ttrust_ctime = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"core.untrackedcache\")) {\n+\t\tif (!strcasecmp(value, \"default\") || !strcasecmp(value, \"check\"))\n+\t\t\tuse_untracked_cache = -1;\n+\t\telse {\n+\t\t\tuse_untracked_cache = git_config_maybe_bool(var, value);\n+\t\t\tif (use_untracked_cache == -1)\n+\t\t\t\terror(\"unknown core.untrackedCache value '%s'; using default\", value);\n+\t\t}\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(var, \"core.checkstat\")) {\n \t\tif (!strcasecmp(value, \"default\"))\n \t\t\tcheck_stat = 1;\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 482ca84..f23a800 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2038,6 +2038,7 @@ _git_config ()\n \t\tcore.sparseCheckout\n \t\tcore.symlinks\n \t\tcore.trustctime\n+\t\tcore.untrackedCache\n \t\tcore.warnAmbiguousRefs\n \t\tcore.whitespace\n \t\tcore.worktree\ndiff --git a/dir.c b/dir.c\nindex ffc0286..aa07aca 100644\n--- a/dir.c\n+++ b/dir.c\n@@ -2014,7 +2014,7 @@ static struct untracked_cache_dir *validate_untracked_cache(struct dir_struct *d\n \tif (dir->exclude_list_group[EXC_CMDL].nr)\n \t\treturn NULL;\n \n-\tif (!ident_in_untracked(dir->untracked)) {\n+\tif (use_untracked_cache != 1 && !ident_in_untracked(dir->untracked)) {\n \t\twarning(_(\"Untracked cache is disabled on this system.\"));\n \t\treturn NULL;\n \t}\ndiff --git a/environment.c b/environment.c\nindex 2da7fe2..8f631a1 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -14,6 +14,7 @@\n \n int trust_executable_bit = 1;\n int trust_ctime = 1;\n+int use_untracked_cache = -1;\n int check_stat = 1;\n int has_symlinks = 1;\n int minimum_abbrev = 4, default_abbrev = 7;\ndiff --git a/wt-status.c b/wt-status.c\nindex 435fc28..3e0fe02 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -586,6 +586,15 @@ static void wt_status_collect_untracked(struct wt_status *s)\n \t\tdir.flags |= DIR_SHOW_IGNORED_TOO;\n \telse\n \t\tdir.untracked = the_index.untracked;\n+\n+\tif (!dir.untracked && use_untracked_cache == 1) {\n+\t\tadd_untracked_cache();\n+\t\tdir.untracked = the_index.untracked;\n+\t} else if (dir.untracked && use_untracked_cache == 0) {\n+\t\tremove_untracked_cache();\n+\t\tdir.untracked = NULL;\n+\t}\n+\n \tsetup_standard_excludes(&dir);\n \n \tfill_directory(&dir, &s->pathspec);\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273872","messageId":"1449001899-18956-8-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 7/8] update-index: prevent --untracked-cache from performing tests","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:38Z","receivedAt":"2015-12-01T20:31:38Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"`git update-index --untracked-cache` used to perform tests to\ncheck that the underlying operating system and file system\nchange `st_mtime` field of a directory if files are added or\ndeleted in that directory. But those tests take a long time\nand there is now `--test-untracked-cache` to perform them.\n\nSo to be more consistent with other git commands it's better\nto make `--untracked-cache` not perform them, which is the\npurpose of this patch.\n\nNote that after this patch there is no difference any more\nbetween `--untracked-cache` and `--force-untracked-cache`.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/git-update-index.txt | 31 ++++++++++++++++---------------\n builtin/update-index.c             |  7 ++-----\n t/t7063-status-untracked-cache.sh  |  2 +-\n 3 files changed, 19 insertions(+), 21 deletions(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 4e6078b..5f74cc7 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -175,27 +175,28 @@ may not support it yet.\n --no-untracked-cache::\n \tEnable or disable untracked cache extension. This could speed\n \tup for commands that involve determining untracked files such\n-\tas `git status`. The underlying operating system and file\n-\tsystem must change `st_mtime` field of a directory if files\n-\tare added or deleted in that directory. If you want to always\n-\tenable, or always disable, untracked cache, you can set the\n-\t`core.untrackedCache` configuration variable to 'true' or\n-\t'false' respectively, (see linkgit:git-config[1]).\n+\tas `git status`.\n++\n+The underlying operating system and file system must change `st_mtime`\n+field of a directory if files are added or deleted in that\n+directory. You can test that using\n+`--test-untracked-cache`. `--untracked-cache` used to test that too\n+but it doesn't anymore. If you want to always enable, or always\n+disable, untracked cache, you can set the `core.untrackedCache`\n+configuration variable to 'true' or 'false' respectively, (see\n+linkgit:git-config[1]).\n \n --test-untracked-cache::\n \tOnly perform tests on the working directory to make sure\n \tuntracked cache can be used. You have to manually enable\n-\tuntracked cache using `--force-untracked-cache` (or\n-\t`--untracked-cache` but this will run the tests again)\n-\tafterwards if you really want to use it.\n+\tuntracked cache using `--untracked-cache` or\n+\t`--force-untracked-cache` afterwards if you really want to use\n+\tit.\n \n --force-untracked-cache::\n-\tFor safety, `--untracked-cache` performs tests on the working\n-\tdirectory to make sure untracked cache can be used. These\n-\ttests can take a few seconds. `--force-untracked-cache` can be\n-\tused to skip the tests. It cannot enable untracked cache if\n-\t`core.untrackedCache` configuration variable is set to false\n-\t(see linkgit:git-config[1]).\n+\tSame as `--untracked-cache`. Note that this option cannot\n+\tenable untracked cache if `core.untrackedCache` configuration\n+\tvariable is set to false (see linkgit:git-config[1]).\n \n \\--::\n \tDo not interpret any more arguments as options.\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex bf697a5..fb0ea3d 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -1106,12 +1106,9 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\tthe_index.split_index = NULL;\n \t\tthe_index.cache_changed |= SOMETHING_CHANGED;\n \t}\n-\tif (untracked_cache == 2 || (untracked_cache == 1 && use_untracked_cache == -1)) {\n+\tif (untracked_cache == 2) {\n \t\tsetup_work_tree();\n-\t\tif (!test_if_untracked_cache_is_supported())\n-\t\t\treturn 1;\n-\t\tif (untracked_cache == 2)\n-\t\t\treturn 0;\n+\t\treturn !test_if_untracked_cache_is_supported();\n \t}\n \tif (untracked_cache > 0) {\n \t\tif (!use_untracked_cache)\ndiff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh\nindex 0e8d0d4..8c3e703 100755\n--- a/t/t7063-status-untracked-cache.sh\n+++ b/t/t7063-status-untracked-cache.sh\n@@ -11,7 +11,7 @@ avoid_racy() {\n # It's fine if git update-index returns an error code other than one,\n # it'll be caught in the first test.\n test_lazy_prereq UNTRACKED_CACHE '\n-\t{ git update-index --untracked-cache; ret=$?; } &&\n+\t{ git update-index --test-untracked-cache; ret=$?; } &&\n \ttest $ret -ne 1\n '\n \n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273871","messageId":"1449001899-18956-9-git-send-email-chriscool@tuxfamily.org","threadId":"40917","inReplyTo":"1449001899-18956-1-git-send-email-chriscool@tuxfamily.org","subject":"[RFC/PATCH 8/8] update-index: make core.untrackedCache a bool","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-01T20:31:39Z","receivedAt":"2015-12-01T20:31:39Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Most features in Git can be enabled or disabled using a simple\nbool config variable and it would be nice if untracked cache\nbehaved the same way.\n\nThis makes --[no-|force-]untracked-cache change the value of\ncore.untrackedCache in the repo config file, to avoid making\nthose options useless and because this avoids the untracked\ncache being disabled by a kernel change or a directory\nchange. Of course this breaks some backward compatibility,\nbut the simplification and increased useability is worth it.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/git-update-index.txt | 13 ++++++-------\n builtin/update-index.c             | 10 ++++------\n config.c                           |  8 +-------\n 3 files changed, 11 insertions(+), 20 deletions(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 5f74cc7..256b9c5 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -181,10 +181,11 @@ The underlying operating system and file system must change `st_mtime`\n field of a directory if files are added or deleted in that\n directory. You can test that using\n `--test-untracked-cache`. `--untracked-cache` used to test that too\n-but it doesn't anymore. If you want to always enable, or always\n-disable, untracked cache, you can set the `core.untrackedCache`\n-configuration variable to 'true' or 'false' respectively, (see\n-linkgit:git-config[1]).\n+but it doesn't anymore.\n++\n+This sets the `core.untrackedCache` configuration variable to 'true'\n+or 'false' in the repo config file, (see linkgit:git-config[1]), so\n+that the untracked cache stays enabled or disabled.\n \n --test-untracked-cache::\n \tOnly perform tests on the working directory to make sure\n@@ -194,9 +195,7 @@ linkgit:git-config[1]).\n \tit.\n \n --force-untracked-cache::\n-\tSame as `--untracked-cache`. Note that this option cannot\n-\tenable untracked cache if `core.untrackedCache` configuration\n-\tvariable is set to false (see linkgit:git-config[1]).\n+\tSame as `--untracked-cache`.\n \n \\--::\n \tDo not interpret any more arguments as options.\ndiff --git a/builtin/update-index.c b/builtin/update-index.c\nindex fb0ea3d..048c293 100644\n--- a/builtin/update-index.c\n+++ b/builtin/update-index.c\n@@ -1111,15 +1111,13 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n \t\treturn !test_if_untracked_cache_is_supported();\n \t}\n \tif (untracked_cache > 0) {\n-\t\tif (!use_untracked_cache)\n-\t\t\tdie(\"core.untrackedCache is set to false; \"\n-\t\t\t    \"the untracked cache will not be enabled\");\n+\t\tif (!use_untracked_cache && git_config_set(\"core.untrackedCache\", \"true\"))\n+\t\t\tdie(\"could not set core.untrackedCache to true\");\n \t\tadd_untracked_cache();\n \t\tfprintf(stderr, _(\"Untracked cache enabled for '%s'\\n\"), get_git_work_tree());\n \t} else if (!untracked_cache) {\n-\t\tif (use_untracked_cache > 0)\n-\t\t\tdie(\"core.untrackedCache is set to true; \"\n-\t\t\t    \"the untracked cache will not be disabled\");\n+\t\tif (use_untracked_cache > 0 && git_config_set(\"core.untrackedCache\", \"false\"))\n+\t\t\tdie(\"could not set core.untrackedCache to false\");\n \t\tif (the_index.untracked) {\n \t\t\tremove_untracked_cache();\n \t\t\tfprintf(stderr, _(\"Untracked disabled\\n\"));\ndiff --git a/config.c b/config.c\nindex 7d50f43..f023ee7 100644\n--- a/config.c\n+++ b/config.c\n@@ -692,13 +692,7 @@ static int git_default_core_config(const char *var, const char *value)\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"core.untrackedcache\")) {\n-\t\tif (!strcasecmp(value, \"default\") || !strcasecmp(value, \"check\"))\n-\t\t\tuse_untracked_cache = -1;\n-\t\telse {\n-\t\t\tuse_untracked_cache = git_config_maybe_bool(var, value);\n-\t\t\tif (use_untracked_cache == -1)\n-\t\t\t\terror(\"unknown core.untrackedCache value '%s'; using default\", value);\n-\t\t}\n+\t\tuse_untracked_cache = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"core.checkstat\")) {\n-- \n2.6.3.391.g95a3a5c\n"},{"id":"273902","messageId":"565E99F9.2020906@web.de","threadId":"40917","inReplyTo":"1449001899-18956-7-git-send-email-chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH 6/8] config: add core.untrackedCache","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-12-02T07:12:57Z","receivedAt":"2015-12-02T07:12:57Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 12/01/2015 09:31 PM, Christian Couder wrote:\n> When we know that mtime is fully supported by the environment, we\n> might want the untracked cache to be always used by default without\n> any mtime test or kernel version check being performed.\nI'm not sure if ever \"we know\" ?\nHow can we know without testing ?\nI personaly can not say \"I know\" in all the different system I am using,\nso I always want to test and verify that the untracked cache is working,\nbefore I rely on it.\n\n\n> Also when we know that mtime is not supported by the environment,\n> for example because the repo is shared over a network file system,\n> then we might want 'git update-index --untracked-cache' to fail\n> immediately instead of it testing if it works (because it might\n> work on some systems using the repo over the network file system\n> but not others).\nSame here.\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>   Documentation/config.txt               | 10 ++++++++++\n>   Documentation/git-update-index.txt     | 11 +++++++++--\n>   builtin/update-index.c                 | 28 ++++++++++++++++++----------\n>   cache.h                                |  1 +\n>   config.c                               | 10 ++++++++++\n>   contrib/completion/git-completion.bash |  1 +\n>   dir.c                                  |  2 +-\n>   environment.c                          |  1 +\n>   wt-status.c                            |  9 +++++++++\n>   9 files changed, 60 insertions(+), 13 deletions(-)\n>\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index b4b0194..bf176ff 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -308,6 +308,16 @@ core.trustctime::\n>   \tcrawlers and some backup systems).\n>   \tSee linkgit:git-update-index[1]. True by default.\n>   \n> +core.untrackedCache::\n> +\tIf unset or set to 'default' or 'check', untracked cache will\n> +\tnot be enabled by default and when\n> +\t'update-index --untracked-cache' is called, Git will test if\n> +\tmtime is working properly before enabling it. If set to false,\n> +\tGit will refuse to enable untracked cache even if\n> +\t'--force-untracked-cache' is used. If set to true, Git will\n> +\tblindly enabled untracked cache by default without testing if\n> +\tit works. See linkgit:git-update-index[1].\n> +\nPlease no.\nThe command line option should always be able to overwrite any settings\nfrom a config file.\n\n\nSorry, I may missing the big picture here.\nWhat exactly should be achieved ?\n\nA config variable that should ask Git to always try to use the untracked \ncache ?\nOr a config variable that tells Git to never use the untracked cache ?\nOr a combination ?\n\ncore.untrackedCache::\n  false: Never use the untracked cache ?\n  true: Always try to use the untracked cache ?\n        Try means: probe, and if the probing fails, record that if fails in the index,\n        for this hostname/os/kernel/path (Don't remember all the details)\nunset: As today,\n\n   \n"},{"id":"273907","messageId":"CACBZZX5eQuaYumFcuW6PO_FCrAd3Vqq8gPyg5JeZ4Kk+0YBGRQ@mail.gmail.com","threadId":"40917","inReplyTo":"565E99F9.2020906@web.de","subject":"Re: [RFC/PATCH 6/8] config: add core.untrackedCache","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2015-12-02T10:32:50Z","receivedAt":"2015-12-02T10:32:50Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Wed, Dec 2, 2015 at 8:12 AM, Torsten Bögershausen <tboegi@web.de> wrote:\n> On 12/01/2015 09:31 PM, Christian Couder wrote:\n>>\n>> When we know that mtime is fully supported by the environment, we\n>> might want the untracked cache to be always used by default without\n>> any mtime test or kernel version check being performed.\n>\n\n[Re-arranged some of the quotes for the clarity of my reply....]\n\n[Also: Full disclosure, Christian is working on this for Booking.com,\nand I'm managing that project...]\n\n> I always want to test and verify that the untracked cache is working,\n> before I rely on it.\n\nThen with this patch you can just not use the core.untrackedCache=true\noption, or with the later patches in this series use \"git update-index\n--test-untracked-cache && git config core.untrackedCache true\".\n\n> I'm not sure if ever \"we know\" ?\n> How can we know without testing ?\n> I personaly can not say \"I know\" in all the different system I am using,\n\nSome users of Git can know that their mtime works, just like they know\nthey deploy it on filesystems where say symlinks work.\n\nThe current implementation of turning on this feature needs to be run\non a per-repo basis and without the --force option includes mandatory\ntests, which a) makes it inconvenient to deploy across all Git repos\non a set of machines b) Is needlessly paranoid as a default way to\nenable it.\n\n>> Also when we know that mtime is not supported by the environment,\n>> for example because the repo is shared over a network file system,\n>> then we might want 'git update-index --untracked-cache' to fail\n>> immediately instead of it testing if it works (because it might\n>> work on some systems using the repo over the network file system\n>> but not others).\n>\n> Same here.\n>\n>> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n>> ---\n>>   Documentation/config.txt               | 10 ++++++++++\n>>   Documentation/git-update-index.txt     | 11 +++++++++--\n>>   builtin/update-index.c                 | 28 ++++++++++++++++++----------\n>>   cache.h                                |  1 +\n>>   config.c                               | 10 ++++++++++\n>>   contrib/completion/git-completion.bash |  1 +\n>>   dir.c                                  |  2 +-\n>>   environment.c                          |  1 +\n>>   wt-status.c                            |  9 +++++++++\n>>   9 files changed, 60 insertions(+), 13 deletions(-)\n>>\n>> diff --git a/Documentation/config.txt b/Documentation/config.txt\n>> index b4b0194..bf176ff 100644\n>> --- a/Documentation/config.txt\n>> +++ b/Documentation/config.txt\n>> @@ -308,6 +308,16 @@ core.trustctime::\n>>         crawlers and some backup systems).\n>>         See linkgit:git-update-index[1]. True by default.\n>>   +core.untrackedCache::\n>> +       If unset or set to 'default' or 'check', untracked cache will\n>> +       not be enabled by default and when\n>> +       'update-index --untracked-cache' is called, Git will test if\n>> +       mtime is working properly before enabling it. If set to false,\n>> +       Git will refuse to enable untracked cache even if\n>> +       '--force-untracked-cache' is used. If set to true, Git will\n>> +       blindly enabled untracked cache by default without testing if\n>> +       it works. See linkgit:git-update-index[1].\n>> +\n>\n> Please no.\n> The command line option should always be able to overwrite any settings\n> from a config file.\n\nIf we keep this patch and not the rest in this series (which I think\nshould also be applied) you'd either use the update-index way of\nchanging the setting, or the config option.\n\n> Sorry, I may missing the big picture here.\n> What exactly should be achieved ?\n>\n> A config variable that should ask Git to always try to use the untracked\n> cache ?\n> Or a config variable that tells Git to never use the untracked cache ?\n> Or a combination ?\n>\n> core.untrackedCache::\n>  false: Never use the untracked cache ?\n>  true: Always try to use the untracked cache ?\n>        Try means: probe, and if the probing fails, record that if fails in\n> the index,\n>        for this hostname/os/kernel/path (Don't remember all the details)\n> unset: As today,\n\nAs discussed in the \"[RFC/PATCH] config: add core.trustmtime\" thread\nthis feature is IMO needlessly paranoid about enabling itself.\n\nCurrent state of affairs:\n\n * Enable on a per-repo basis: git update-index --untracked-cache\n * Disable on a per-repo basis: git update-index --no-cache\n * Enable system-wide: N/A\n * Disable system-wide: N/A\n\nWith this patch:\n\n * Enable on a per-repo basis: git update-index --untracked-cache OR\n\"git config core.untrackedCache true\"\n * Disable on a per-repo basis: git update-index --no-cache OR \"git\nconfig core.untrackedCache false\"\n * Enable system-wide: git config --global core.untrackedCache true\n * Disable system-wide: git config --global core.untrackedCache false\n * Caveat: The core.untrackedCache config has precidence over \"git update-index\"\n\nWith the rest of the patches in this series:\n\n * Enable system-wide & per-repo the same, just tweak\ncore.untrackedCache either for the local .git or --globally\n * If you want to test things either per-repo or globally just use\n\"git update-index --test-untracked-cache\"\n * If you want something exactly like the old --untracked-cache do:\n\"git update-index --test-untracked-cache && git config\ncore.untrackedCache true\"\n\nI think applying this whole series makes sense. Enabling this feature\ndoesn't work like anything else in Git, usually you just tweak a\nconfig option and thus can easily enable things either system-wide or\nper-repo (or any combination of the two), which makes both system\nadministration and local configuration easy.\n\nA much saner UI for the CLI tools if we're going to ship git with\ntests for filesystem features is to separate the testing from the\nenabling of those features.\n"},{"id":"273928","messageId":"CACsJy8BWEQNnpoXNBWSmmm-Ff7jJ9=+D6748TMXFyospU7jt1A@mail.gmail.com","threadId":"40917","inReplyTo":"1449001899-18956-2-git-send-email-chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH 1/8] update-index: add untracked cache notifications","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-02T19:16:01Z","receivedAt":"2015-12-02T19:16:01Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Dec 1, 2015 at 9:31 PM, Christian Couder\n<christian.couder@gmail.com> wrote:\n> Doing:\n>\n>   cd /tmp\n>   git --git-dir=/git/somewhere/else/.git update-index --untracked-cache\n>\n> doesn't work how one would expect. It hardcodes \"/tmp\" as the directory\n> that \"works\" into the index, so if you use the working tree, you'll\n> never use the untracked cache.\n>\n> With this patch \"git update-index --untracked-cache\" tells the user in\n> which directory tests are performed and in which working directory the\n> untracked cache is allowed.\n>\n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  builtin/update-index.c | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/builtin/update-index.c b/builtin/update-index.c\n> index 7431938..e568acc 100644\n> --- a/builtin/update-index.c\n> +++ b/builtin/update-index.c\n> @@ -121,7 +121,7 @@ static int test_if_untracked_cache_is_supported(void)\n>         if (!mkdtemp(mtime_dir.buf))\n>                 die_errno(\"Could not make temporary directory\");\n>\n> -       fprintf(stderr, _(\"Testing \"));\n> +       fprintf(stderr, _(\"Testing mtime in '%s' \"), xgetcwd());\n\nWe probably should respect --verbose. I know I violated it in the first place.\n-- \nDuy\n"},{"id":"273929","messageId":"CACsJy8ChATsTatRdz2wM23vfXy_8o1V5FEwMXo+PBqTBzZBBQA@mail.gmail.com","threadId":"40917","inReplyTo":"1449001899-18956-3-git-send-email-chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH 2/8] update-index: add --test-untracked-cache","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-02T19:17:01Z","receivedAt":"2015-12-02T19:17:01Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Dec 1, 2015 at 9:31 PM, Christian Couder\n<christian.couder@gmail.com> wrote:\n> diff --git a/builtin/update-index.c b/builtin/update-index.c\n> index e568acc..b7b5108 100644\n> --- a/builtin/update-index.c\n> +++ b/builtin/update-index.c\n> @@ -996,8 +996,10 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n>                         N_(\"enable or disable split index\")),\n>                 OPT_BOOL(0, \"untracked-cache\", &untracked_cache,\n>                         N_(\"enable/disable untracked cache\")),\n> +               OPT_SET_INT(0, \"test-untracked-cache\", &untracked_cache,\n> +                           N_(\"test if the filesystem supports untracked cache\"), 2),\n>                 OPT_SET_INT(0, \"force-untracked-cache\", &untracked_cache,\n> -                           N_(\"enable untracked cache without testing the filesystem\"), 2),\n> +                           N_(\"enable untracked cache without testing the filesystem\"), 3),\n>                 OPT_END()\n>         };\n\nI think we got enough numbers to start using enum instead.\n-- \nDuy\n"},{"id":"273930","messageId":"CACsJy8BhcrOz=JT=ESoG_Jgf=_4VP+kB7wGoofZ7LoVP_t4Vvw@mail.gmail.com","threadId":"40917","inReplyTo":"1449001899-18956-8-git-send-email-chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH 7/8] update-index: prevent --untracked-cache from performing tests","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-02T19:18:44Z","receivedAt":"2015-12-02T19:18:44Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, Dec 1, 2015 at 9:31 PM, Christian Couder\n<christian.couder@gmail.com> wrote:\n diff --git a/t/t7063-status-untracked-cache.sh\nb/t/t7063-status-untracked-cache.sh\n> index 0e8d0d4..8c3e703 100755\n> --- a/t/t7063-status-untracked-cache.sh\n> +++ b/t/t7063-status-untracked-cache.sh\n> @@ -11,7 +11,7 @@ avoid_racy() {\n>  # It's fine if git update-index returns an error code other than one,\n>  # it'll be caught in the first test.\n\nNotice this comment. You probably have to chance --test-untr.. for the\nfirst test too if it's stilll true, or delete the comment.\n\n>  test_lazy_prereq UNTRACKED_CACHE '\n> -       { git update-index --untracked-cache; ret=$?; } &&\n> +       { git update-index --test-untracked-cache; ret=$?; } &&\n>         test $ret -ne 1\n>  '\n>\n> --\n> 2.6.3.391.g95a3a5c\n>\n\n\n\n-- \nDuy\n"},{"id":"273977","messageId":"5660697D.5090308@web.de","threadId":"40917","inReplyTo":"CACBZZX5eQuaYumFcuW6PO_FCrAd3Vqq8gPyg5JeZ4Kk+0YBGRQ@mail.gmail.com","subject":"Re: [RFC/PATCH 6/8] config: add core.untrackedCache","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-12-03T16:10:37Z","receivedAt":"2015-12-03T16:10:37Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"[snip all good stuff]\n\nFirst of all:\nThanks for explaining it so well\n\nI now can see the point in having this patch.\n(Do the commit messages reflect all this ? I need to re-read)\n\nThe other question is: Do you have patch on a public repo ?\n\nAnd, of course, can we add 1 or 2 test cases ?\n\n\nThanks for pushing this forward.\n"},{"id":"273978","messageId":"CAP8UFD1cbogcojkY1ywTO=+cRb3mFB-d0W5MG4D_1K2vAx2=aw@mail.gmail.com","threadId":"40917","inReplyTo":"5660697D.5090308@web.de","subject":"Re: [RFC/PATCH 6/8] config: add core.untrackedCache","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-03T16:35:08Z","receivedAt":"2015-12-03T16:35:08Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Dec 3, 2015 at 5:10 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n> [snip all good stuff]\n>\n> First of all:\n> Thanks for explaining it so well\n>\n> I now can see the point in having this patch.\n> (Do the commit messages reflect all this ? I need to re-read)\n\nMaybe not. I will have a look at improving them, but your re-reading is welcome.\n\n> The other question is: Do you have patch on a public repo ?\n\nYes, here: https://github.com/chriscool/git/commits/uc-notifs8\n\n> And, of course, can we add 1 or 2 test cases ?\n\nYes I had planned to add tests for this.\nBut it would be nice if I could know first if the last two patches are\nconsidered ok even though they are breaking compatibility a bit.\nIn this case I could squash them with previous patches and only write\ntests for the resulting patches.\n\n> Thanks for pushing this forward.\n\nThanks for your reviews,\nChristian.\n"},{"id":"274011","messageId":"5661D340.2010305@web.de","threadId":"40917","inReplyTo":"CACBZZX5eQuaYumFcuW6PO_FCrAd3Vqq8gPyg5JeZ4Kk+0YBGRQ@mail.gmail.com","subject":"Re: [RFC/PATCH 6/8] config: add core.untrackedCache","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-12-04T17:54:08Z","receivedAt":"2015-12-04T17:54:08Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"> Current state of affairs:\n> \n>  * Enable on a per-repo basis: git update-index --untracked-cache\n>  * Disable on a per-repo basis: git update-index --no-cache\n>  * Enable system-wide: N/A\n>  * Disable system-wide: N/A\n> \n> With this patch:\n> \n>  * Enable on a per-repo basis: git update-index --untracked-cache OR\n> \"git config core.untrackedCache true\"\n>  * Disable on a per-repo basis: git update-index --no-cache OR \"git\n> config core.untrackedCache false\"\n>  * Enable system-wide: git config --global core.untrackedCache true\n>  * Disable system-wide: git config --global core.untrackedCache false\n>  * Caveat: The core.untrackedCache config has precidence over \"git update-index\"\n> \n> With the rest of the patches in this series:\n> \n>  * Enable system-wide & per-repo the same, just tweak\n> core.untrackedCache either for the local .git or --globally\n>  * If you want to test things either per-repo or globally just use\n> \"git update-index --test-untracked-cache\"\n>  * If you want something exactly like the old --untracked-cache do:\n> \"git update-index --test-untracked-cache && git config\n> core.untrackedCache true\"\n> \n> I think applying this whole series makes sense. Enabling this feature\n> doesn't work like anything else in Git, usually you just tweak a\n> config option and thus can easily enable things either system-wide or\n> per-repo (or any combination of the two), which makes both system\n> administration and local configuration easy.\n> \n> A much saner UI for the CLI tools if we're going to ship git with\n> tests for filesystem features is to separate the testing from the\n> enabling of those features.\n\nMy spontanous feeling: squash 6-8 together and add this nice explanation\nto the commit message.\n"},{"id":"274017","messageId":"CAP8UFD2dHGR-C8u4+sbNFt9EqcLDDHY_ydBjRvzMb2uWjmKEuA@mail.gmail.com","threadId":"40917","inReplyTo":"5661D340.2010305@web.de","subject":"Re: [RFC/PATCH 6/8] config: add core.untrackedCache","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-04T19:44:34Z","receivedAt":"2015-12-04T19:44:34Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Fri, Dec 4, 2015 at 6:54 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n>> Current state of affairs:\n>>\n>>  * Enable on a per-repo basis: git update-index --untracked-cache\n>>  * Disable on a per-repo basis: git update-index --no-cache\n>>  * Enable system-wide: N/A\n>>  * Disable system-wide: N/A\n>>\n>> With this patch:\n>>\n>>  * Enable on a per-repo basis: git update-index --untracked-cache OR\n>> \"git config core.untrackedCache true\"\n>>  * Disable on a per-repo basis: git update-index --no-cache OR \"git\n>> config core.untrackedCache false\"\n>>  * Enable system-wide: git config --global core.untrackedCache true\n>>  * Disable system-wide: git config --global core.untrackedCache false\n>>  * Caveat: The core.untrackedCache config has precidence over \"git update-index\"\n>>\n>> With the rest of the patches in this series:\n>>\n>>  * Enable system-wide & per-repo the same, just tweak\n>> core.untrackedCache either for the local .git or --globally\n>>  * If you want to test things either per-repo or globally just use\n>> \"git update-index --test-untracked-cache\"\n>>  * If you want something exactly like the old --untracked-cache do:\n>> \"git update-index --test-untracked-cache && git config\n>> core.untrackedCache true\"\n>>\n>> I think applying this whole series makes sense. Enabling this feature\n>> doesn't work like anything else in Git, usually you just tweak a\n>> config option and thus can easily enable things either system-wide or\n>> per-repo (or any combination of the two), which makes both system\n>> administration and local configuration easy.\n>>\n>> A much saner UI for the CLI tools if we're going to ship git with\n>> tests for filesystem features is to separate the testing from the\n>> enabling of those features.\n>\n> My spontanous feeling: squash 6-8 together and add this nice explanation\n> to the commit message.\n\nOk, I will do that then.\n"},{"id":"274054","messageId":"5662DC2C.8030009@web.de","threadId":"40917","inReplyTo":"1449001899-18956-9-git-send-email-chriscool@tuxfamily.org","subject":"Re: [RFC/PATCH 8/8] update-index: make core.untrackedCache a bool","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-12-05T12:44:28Z","receivedAt":"2015-12-05T12:44:28Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 01.12.15 21:31, Christian Couder wrote:\n> Most features in Git can be enabled or disabled using a simple\n> bool config variable and it would be nice if untracked cache\n> behaved the same way.\n> \n> This makes --[no-|force-]untracked-cache change the value of\n> core.untrackedCache in the repo config file, to avoid making\n> those options useless and because this avoids the untracked\n> cache being disabled by a kernel change or a directory\n> change. Of course this breaks some backward compatibility,\n> but the simplification and increased useability is worth it.\n\nSome loose thinking, how the core.untrackedcache and the\ncommand line can work together:\n\ncore.untrackedcache = unset\n  everything is as today\n  if --test-untracked-cache is used on command line,\n  the test is run, additionally the result is stored\n  in the config variable core.untrackedcache\n\ncore.untrackedcache = true\n  same as --force-untracked-cache\n  if --no-untracked-cache is given on command line,\n  this has higher priority\n\ncore.untrackedcache = false\n  same as --no-untracked-cache\n  if --force-untracked-cache is given on command line,\n  this has higher priority\n\nDoes this support the workflow described by Ævar ?\n"},{"id":"274098","messageId":"CAP8UFD0Dp9KD=EqjSC4O3Gz=QcY11BuN0YC0ChN7mMjWc1LMyg@mail.gmail.com","threadId":"40917","inReplyTo":"CACsJy8BhcrOz=JT=ESoG_Jgf=_4VP+kB7wGoofZ7LoVP_t4Vvw@mail.gmail.com","subject":"Re: [RFC/PATCH 7/8] update-index: prevent --untracked-cache from performing tests","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-07T05:40:14Z","receivedAt":"2015-12-07T05:40:14Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Wed, Dec 2, 2015 at 8:18 PM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Tue, Dec 1, 2015 at 9:31 PM, Christian Couder\n> <christian.couder@gmail.com> wrote:\n>  diff --git a/t/t7063-status-untracked-cache.sh\n> b/t/t7063-status-untracked-cache.sh\n>> index 0e8d0d4..8c3e703 100755\n>> --- a/t/t7063-status-untracked-cache.sh\n>> +++ b/t/t7063-status-untracked-cache.sh\n>> @@ -11,7 +11,7 @@ avoid_racy() {\n>>  # It's fine if git update-index returns an error code other than one,\n>>  # it'll be caught in the first test.\n>\n> Notice this comment. You probably have to chance --test-untr.. for the\n> first test too if it's stilll true, or delete the comment.\n\nOk, I think I will remove the comment and still use \"git update-index\n--untracked-cache\" in the first test.\n\n>>  test_lazy_prereq UNTRACKED_CACHE '\n>> -       { git update-index --untracked-cache; ret=$?; } &&\n>> +       { git update-index --test-untracked-cache; ret=$?; } &&\n>>         test $ret -ne 1\n>>  '\n\nThanks,\nChristian.\n"},{"id":"274102","messageId":"CAP8UFD3qN-_OcdmuaGBAMBToQqf5c2pB+Dvdh3JPb9+S6m3vsQ@mail.gmail.com","threadId":"40917","inReplyTo":"CACsJy8ChATsTatRdz2wM23vfXy_8o1V5FEwMXo+PBqTBzZBBQA@mail.gmail.com","subject":"Re: [RFC/PATCH 2/8] update-index: add --test-untracked-cache","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-07T06:18:19Z","receivedAt":"2015-12-07T06:18:19Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Wed, Dec 2, 2015 at 8:17 PM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Tue, Dec 1, 2015 at 9:31 PM, Christian Couder\n> <christian.couder@gmail.com> wrote:\n>> diff --git a/builtin/update-index.c b/builtin/update-index.c\n>> index e568acc..b7b5108 100644\n>> --- a/builtin/update-index.c\n>> +++ b/builtin/update-index.c\n>> @@ -996,8 +996,10 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)\n>>                         N_(\"enable or disable split index\")),\n>>                 OPT_BOOL(0, \"untracked-cache\", &untracked_cache,\n>>                         N_(\"enable/disable untracked cache\")),\n>> +               OPT_SET_INT(0, \"test-untracked-cache\", &untracked_cache,\n>> +                           N_(\"test if the filesystem supports untracked cache\"), 2),\n>>                 OPT_SET_INT(0, \"force-untracked-cache\", &untracked_cache,\n>> -                           N_(\"enable untracked cache without testing the filesystem\"), 2),\n>> +                           N_(\"enable untracked cache without testing the filesystem\"), 3),\n>>                 OPT_END()\n>>         };\n>\n> I think we got enough numbers to start using enum instead.\n\nOk, I will use an enum.\n"},{"id":"274105","messageId":"CAP8UFD0w9X+7TfPvW0mPxgU75HMR=1WWb6baJ2YrdNTDETJ6hQ@mail.gmail.com","threadId":"40917","inReplyTo":"CACsJy8BWEQNnpoXNBWSmmm-Ff7jJ9=+D6748TMXFyospU7jt1A@mail.gmail.com","subject":"Re: [RFC/PATCH 1/8] update-index: add untracked cache notifications","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-07T09:08:03Z","receivedAt":"2015-12-07T09:08:03Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Wed, Dec 2, 2015 at 8:16 PM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Tue, Dec 1, 2015 at 9:31 PM, Christian Couder\n> <christian.couder@gmail.com> wrote:\n>> Doing:\n>>\n>>   cd /tmp\n>>   git --git-dir=/git/somewhere/else/.git update-index --untracked-cache\n>>\n>> doesn't work how one would expect. It hardcodes \"/tmp\" as the directory\n>> that \"works\" into the index, so if you use the working tree, you'll\n>> never use the untracked cache.\n>>\n>> With this patch \"git update-index --untracked-cache\" tells the user in\n>> which directory tests are performed and in which working directory the\n>> untracked cache is allowed.\n>>\n>> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n>> ---\n>>  builtin/update-index.c | 4 +++-\n>>  1 file changed, 3 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/builtin/update-index.c b/builtin/update-index.c\n>> index 7431938..e568acc 100644\n>> --- a/builtin/update-index.c\n>> +++ b/builtin/update-index.c\n>> @@ -121,7 +121,7 @@ static int test_if_untracked_cache_is_supported(void)\n>>         if (!mkdtemp(mtime_dir.buf))\n>>                 die_errno(\"Could not make temporary directory\");\n>>\n>> -       fprintf(stderr, _(\"Testing \"));\n>> +       fprintf(stderr, _(\"Testing mtime in '%s' \"), xgetcwd());\n>\n> We probably should respect --verbose. I know I violated it in the first place.\n\nThe verbose help is:\n\n    --verbose             report actions to standard output\n\nso yeah, it is not respected first because the output is on by\ndefault, and second because the output is on stderr instead of stdout.\nAnyway it can be a separate patch or patch series to make it respect\none or both of these points.\n\nI am not very much interested in doing it myself as I think it's\ninteresting to have the output by default especially if the above\npatch is applied. But if people agree that it would be a good thing, I\nwill do it.\n"},{"id":"274106","messageId":"CACsJy8Dd9qVGNOfn-g=Ys_KL=SqRVyAp4Jd67KM64GRvu8gsgQ@mail.gmail.com","threadId":"40917","inReplyTo":"CAP8UFD0w9X+7TfPvW0mPxgU75HMR=1WWb6baJ2YrdNTDETJ6hQ@mail.gmail.com","subject":"Re: [RFC/PATCH 1/8] update-index: add untracked cache notifications","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-12-07T09:12:50Z","receivedAt":"2015-12-07T09:12:50Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, Dec 7, 2015 at 10:08 AM, Christian Couder\n<christian.couder@gmail.com> wrote:\n> On Wed, Dec 2, 2015 at 8:16 PM, Duy Nguyen <pclouds@gmail.com> wrote:\n>>> --- a/builtin/update-index.c\n>>> +++ b/builtin/update-index.c\n>>> @@ -121,7 +121,7 @@ static int test_if_untracked_cache_is_supported(void)\n>>>         if (!mkdtemp(mtime_dir.buf))\n>>>                 die_errno(\"Could not make temporary directory\");\n>>>\n>>> -       fprintf(stderr, _(\"Testing \"));\n>>> +       fprintf(stderr, _(\"Testing mtime in '%s' \"), xgetcwd());\n>>\n>> We probably should respect --verbose. I know I violated it in the first place.\n>\n> The verbose help is:\n>\n>     --verbose             report actions to standard output\n>\n> so yeah, it is not respected first because the output is on by\n> default, and second because the output is on stderr instead of stdout.\n> Anyway it can be a separate patch or patch series to make it respect\n> one or both of these points.\n>\n> I am not very much interested in doing it myself as I think it's\n> interesting to have the output by default especially if the above\n> patch is applied. But if people agree that it would be a good thing, I\n> will do it.\n\nThen we can leave it out. Not important (until people actually complain).\n-- \nDuy\n"},{"id":"274107","messageId":"CAP8UFD3j01UhkGz_Hk=xrLppmz7uLqCvtCDLygXfY=crhUZzFg@mail.gmail.com","threadId":"40917","inReplyTo":"5662DC2C.8030009@web.de","subject":"Re: [RFC/PATCH 8/8] update-index: make core.untrackedCache a bool","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2015-12-07T10:32:40Z","receivedAt":"2015-12-07T10:32:40Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"(Sorry I already sent a private reply to Tosten by mistake.)\n\nOn Sat, Dec 5, 2015 at 1:44 PM, Torsten Bögershausen <tboegi@web.de> wrote:\n> On 01.12.15 21:31, Christian Couder wrote:\n>> Most features in Git can be enabled or disabled using a simple\n>> bool config variable and it would be nice if untracked cache\n>> behaved the same way.\n>>\n>> This makes --[no-|force-]untracked-cache change the value of\n>> core.untrackedCache in the repo config file, to avoid making\n>> those options useless and because this avoids the untracked\n>> cache being disabled by a kernel change or a directory\n>> change. Of course this breaks some backward compatibility,\n>> but the simplification and increased useability is worth it.\n>\n> Some loose thinking, how the core.untrackedcache and the\n> command line can work together:\n>\n> core.untrackedcache = unset\n>   everything is as today\n>   if --test-untracked-cache is used on command line,\n>   the test is run, additionally the result is stored\n>   in the config variable core.untrackedcache\n\nI don't like storing the result in core.untrackedcache as it means\nthat --test-untracked-cache would not just test.\nAnd I agree with Aevar that it's a good thing to be able to completely\nseparate testing and configuring.\n\n> core.untrackedcache = true\n>   same as --force-untracked-cache\n>   if --no-untracked-cache is given on command line,\n>   this has higher priority\n\nI guess you mean that --no-untracked-cache has priority over\n\"core.untrackedcache = true\" without removing this config variable.\nThis means that --no-untracked-cache would only remove the untracked\ncache (UC) from the index.\n\nBut what git should then do the next time \"git status\" is run?\nGit sees that the index does not contain any UC, but it doesn't know\nthat \"git update-index --no-untracked-cache\" has just been run. It\nmight be \"git config core.untrackedcache true\" that has been run last.\n\nIf \"git config core.untrackedcache true\" has been run last, it would\nbe logical to add the UC to the index and use it.\nIf \"git update-index --no-untracked-cache\" has been run last, it would\nbe logical to not add the UC.\n\n> core.untrackedcache = false\n>   same as --no-untracked-cache\n>   if --force-untracked-cache is given on command line,\n>   this has higher priority\n\nThen the same kind of problem happens as above. There is no clear\nsolution about what \"git status\" should do when the state of the index\nconflicts with the value of core.untrackedcache.\n\n> Does this support the workflow described by Ævar ?\n\nI don't think so. I think that when we set \"core.untrackedcache =\ntrue\" we want the UC to be added to the index and used as much as\npossible, because we know that our OS/filesystem supports it.\n\nThis means that using \"git update-index --no-untracked-cache\" when\n\"core.untrackedcache = true\" is set can only have two possible\noutcomes. It could either just die saying that \"core.untrackedcache\"\nis true, or it could just unset \"core.untrackedcache\" or set it to\nfalse (which might mean the same thing).\n"}]}