From: Jeff Hostetler <git@jeffhostetler.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, jonathantanmy@google.com
Subject: [PATCH v4 01/10] extension.partialclone: introduce partial clone extension
Date: Thu, 16 Nov 2017 18:12:48 +0000 [thread overview]
Message-ID: <20171116181257.61673-2-git@jeffhostetler.com> (raw)
In-Reply-To: <20171116181257.61673-1-git@jeffhostetler.com>
From: Jonathan Tan <jonathantanmy@google.com>
Introduce new repository extension option:
`extensions.partialclone`
See the update to Documentation/technical/repository-version.txt
in this patch for more information.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
Documentation/technical/repository-version.txt | 12 ++++++++++++
cache.h | 2 ++
environment.c | 1 +
setup.c | 7 ++++++-
4 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/Documentation/technical/repository-version.txt b/Documentation/technical/repository-version.txt
index 00ad379..e03eacc 100644
--- a/Documentation/technical/repository-version.txt
+++ b/Documentation/technical/repository-version.txt
@@ -86,3 +86,15 @@ for testing format-1 compatibility.
When the config key `extensions.preciousObjects` is set to `true`,
objects in the repository MUST NOT be deleted (e.g., by `git-prune` or
`git repack -d`).
+
+`partialclone`
+~~~~~~~~~~~~~~
+
+When the config key `extensions.partialclone` is set, it indicates
+that the repo was created with a partial clone (or later performed
+a partial fetch) and that the remote may have omitted sending
+certain unwanted objects. Such a remote is called a "promisor remote"
+and it promises that all such omitted objects can be fetched from it
+in the future.
+
+The value of this key is the name of the promisor remote.
diff --git a/cache.h b/cache.h
index 6440e2b..35e3f5e 100644
--- a/cache.h
+++ b/cache.h
@@ -860,10 +860,12 @@ extern int grafts_replace_parents;
#define GIT_REPO_VERSION 0
#define GIT_REPO_VERSION_READ 1
extern int repository_format_precious_objects;
+extern char *repository_format_partial_clone;
struct repository_format {
int version;
int precious_objects;
+ char *partial_clone; /* value of extensions.partialclone */
int is_bare;
char *work_tree;
struct string_list unknown_extensions;
diff --git a/environment.c b/environment.c
index 8289c25..e52aab3 100644
--- a/environment.c
+++ b/environment.c
@@ -27,6 +27,7 @@ int warn_ambiguous_refs = 1;
int warn_on_object_refname_ambiguity = 1;
int ref_paranoia = -1;
int repository_format_precious_objects;
+char *repository_format_partial_clone;
const char *git_commit_encoding;
const char *git_log_output_encoding;
const char *apply_default_whitespace;
diff --git a/setup.c b/setup.c
index 03f51e0..58536bd 100644
--- a/setup.c
+++ b/setup.c
@@ -420,7 +420,11 @@ static int check_repo_format(const char *var, const char *value, void *vdata)
;
else if (!strcmp(ext, "preciousobjects"))
data->precious_objects = git_config_bool(var, value);
- else
+ else if (!strcmp(ext, "partialclone")) {
+ if (!value)
+ return config_error_nonbool(var);
+ data->partial_clone = xstrdup(value);
+ } else
string_list_append(&data->unknown_extensions, ext);
} else if (strcmp(var, "core.bare") == 0) {
data->is_bare = git_config_bool(var, value);
@@ -463,6 +467,7 @@ static int check_repository_format_gently(const char *gitdir, int *nongit_ok)
}
repository_format_precious_objects = candidate.precious_objects;
+ repository_format_partial_clone = candidate.partial_clone;
string_list_clear(&candidate.unknown_extensions, 0);
if (!has_common) {
if (candidate.is_bare != -1) {
--
2.9.3
next prev parent reply other threads:[~2017-11-16 18:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 18:12 [PATCH v4 00/10] Partial clone part 2: fsck and promisors Jeff Hostetler
2017-11-16 18:12 ` Jeff Hostetler [this message]
2017-11-16 18:12 ` [PATCH v4 02/10] fsck: introduce partialclone extension Jeff Hostetler
2017-11-16 18:12 ` [PATCH v4 03/10] fsck: support refs pointing to promisor objects Jeff Hostetler
2017-11-16 18:12 ` [PATCH v4 04/10] fsck: support referenced " Jeff Hostetler
2017-11-16 18:12 ` [PATCH v4 05/10] fsck: support promisor objects as CLI argument Jeff Hostetler
2017-11-16 18:12 ` [PATCH v4 06/10] index-pack: refactor writing of .keep files Jeff Hostetler
2017-11-16 18:12 ` [PATCH v4 07/10] introduce fetch-object: fetch one promisor object Jeff Hostetler
2017-11-16 19:57 ` Ramsay Jones
2017-11-17 19:49 ` Jeff Hostetler
2017-11-17 20:17 ` Stefan Beller
2017-11-20 15:56 ` Jeff Hostetler
2017-11-17 20:22 ` Ramsay Jones
2017-11-16 18:12 ` [PATCH v4 08/10] sha1_file: support lazily fetching missing objects Jeff Hostetler
2017-11-16 18:12 ` [PATCH v4 09/10] rev-list: support termination at promisor objects Jeff Hostetler
2017-11-16 18:12 ` [PATCH v4 10/10] gc: do not repack promisor packfiles Jeff Hostetler
2017-11-16 21:57 ` [PATCH v4 00/10] Partial clone part 2: fsck and promisors Jonathan Tan
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=20171116181257.61673-2-git@jeffhostetler.com \
--to=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jonathantanmy@google.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).