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

Re: [PATCH 1/2] git remote add: allow re-adding remotes with the same URL

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 23, 2014, 18:51 UTC
Message-ID
<xmqq8uhy2o9o.fsf@gitster.dls.corp.google.com>
In-Reply-To
<alpine.DEB.1.00.1412231923560.21312@s15462909.onlinehome-server.info>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 17 quoted lines
>> > I hope v2 addresses your concerns.
>> 
>> Unfortunately I am still confused.
>> 
>> The way the overlong line is folded in the new version of the patch
>> makes it easier to read, but I didn't find a reason why checking the
>> number of fetch_refspec does not go against that goal there.
>
> Since you pointed out rightfully that the main goal is *not* to allow
> multiple `git remote add` to succeed when they try to add the same remote
> with the same URL, I changed the commit message to point out that the goal
> was to handle adding remotes via `git remote add <nick> <url>` when
> url.<url>.insteadOf = <nick> already exists, with the same <nick> and
> <url>.
>
> Since I have no interest in opening the can of worms to allow re-adding
> remotes, I did not touch that part at all, I hope you do not mind.

Oh, don't get me wrong. I do not have any interest in allowing re-adding remotes, either, so we are on the same page.

I was just saying that it was unclear what ensures that the change in the codepath only affects the remote setting that conflicts with "insteadOf" without randomly (read: sometimes it allows, sometimes it forbids) allowing re-adding remotes.

Previous: Johannes Schindelin
Message 19 of 19 in “remote: allow adding remote w same name as alias”
  1. remote: allow adding remote w same name as aliasAnastas Dancha, Dec 16, 2014
  2. Johannes SchindelinDec 16, 2014
  3. Anastas DanchaDec 16, 2014
  4. Johannes SchindelinDec 19, 2014
  5. Anastas DanchaDec 19, 2014
  6. Michael J GruberDec 19, 2014
  7. Anastas DanchaDec 20, 2014
  8. Johannes SchindelinDec 21, 2014
  9. Michael J GruberDec 16, 2014
  10. 0/2 Let `git remote add` play nicer with url.<url>.insteadOfJohannes Schindelin, Dec 22, 2014
  11. 1/2 git remote add: allow re-adding remotes with the same URLJohannes Schindelin, Dec 22, 2014
  12. Junio C HamanoDec 22, 2014
  13. Johannes SchindelinDec 23, 2014
  14. 2/2 Add a regression test for 'git remote add <existing> <same-url>'Johannes Schindelin, Dec 22, 2014
  15. 0/2 Let `git remote add` play nicer with url.<url>.insteadOfJohannes Schindelin, Dec 23, 2014
  16. 1/2 git remote: allow adding remotes agreeing with url.<...>.insteadOfJohannes Schindelin, Dec 23, 2014
  17. 2/2 Add a regression test for 'git remote add <existing> <same-url>'Johannes Schindelin, Dec 23, 2014
  18. Johannes SchindelinDec 23, 2014
  19. Junio C HamanoDec 23, 2014

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.