All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone
@ 2021-02-25  1:21 Ævar Arnfjörð Bjarmason
  2021-02-25  1:21 ` [PATCH 2/2] remote: write camel-cased *.pushRemote on rename Ævar Arnfjörð Bjarmason
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-02-25  1:21 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Bert Wesarg, Ævar Arnfjörð Bjarmason

Change "git remote add" so that it adds a *.tagOpt key, and not the
lower-cased *.tagopt on "git remote add --no-tags", just as "git clone
--no-tags" would do.

This doesn't matter for anything that reads the config. It's just
prettier if we write config keys in their documented camelCase form to
user-readable config files.

When I added support for "clone -no-tags" in 0dab2468ee5 (clone: add a
--no-tags option to clone without tags, 2017-04-26) I made it use
the *.tagOpt form, but the older "git remote add" added in
111fb858654 (remote add: add a --[no-]tags option, 2010-04-20) has
been using *.tagopt all this time.

It's easy enough to add a test for this, so let's do that. We can't
use "git config -l" there, because it'll normalize the keys to their
lower-cased form. Let's add the test for "git clone" too for good
measure, not just to the "git remote" codepath we're fixing.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

I also noticed that we write e.g. init.objectformat instead of
init.objectFormat, and core.logallrefupdates etc. If anyone's got an
even even worse case of OCD there's an interesting #leftoverbits
project there of scouring the code for more cases of this sort of
thing...

 builtin/remote.c         | 2 +-
 t/t5505-remote.sh        | 1 +
 t/t5612-clone-refspec.sh | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/remote.c b/builtin/remote.c
index d11a5589e49..f286ae97538 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -221,7 +221,7 @@ static int add(int argc, const char **argv)
 
 	if (fetch_tags != TAGS_DEFAULT) {
 		strbuf_reset(&buf);
-		strbuf_addf(&buf, "remote.%s.tagopt", name);
+		strbuf_addf(&buf, "remote.%s.tagOpt", name);
 		git_config_set(buf.buf,
 			       fetch_tags == TAGS_SET ? "--tags" : "--no-tags");
 	}
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 045398b94e6..2a7b5cd00a0 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -594,6 +594,7 @@ test_expect_success 'add --no-tags' '
 		cd add-no-tags &&
 		git init &&
 		git remote add -f --no-tags origin ../one &&
+		grep tagOpt .git/config &&
 		git tag -l some-tag >../test/output &&
 		git tag -l foobar-tag >../test/output &&
 		git config remote.origin.tagopt >>../test/output
diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
index 6a6af7449ca..3126cfd7e9d 100755
--- a/t/t5612-clone-refspec.sh
+++ b/t/t5612-clone-refspec.sh
@@ -97,6 +97,7 @@ test_expect_success 'by default no tags will be kept updated' '
 test_expect_success 'clone with --no-tags' '
 	(
 		cd dir_all_no_tags &&
+		grep tagOpt .git/config &&
 		git fetch &&
 		git for-each-ref refs/tags >../actual
 	) &&
-- 
2.30.0.284.gd98b1dd5eaa7


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] remote: write camel-cased *.pushRemote on rename
  2021-02-25  1:21 [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Ævar Arnfjörð Bjarmason
@ 2021-02-25  1:21 ` Ævar Arnfjörð Bjarmason
  2021-02-25  3:17   ` Junio C Hamano
  2021-03-18 11:22   ` Bert Wesarg
  2021-02-25  3:02 ` [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Junio C Hamano
  2021-02-25  3:16 ` Junio C Hamano
  2 siblings, 2 replies; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-02-25  1:21 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Bert Wesarg, Ævar Arnfjörð Bjarmason

When a remote is renamed don't change the canonical "*.pushRemote"
form to "*.pushremote". Fixes and tests for a minor bug in
923d4a5ca4f (remote rename/remove: handle branch.<name>.pushRemote
config values, 2020-01-27). See the preceding commit for why this does
& doesn't matter.

While we're at it let's also test that we handle the "*.pushDefault"
key correctly. The code to handle that was added in
b3fd6cbf294 (remote rename/remove: gently handle remote.pushDefault
config, 2020-02-01) and does the right thing, but nothing tested that
we wrote out the canonical camel-cased form.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/remote.c  | 2 +-
 t/t5505-remote.sh | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/builtin/remote.c b/builtin/remote.c
