Jeff King <peff@xxxxxxxx> writes: > Subject: verify_repository_format(): complain about new extensions in v0 repo > > We made the mistake in the past of respecting extensions.* even when the > repository format version was set to 0. This is bad because forgetting > to bump the repository version means that older versions of Git (which > do not know about our extensions) won't complain. I.e., it's not a > problem in itself, but it means your repository is in a state which does > not give you the protection you think you're getting from older > versions. > > For compatibility reasons, we are stuck with that decision for existing > extensions. However, we'd prefer not to extend the damage further. We > can do that by catching any newly-added extensions and complaining about > the repository format. Looking good overall, but I needed this to build from the source. Thanks. setup.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.c b/setup.c index e29659b7b9..e69bd28ed6 100644 --- a/setup.c +++ b/setup.c @@ -457,10 +457,10 @@ enum extension_result { * Do not add new extensions to this function. It handles extensions which are * respected even in v0-format repositories for historical compatibility. */ -enum extension_result handle_extension_v0(const char *var, - const char *value, - const char *ext, - struct repository_format *data) +static enum extension_result handle_extension_v0(const char *var, + const char *value, + const char *ext, + struct repository_format *data) { if (!strcmp(ext, "noop")) { return EXTENSION_OK; @@ -483,10 +483,10 @@ enum extension_result handle_extension_v0(const char *var, /* * Record any new extensions in this function. */ -enum extension_result handle_extension(const char *var, - const char *value, - const char *ext, - struct repository_format *data) +static enum extension_result handle_extension(const char *var, + const char *value, + const char *ext, + struct repository_format *data) { if (!strcmp(ext, "noop-v1")) { return EXTENSION_OK;