From: Ben Peart <benpeart@microsoft.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, pclouds@gmail.com, chriscool@tuxfamily.org,
Johannes.Schindelin@gmx.de, alexmv@dropbox.com, peff@peff.net,
Ben Peart <benpeart@microsoft.com>
Subject: [PATCH v1 2/4] update-index: add fastindex support to update-index
Date: Thu, 9 Nov 2017 09:17:35 -0500 [thread overview]
Message-ID: <20171109141737.47976-3-benpeart@microsoft.com> (raw)
In-Reply-To: <20171109141737.47976-1-benpeart@microsoft.com>
Add support in update-index to manually add/remove the fastindex
extension via --[no-]fastindex flags.
Signed-off-by: Ben Peart <benpeart@microsoft.com>
---
builtin/update-index.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index fefbe60167..63b7f18807 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -917,6 +917,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
struct refresh_params refresh_args = {0, &has_errors};
int lock_error = 0;
int split_index = -1;
+ int fast_index = -1;
struct lock_file lock_file = LOCK_INIT;
struct parse_opt_ctx_t ctx;
strbuf_getline_fn getline_fn;
@@ -1008,6 +1009,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
N_("test if the filesystem supports untracked cache"), UC_TEST),
OPT_SET_INT(0, "force-untracked-cache", &untracked_cache,
N_("enable untracked cache without testing the filesystem"), UC_FORCE),
+ OPT_BOOL(0, "fastindex", &fast_index,
+ N_("enable or disable fast index parsing")),
OPT_END()
};
@@ -1146,6 +1149,25 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
die("BUG: bad untracked_cache value: %d", untracked_cache);
}
+ if (fast_index > 0) {
+ if (git_config_get_fast_index() == 0)
+ warning(_("core.fastindex is unset; "
+ "set it if you really want to "
+ "enable fastindex"));
+ core_fast_index = 1;
+ active_cache_changed |= SOMETHING_CHANGED;
+ report(_("fastindex enabled"));
+ }
+ else if (!fast_index) {
+ if (git_config_get_fast_index() == 1)
+ warning(_("core.fastindex is set; "
+ "remove it if you really want to "
+ "disable fastindex"));
+ core_fast_index = 0;
+ active_cache_changed |= SOMETHING_CHANGED;
+ report(_("fastindex disabled"));
+ }
+
if (active_cache_changed) {
if (newfd < 0) {
if (refresh_args.flags & REFRESH_QUIET)
--
2.15.0.windows.1
next prev parent reply other threads:[~2017-11-09 14:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 14:17 [PATCH v1 0/4] Speed up index load through parallelization Ben Peart
2017-11-09 14:17 ` [PATCH v1 1/4] fastindex: speed " Ben Peart
2017-11-10 4:46 ` Junio C Hamano
2017-11-13 16:42 ` Ben Peart
2017-11-14 1:10 ` Junio C Hamano
2017-11-14 14:31 ` Ben Peart
2017-11-14 15:04 ` Junio C Hamano
2017-11-14 15:40 ` Ben Peart
2017-11-15 1:12 ` Junio C Hamano
2017-11-15 4:16 ` Ben Peart
2017-11-15 4:40 ` Junio C Hamano
2017-11-20 14:01 ` Ben Peart
2017-11-20 14:20 ` Jeff King
2017-11-20 15:38 ` Jeff King
2017-11-20 23:51 ` Ramsay Jones
2017-11-21 0:45 ` Ben Peart
2017-11-09 14:17 ` Ben Peart [this message]
2017-11-09 14:17 ` [PATCH v1 3/4] fastindex: add test tools and a test script Ben Peart
2017-11-09 14:17 ` [PATCH v1 4/4] fastindex: add documentation for the fastindex extension Ben Peart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171109141737.47976-3-benpeart@microsoft.com \
--to=benpeart@microsoft.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=alexmv@dropbox.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).