index f286ae97538..717b662d455 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -746,7 +746,7 @@ static int mv(int argc, const char **argv)
 		}
 		if (info->push_remote_name && !strcmp(info->push_remote_name, rename.old_name)) {
 			strbuf_reset(&buf);
-			strbuf_addf(&buf, "branch.%s.pushremote", item->string);
+			strbuf_addf(&buf, "branch.%s.pushRemote", item->string);
 			git_config_set(buf.buf, rename.new_name);
 		}
 	}
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 2a7b5cd00a0..34fc3fa421f 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -757,6 +757,7 @@ test_expect_success 'rename a remote' '
 		cd four &&
 		git config branch.main.pushRemote origin &&
 		git remote rename origin upstream &&
+		grep "pushRemote" .git/config &&
 		test -z "$(git for-each-ref refs/remotes/origin)" &&
 		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
 		test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
@@ -773,6 +774,7 @@ test_expect_success 'rename a remote renames repo remote.pushDefault' '
 		cd four.1 &&
 		git config remote.pushDefault origin &&
 		git remote rename origin upstream &&
+		grep pushDefault .git/config &&
 		test "$(git config --local remote.pushDefault)" = "upstream"
 	)
 '
-- 
2.30.0.284.gd98b1dd5eaa7


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone
  2021-02-25  1:21 [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Ævar Arnfjörð Bjarmason
  2021-02-25  1:21 ` [PATCH 2/2] remote: write camel-cased *.pushRemote on rename Ævar Arnfjörð Bjarmason
@ 2021-02-25  3:02 ` Junio C Hamano
  2021-02-25  3:16 ` Junio C Hamano
  2 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2021-02-25  3:02 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Bert Wesarg

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Change "git remote add" so that it adds a *.tagOpt key, and not the
> lower-cased *.tagopt on "git remote add --no-tags", just as "git clone
> --no-tags" would do.
>
> This doesn't matter for anything that reads the config. It's just
> prettier if we write config keys in their documented camelCase form to
> user-readable config files.
>
> When I added support for "clone -no-tags" in 0dab2468ee5 (clone: add a
> --no-tags option to clone without tags, 2017-04-26) I made it use
> the *.tagOpt form, but the older "git remote add" added in
> 111fb858654 (remote add: add a --[no-]tags option, 2010-04-20) has
> been using *.tagopt all this time.
>
> It's easy enough to add a test for this, so let's do that. We can't
> use "git config -l" there, because it'll normalize the keys to their
> lower-cased form. Let's add the test for "git clone" too for good
> measure, not just to the "git remote" codepath we're fixing.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>
> I also noticed that we write e.g. init.objectformat instead of
> init.objectFormat, and core.logallrefupdates etc. If anyone's got an
> even even worse case of OCD there's an interesting #leftoverbits
> project there of scouring the code for more cases of this sort of
> thing...
>
>  builtin/remote.c         | 2 +-
>  t/t5505-remote.sh        | 1 +
>  t/t5612-clone-refspec.sh | 1 +
>  3 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/remote.c b/builtin/remote.c
> index d11a5589e49..f286ae97538 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -221,7 +221,7 @@ static int add(int argc, const char **argv)
>  
>  	if (fetch_tags != TAGS_DEFAULT) {
>  		strbuf_reset(&buf);
> -		strbuf_addf(&buf, "remote.%s.tagopt", name);
> +		strbuf_addf(&buf, "remote.%s.tagOpt", name);

Good find.

A general rule for a name used to refer to a configuration variable
the C code ought to be

 - if it is used to match what the system gave us, make sure we use
   all lowercase for the first and the last component and match with
   strcmp(), not with strcasecmp().

 - if it is used to update, make sure we use the canonical spelling,
   if only for the documentation value.

> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
> index 045398b94e6..2a7b5cd00a0 100755
> --- a/t/t5505-remote.sh
> +++ b/t/t5505-remote.sh
> @@ -594,6 +594,7 @@ test_expect_success 'add --no-tags' '
>  		cd add-no-tags &&
>  		git init &&
>  		git remote add -f --no-tags origin ../one &&
> +		grep tagOpt .git/config &&
>  		git tag -l some-tag >../test/output &&
>  		git tag -l foobar-tag >../test/output &&
>  		git config remote.origin.tagopt >>../test/output
> diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
> index 6a6af7449ca..3126cfd7e9d 100755
> --- a/t/t5612-clone-refspec.sh
> +++ b/t/t5612-clone-refspec.sh
> @@ -97,6 +97,7 @@ test_expect_success 'by default no tags will be kept updated' '
>  test_expect_success 'clone with --no-tags' '
>  	(
>  		cd dir_all_no_tags &&
> +		grep tagOpt .git/config &&
>  		git fetch &&
>  		git for-each-ref refs/tags >../actual
>  	) &&

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone
  2021-02-25  1:21 [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Ævar Arnfjörð Bjarmason
  2021-02-25  1:21 ` [PATCH 2/2] remote: write camel-cased *.pushRemote on rename Ævar Arnfjörð Bjarmason
  2021-02-25  3:02 ` [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Junio C Hamano
@ 2021-02-25  3:16 ` Junio C Hamano
  2021-02-25 19:47   ` Ævar Arnfjörð Bjarmason
  2 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2021-02-25  3:16 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Bert Wesarg

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> It's easy enough to add a test for this, so let's do that. We can't
> use "git config -l" there, because it'll normalize the keys to their
> lower-cased form.

I wondered if we want "git config -l --preserve-case" or something
like that, but an extra grep for "tagOpt" would be sufficient in a
simple test like these that are unlikely to have unrelated tagOpt
defined in the file.  More importantly, I am starting to doubt if
this should even be tested.

If there were existing "section.varname" variable definition and we
ask

	git_config_set("section.varName", "newvalue");

we may end up with "[section] varname = newvalue", and that is
perfectly OK, I would think, because the first and the last
component of the configuration variable names are defined to be case
insensitive, and here may be "[Section] varname = oldvalue" in the
configuration file before we try to set it, and the implementation
is free to replace "oldvalue" with "newvalue", instead of first
removing "[Section] varname = oldvalue" and then adding a new
"[section] varName = newvalue" (after all, there may be variables
other than "varname" in the section, and the existing "[Section]"
header may need to be kept for the remaining variables while we futz
with the varname or varName).

Which means that while we do want to spell the names in our source
code correctly (i.e. "tagOpt", not "tagopt") when we tell which
variable we want to get modified to the git_config_set() function,
we should not care how exactly git_config_set() chooses to spell the
variable in the resulting configuration file, no?

So, ...

> diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
> index 6a6af7449ca..3126cfd7e9d 100755
> --- a/t/t5612-clone-refspec.sh
> +++ b/t/t5612-clone-refspec.sh
> @@ -97,6 +97,7 @@ test_expect_success 'by default no tags will be kept updated' '
>  test_expect_success 'clone with --no-tags' '
>  	(
>  		cd dir_all_no_tags &&
> +		grep tagOpt .git/config &&
>  		git fetch &&
>  		git for-each-ref refs/tags >../actual

...as long as "git config remote.origin.tagopt" yields what we
expect, we should be OK, I would think.  Insisting that the variable
name is kept by git_config_set() API may be expecting too much.

>  	) &&

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] remote: write camel-cased *.pushRemote on rename
  2021-02-25  1:21 ` [PATCH 2/2] remote: write camel-cased *.pushRemote on rename Ævar Arnfjörð Bjarmason
@ 2021-02-25  3:17   ` Junio C Hamano
  2021-03-18 11:22   ` Bert Wesarg
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2021-02-25  3:17 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Bert Wesarg

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> When a remote is renamed don't change the canonical "*.pushRemote"
> form to "*.pushremote". Fixes and tests for a minor bug in
> 923d4a5ca4f (remote rename/remove: handle branch.<name>.pushRemote
> config values, 2020-01-27). See the preceding commit for why this does
> & doesn't matter.
>
> While we're at it let's also test that we handle the "*.pushDefault"
> key correctly. The code to handle that was added in
> b3fd6cbf294 (remote rename/remove: gently handle remote.pushDefault
> config, 2020-02-01) and does the right thing, but nothing tested that
> we wrote out the canonical camel-cased form.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  builtin/remote.c  | 2 +-
>  t/t5505-remote.sh | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/remote.c b/builtin/remote.c
> index f286ae97538..717b662d455 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -746,7 +746,7 @@ static int mv(int argc, const char **argv)
>  		}
>  		if (info->push_remote_name && !strcmp(info->push_remote_name, rename.old_name)) {
>  			strbuf_reset(&buf);
> -			strbuf_addf(&buf, "branch.%s.pushremote", item->string);
> +			strbuf_addf(&buf, "branch.%s.pushRemote", item->string);
>  			git_config_set(buf.buf, rename.new_name);
>  		}
>  	}
> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
> index 2a7b5cd00a0..34fc3fa421f 100755
> --- a/t/t5505-remote.sh
> +++ b/t/t5505-remote.sh
> @@ -757,6 +757,7 @@ test_expect_success 'rename a remote' '
>  		cd four &&
>  		git config branch.main.pushRemote origin &&
>  		git remote rename origin upstream &&
> +		grep "pushRemote" .git/config &&
>  		test -z "$(git for-each-ref refs/remotes/origin)" &&
>  		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
>  		test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
> @@ -773,6 +774,7 @@ test_expect_success 'rename a remote renames repo remote.pushDefault' '
>  		cd four.1 &&
>  		git config remote.pushDefault origin &&
>  		git remote rename origin upstream &&
> +		grep pushDefault .git/config &&
>  		test "$(git config --local remote.pushDefault)" = "upstream"
>  	)
>  '

