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

Re: [PATCH] setup: warn if extensions exist on old format

From
Derrick Stolee <stolee@gmail.com>
Date
Jul 13, 2020, 19:41 UTC
Message-ID
<95c338d0-dbf0-669d-59a3-8c2d6c87c8fc@gmail.com>
In-Reply-To
<20200713193405.GC77607@syl.lan>
On 7/13/2020 3:34 PM, Taylor Blau wrote:
> s/upgrae/upgrade
> s/ocnfigured/configured
Oh man, what was going on with me when I was typing this message.
Thanks for the thorough inspection.
Show 33 quoted lines
>> diff --git a/setup.c b/setup.c
>> index eb066db6d8..6ff6c54d39 100644
>> --- a/setup.c
>> +++ b/setup.c
>> @@ -542,6 +542,11 @@ static int check_repository_format_gently(const char *gitdir, struct repository_
>>  		}
>>  	}
>>
>> +	if (candidate->version == 0 && candidate->has_extensions) {
>> +		warning(_("some extensions are enabled, but core.repositoryFormatVersion=0"));
>> +		warning(_("if you intended to use extensions, run 'git config core.repositoryFormatVersion 1'"));
>> +	}
>> +
>>  	return 0;
>>  }
>>
>> diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
>> index 88cdde255c..d249428f44 100755
>> --- a/t/t1091-sparse-checkout-builtin.sh
>> +++ b/t/t1091-sparse-checkout-builtin.sh
>> @@ -68,6 +68,15 @@ test_expect_success 'git sparse-checkout init' '
>>  	check_files repo a
>>  '
>>
>> +test_expect_success 'warning about core.repositoryFormatVersion' '
>> +	test_when_finished git -C repo config core.repositoryFormatVersion 1 &&
>> +	git -C repo status 2>err &&
>> +	test_must_be_empty err &&
>> +	git -C repo config --local core.repositoryFormatVersion 0 &&
> 
> I don't think it's that difficult to see that this patch is correct, but
> it might be worth testing this for the case that
> 'core.repositoryFormatVersion' is unset, too.

You were absolutely right to check this, since this diff causes the test to fail:

diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
index d249428f44..b5de141292 100755
--- a/t/t1091-sparse-checkout-builtin.sh
+++ b/t/t1091-sparse-checkout-builtin.sh
@@ -74,6 +74,9 @@ test_expect_success 'warning about core.repositoryFormatVersion' '
        test_must_be_empty err &&
        git -C repo config --local core.repositoryFormatVersion 0 &&
        git -C repo status 2>err &&
+       test_i18ngrep "some extensions are enabled, but core.repositoryFormatVersion=0" err &&
+       git -C repo config --local --unset core.repositoryFormatVersion 0 &&
+       git -C repo status 2>err &&
        test_i18ngrep "some extensions are enabled, but core.repositoryFormatVersion=0" err
 '
 

I'll investigate why the "unset" case is different than the "0" case.

Hopefully the "should we do this?" question can continue being discussed
while I work on a v2.

Thanks,
-Stolee
Previous: Taylor BlauNext: Junio C Hamano
Message 3 of 15 in “setup: warn if extensions exist on old format”
  1. setup: warn if extensions exist on old formatDerrick Stolee via GitGitGadget, Jul 13, 2020
  2. Taylor BlauJul 13, 2020
  3. Derrick StoleeJul 13, 2020
  4. Junio C HamanoJul 13, 2020
  5. Junio C HamanoJul 13, 2020
  6. setup: tweak upgrade policy to grandfather worktreeconfigJunio C Hamano, Jul 13, 2020
  7. Derrick StoleeJul 13, 2020
  8. Junio C HamanoJul 13, 2020
  9. Jonathan NiederJul 14, 2020
  10. Junio C HamanoJul 14, 2020
  11. 0/2 setup: warn if extensions exist on old formatDerrick Stolee via GitGitGadget, Jul 14, 2020
  12. 1/2 setup: tweak upgrade policy to grandfather worktreeconfigDerrick Stolee via GitGitGadget, Jul 14, 2020
  13. Johannes SchindelinJul 14, 2020
  14. 2/2 config: provide extra detail about worktree configDerrick Stolee via GitGitGadget, Jul 14, 2020
  15. Johannes SchindelinJul 14, 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.