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

Re: [PATCH 2/2] repository: allow repository format upgrade with extensions

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 16, 2020, 16:49 UTC
Message-ID
<xmqqv9inh0c5.fsf@gitster.c.googlers.com>
In-Reply-To
<20200716122513.GA1050962@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> 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;
Previous: Junio C HamanoNext: Jeff King
Message 30 of 39 in “setup: warn about un-enabled extensions”
  1. setup: warn about un-enabled extensionsJohannes Schindelin via GitGitGadget, Jul 13, 2020
  2. Junio C HamanoJul 13, 2020
  3. Derrick StoleeJul 14, 2020
  4. Johannes SchindelinJul 14, 2020
  5. Junio C HamanoJul 14, 2020
  6. Derrick StoleeJul 14, 2020
  7. Johannes SchindelinJul 14, 2020
  8. Junio C HamanoJul 14, 2020
  9. Junio C HamanoJul 15, 2020
  10. Junio C HamanoJul 15, 2020
  11. Derrick StoleeJul 15, 2020
  12. Junio C HamanoJul 15, 2020
  13. Derrick StoleeJul 15, 2020
  14. Johannes SchindelinJul 15, 2020
  15. Junio C HamanoJul 15, 2020
  16. Johannes SchindelinJul 15, 2020
  17. Jonathan NiederJul 15, 2020
  18. Junio C HamanoJul 16, 2020
  19. 0/2 extensions.* fixes for 2.28 (Re: [PATCH] setup: warn about un-enabled extensions)Jonathan Nieder, Jul 16, 2020
  20. 1/2 Revert "check_repository_format_gently(): refuse extensions for old repositories"Jonathan Nieder, Jul 16, 2020
  21. Jeff KingJul 16, 2020
  22. 2/2 repository: allow repository format upgrade with extensionsJonathan Nieder, Jul 16, 2020
  23. Junio C HamanoJul 16, 2020
  24. Jeff KingJul 16, 2020
  25. Jeff KingJul 16, 2020
  26. Derrick StoleeJul 16, 2020
  27. Junio C HamanoJul 16, 2020
  28. Jeff KingJul 16, 2020
  29. Junio C HamanoJul 16, 2020
  30. Junio C HamanoJul 16, 2020
  31. Jeff KingJul 16, 2020
  32. Junio C HamanoJul 16, 2020
  33. Jonathan NiederJul 16, 2020
  34. Junio C HamanoJul 16, 2020
  35. Jeff KingJul 17, 2020
  36. Junio C HamanoJul 17, 2020
  37. Jeff KingJul 17, 2020
  38. Johannes SchindelinJul 16, 2020
  39. Derrick StoleeJul 16, 2020

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.