Again, good find, but I am not sure if we want the test to be so
strict.  Besides, quoting one and not quoting the other in the same
patch looks the test is also being inconsistent ;-).

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone
  2021-02-25  3:16 ` Junio C Hamano
@ 2021-02-25 19:47   ` Ævar Arnfjörð Bjarmason
  2021-02-25 20:00     ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-02-25 19:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Bert Wesarg


On Thu, Feb 25 2021, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> It's easy enough to add a test for this, so let's do that. We can't
>> use "git config -l" there, because it'll normalize the keys to their
>> lower-cased form.
>
> I wondered if we want "git config -l --preserve-case" or something
> like that, but an extra grep for "tagOpt" would be sufficient in a
> simple test like these that are unlikely to have unrelated tagOpt
> defined in the file.  More importantly, I am starting to doubt if
> this should even be tested.
>
> If there were existing "section.varname" variable definition and we
> ask
>
> 	git_config_set("section.varName", "newvalue");
>
> we may end up with "[section] varname = newvalue", and that is
> perfectly OK, I would think, because the first and the last
> component of the configuration variable names are defined to be case
> insensitive, and here may be "[Section] varname = oldvalue" in the
> configuration file before we try to set it, and the implementation
> is free to replace "oldvalue" with "newvalue", instead of first
> removing "[Section] varname = oldvalue" and then adding a new
> "[section] varName = newvalue" (after all, there may be variables
> other than "varname" in the section, and the existing "[Section]"
> header may need to be kept for the remaining variables while we futz
> with the varname or varName).
>
> Which means that while we do want to spell the names in our source
> code correctly (i.e. "tagOpt", not "tagopt") when we tell which
> variable we want to get modified to the git_config_set() function,
> we should not care how exactly git_config_set() chooses to spell the
> variable in the resulting configuration file, no?
>
> So, ...

