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

Re: [PATCH] remote: rename also remotes in the branch.<name>.pushRemote config

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 17, 2020, 09:49 UTC
Message-ID
<nycvar.QRO.7.76.6.2001171046460.46@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqq7e1rf0zg.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Thu, 16 Jan 2020, Junio C Hamano wrote:
Show 32 quoted lines
> Bert Wesarg <bert.wesarg@googlemail.com> writes:
>
> > diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
> > index 883b32efa0..59a1681636 100755
> > --- a/t/t5505-remote.sh
> > +++ b/t/t5505-remote.sh
> > @@ -737,12 +737,14 @@ test_expect_success 'rename a remote' '
> >  	git clone one four &&
> >  	(
> >  		cd four &&
> > +		git config branch.master.pushRemote origin &&
> >  		git remote rename origin upstream &&
> >  		test -z "$(git for-each-ref refs/remotes/origin)" &&
> >  		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
> >  		test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
> >  		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
> > -		test "$(git config branch.master.remote)" = "upstream"
> > +		test "$(git config branch.master.remote)" = "upstream" &&
> > +		test "$(git config branch.master.pushRemote)" = "upstream"
> >  	)
> >  '
>
> OK, so the issue the patch wants to address is
>
> 	git remote rename X Y
>
> ought to rename branch.X.Z (for any value of Z) to branch.Y.Z but it
> forgot to do so for Z==pushRemote?
>
> If that is the case, I have to wonder if the patch is making the
> situation better or even worse.  Shouldn't we be not even caring
> what Z is by not having to list these specific keys?  I dunno.

I think what the code does is not rename branch.X.Z to branch.Y.Z, but for every `branch.B.pushRemote` whose value is `X`, it will now be set to `Y`.

So we really should not touch, say, `branch.X.description` because it has nothing to do with any renamed remote.

And yes, I agree, the commit message would have made for a splendid place to explain something like this.

Ciao, Dscho

Previous: Junio C HamanoNext: Johannes Schindelin
Message 14 of 15 in “remote: rename also remotes in the branch.<name>.pushRemote config”
  1. remote: rename also remotes in the branch.<name>.pushRemote configBert Wesarg, Jan 16, 2020
  2. Junio C HamanoJan 16, 2020
  3. remote rename: rename branch.<name>.pushRemote config values tooBert Wesarg, Jan 17, 2020
  4. Johannes SchindelinJan 17, 2020
  5. Bert WesargJan 17, 2020
  6. Johannes SchindelinJan 17, 2020
  7. Bert WesargJan 17, 2020
  8. Johannes SchindelinJan 20, 2020
  9. Bert WesargJan 20, 2020
  10. Johannes SchindelinJan 20, 2020
  11. Junio C HamanoJan 17, 2020
  12. Bert WesargJan 17, 2020
  13. Junio C HamanoJan 17, 2020
  14. Johannes SchindelinJan 17, 2020
  15. Johannes SchindelinJan 17, 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.