git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v6 15/15] Move core_partial_clone_filter_default to promisor-remote.c

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 25, 2019, 13:40 UTC
Message-ID
<20190625134039.21707-16-chriscool@tuxfamily.org>
In-Reply-To
<20190625134039.21707-1-chriscool@tuxfamily.org>

Now that we can have a different default partial clone filter for each promisor remote, let's hide core_partial_clone_filter_default as a static in promisor-remote.c to avoid it being use for anything other than managing backward compatibility.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 cache.h           | 1 -
 config.c          | 5 -----
 environment.c     | 1 -
 promisor-remote.c | 5 +++++
 4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/cache.h b/cache.h
index e34b9e66d2..a4d7f84eeb 100644
--- a/cache.h
+++ b/cache.h
@@ -961,7 +961,6 @@ extern int grafts_replace_parents;
 #define GIT_REPO_VERSION 0
 #define GIT_REPO_VERSION_READ 1
 extern int repository_format_precious_objects;
-extern const char *core_partial_clone_filter_default;
 extern int repository_format_worktree_config;
 
 /*
diff --git a/config.c b/config.c
index 296a6d9cc4..317b226bc8 100644
--- a/config.c
+++ b/config.c
@@ -1344,11 +1344,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)
 		return 0;
 	}
 
-	if (!strcmp(var, "core.partialclonefilter")) {
-		return git_config_string(&core_partial_clone_filter_default,
-					 var, value);
-	}
-
 	if (!strcmp(var, "core.usereplacerefs")) {
 		read_replace_refs = git_config_bool(var, value);
 		return 0;
diff --git a/environment.c b/environment.c
index 8855d2fc11..efa072680a 100644
--- a/environment.c
+++ b/environment.c
@@ -31,7 +31,6 @@ int warn_ambiguous_refs = 1;
 int warn_on_object_refname_ambiguity = 1;
 int ref_paranoia = -1;
 int repository_format_precious_objects;
-const char *core_partial_clone_filter_default;
 int repository_format_worktree_config;
 const char *git_commit_encoding;
 const char *git_log_output_encoding;
diff --git a/promisor-remote.c b/promisor-remote.c
index 31d51bb50e..9bc296cdde 100644
--- a/promisor-remote.c
+++ b/promisor-remote.c
@@ -5,6 +5,7 @@
 #include "transport.h"
 
 static char *repository_format_partial_clone;
+static const char *core_partial_clone_filter_default;
 
 void set_repository_format_partial_clone(char *partial_clone)
 {
@@ -103,6 +104,10 @@ static int promisor_remote_config(const char *var, const char *value, void *data
 	int namelen;
 	const char *subkey;
 
+	if (!strcmp(var, "core.partialclonefilter"))
+		return git_config_string(&core_partial_clone_filter_default,
+					 var, value);
+
 	if (parse_config_key(var, "remote", &name, &namelen, &subkey) < 0)
 		return 0;
 
-- 
2.22.0.229.ga13d9ffdf7.dirty
Previous: Christian CouderNext: Christian Couder
Message 13 of 16 in “Many promisor remotes”
  1. 00/15 Many promisor remotesChristian Couder, Jun 25, 2019
  2. 01/15 t0410: remove pipes after git commandsChristian Couder, Jun 25, 2019
  3. 02/15 fetch-object: make functions return an error codeChristian Couder, Jun 25, 2019
  4. 03/15 Add initial support for many promisor remotesChristian Couder, Jun 25, 2019
  5. 05/15 promisor-remote: add promisor_remote_reinit()Christian Couder, Jun 25, 2019
  6. 06/15 promisor-remote: use repository_format_partial_cloneChristian Couder, Jun 25, 2019
  7. 04/15 promisor-remote: implement promisor_remote_get_direct()Christian Couder, Jun 25, 2019
  8. 09/15 builtin/fetch: remove unique promisor remote limitationChristian Couder, Jun 25, 2019
  9. 08/15 promisor-remote: parse remote.*.partialclonefilterChristian Couder, Jun 25, 2019
  10. 10/15 t0410: test fetching from many promisor remotesChristian Couder, Jun 25, 2019
  11. 11/15 partial-clone: add multiple remotes in the docChristian Couder, Jun 25, 2019
  12. 14/15 Move repository_format_partial_clone to promisor-remote.cChristian Couder, Jun 25, 2019
  13. 15/15 Move core_partial_clone_filter_default to promisor-remote.cChristian Couder, Jun 25, 2019
  14. 12/15 remote: add promisor and partial clone config to the docChristian Couder, Jun 25, 2019
  15. 13/15 Remove fetch-object.{c,h} in favor of promisor-remote.{c,h}Christian Couder, Jun 25, 2019
  16. 07/15 Use promisor_remote_get_direct() and has_promisor_remote()Christian Couder, Jun 25, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.