Yes, in general, but...

>> diff --git a/t/t5612-clone-refspec.sh b/t/t5612-clone-refspec.sh
>> index 6a6af7449ca..3126cfd7e9d 100755
>> --- a/t/t5612-clone-refspec.sh
>> +++ b/t/t5612-clone-refspec.sh
>> @@ -97,6 +97,7 @@ test_expect_success 'by default no tags will be kept updated' '
>>  test_expect_success 'clone with --no-tags' '
>>  	(
>>  		cd dir_all_no_tags &&
>> +		grep tagOpt .git/config &&
>>  		git fetch &&
>>  		git for-each-ref refs/tags >../actual
>
> ...as long as "git config remote.origin.tagopt" yields what we
> expect, we should be OK, I would think.  Insisting that the variable
> name is kept by git_config_set() API may be expecting too much.
>
>>  	) &&

...the cases fixed in this series are not ones where we're possibly
changing an existing variable name, but where we're guaranteed to be
writing new values.

We are renaming a remote or otherwise moving variables around, if there
were existing values to contend with we'd have died earlier.

I'm not quite sure what to make of this feedback in general. That you'd
like the bugfix but we shouldn't bother with a regression test, or that
we shouldn't bother with the fix at all?

I admit this is getting to diminishing returns in testing, we're
unlikely to break this, and if we do it's not such a big deal.

But I don't agree that we should feel free to munge user config files
within the bound of valid config syntax when we edit these files for
users.

We already go out of our way to add values to existing sections, not add
new empty headings etc. (I believe the last major effort on that front
was from Johannes S. a while back).

likewise here, even though cmd.averylongvariablename is perfectly valid,
it's much more user friendly if we write/edit it as
cmd.AVeryLongVariableName.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone
  2021-02-25 19:47   ` Ævar Arnfjörð Bjarmason
@ 2021-02-25 20:00     ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2021-02-25 20:00 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Bert Wesarg

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> I'm not quite sure what to make of this feedback in general. That you'd
> like the bugfix but we shouldn't bother with a regression test, or that
> we shouldn't bother with the fix at all?

I like the style update to make the callers use the canonical case
(even though they do not have to), but the test that inspects the
cases in the resulting configuration file may be too strict.

> But I don't agree that we should feel free to munge user config files
> within the bound of valid config syntax when we edit these files for
> users.

I agree with your sentiment in principle.  I just wanted to make
sure that future test writers agree with the principle, and also
that they understand there are cases where end-user input may not
match the output (e.g. when running "git config Vari.Able value" to
an existing configuration file that has "[vari] ous = true", it may
be less desirable to add "[Vari] Able = value" than to add to the
existing "[Vari] section a new line "Able = value").



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] remote: write camel-cased *.pushRemote on rename
  2021-02-25  1:21 ` [PATCH 2/2] remote: write camel-cased *.pushRemote on rename Ævar Arnfjörð Bjarmason
  2021-02-25  3:17   ` Junio C Hamano
@ 2021-03-18 11:22   ` Bert Wesarg
  1 sibling, 0 replies; 8+ messages in thread
From: Bert Wesarg @ 2021-03-18 11:22 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Git Mailing List, Junio C Hamano

On Thu, Feb 25, 2021 at 2:21 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> When a remote is renamed don't change the canonical "*.pushRemote"
> form to "*.pushremote". Fixes and tests for a minor bug in
> 923d4a5ca4f (remote rename/remove: handle branch.<name>.pushRemote
> config values, 2020-01-27). See the preceding commit for why this does
> & doesn't matter.
>
> While we're at it let's also test that we handle the "*.pushDefault"
> key correctly. The code to handle that was added in
> b3fd6cbf294 (remote rename/remove: gently handle remote.pushDefault
> config, 2020-02-01) and does the right thing, but nothing tested that
> we wrote out the canonical camel-cased form.
>

Fine with me.

Thanks.

> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  builtin/remote.c  | 2 +-
>  t/t5505-remote.sh | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/remote.c b/builtin/remote.c
> index f286ae97538..717b662d455 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -746,7 +746,7 @@ static int mv(int argc, const char **argv)
>                 }
>                 if (info->push_remote_name && !strcmp(info->push_remote_name, rename.old_name)) {
>                         strbuf_reset(&buf);
> -                       strbuf_addf(&buf, "branch.%s.pushremote", item->string);
> +                       strbuf_addf(&buf, "branch.%s.pushRemote", item->string);
>                         git_config_set(buf.buf, rename.new_name);
>                 }
>         }
> diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
> index 2a7b5cd00a0..34fc3fa421f 100755
> --- a/t/t5505-remote.sh
> +++ b/t/t5505-remote.sh
> @@ -757,6 +757,7 @@ test_expect_success 'rename a remote' '
>                 cd four &&
>                 git config branch.main.pushRemote origin &&
>                 git remote rename origin upstream &&
> +               grep "pushRemote" .git/config &&
>                 test -z "$(git for-each-ref refs/remotes/origin)" &&
>                 test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" &&
>                 test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" &&
> @@ -773,6 +774,7 @@ test_expect_success 'rename a remote renames repo remote.pushDefault' '
>                 cd four.1 &&
>                 git config remote.pushDefault origin &&
>                 git remote rename origin upstream &&
> +               grep pushDefault .git/config &&
>                 test "$(git config --local remote.pushDefault)" = "upstream"
>         )
>  '
> --
> 2.30.0.284.gd98b1dd5eaa7
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-18 11:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25  1:21 [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Ævar Arnfjörð Bjarmason
2021-02-25  1:21 ` [PATCH 2/2] remote: write camel-cased *.pushRemote on rename Ævar Arnfjörð Bjarmason
2021-02-25  3:17   ` Junio C Hamano
2021-03-18 11:22   ` Bert Wesarg
2021-02-25  3:02 ` [PATCH 1/2] remote: add camel-cased *.tagOpt key, like clone Junio C Hamano
2021-02-25  3:16 ` Junio C Hamano
2021-02-25 19:47   ` Ævar Arnfjörð Bjarmason
2021-02-25 20:00     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.