git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: gitster@pobox.com
Cc: anapsix@random.io, git@vger.kernel.org
Subject: [PATCH 0/2] Let `git remote add` play nicer with url.<url>.insteadOf
Date: Mon, 22 Dec 2014 18:06:46 +0100 (CET)	[thread overview]
Message-ID: <cover.1419267895.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <20141216021900.50095.24877@random.io>

Anastas Dancha reported that it is not possible to add a remote when
there is already a url.<url>.insteadOf = <nick> setting in
$HOME/.gitconfig.

While it makes sense to prevent surprises when a user adds a remote and
it fetches from somewhere completely different, it makes less sense to
prevent adding a remote when it is actually the same that was specified
in the config.

Therefore we add just another check that let's `git remote add` continue
when the "existing" remote's URL is identical to the specified one.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>


Johannes Schindelin (2):
  git remote add: allow re-adding remotes with the same URL
  Add a regression test for 'git remote add <existing> <same-url>'

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

-- 
2.0.0.rc3.9669.g840d1f9

  parent reply	other threads:[~2014-12-22 17:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  2:30 [PATCH] remote: allow adding remote w same name as alias Anastas Dancha
2014-12-16  9:01 ` Johannes Schindelin
2014-12-16 14:57   ` Anastas Dancha
2014-12-19  9:37     ` Johannes Schindelin
2014-12-19 15:44       ` Anastas Dancha
2014-12-19 16:30         ` Michael J Gruber
2014-12-20 20:57           ` Anastas Dancha
2014-12-21 20:40         ` Johannes Schindelin
2014-12-16  9:33 ` Michael J Gruber
2014-12-22 17:06 ` Johannes Schindelin [this message]
2014-12-22 17:06   ` [PATCH 1/2] git remote add: allow re-adding remotes with the same URL Johannes Schindelin
2014-12-22 17:49     ` Junio C Hamano
2014-12-23 13:25       ` Johannes Schindelin
     [not found]         ` <CAPc5daXcXs+Sw8jr65dmLnpf6LQ6Lr34y80bxSf2AhhFyXa_mQ@mail.gmail.com>
2014-12-23 18:26           ` Johannes Schindelin
2014-12-23 18:51             ` Junio C Hamano
2014-12-22 17:06   ` [PATCH 2/2] Add a regression test for 'git remote add <existing> <same-url>' Johannes Schindelin
2014-12-23 13:24 ` [PATCH v2 0/2] Let `git remote add` play nicer with url.<url>.insteadOf Johannes Schindelin
2014-12-23 13:25   ` [PATCH v2 1/2] git remote: allow adding remotes agreeing with url.<...>.insteadOf Johannes Schindelin
2014-12-23 13:25   ` [PATCH v2 2/2] Add a regression test for 'git remote add <existing> <same-url>' Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1419267895.git.johannes.schindelin@gmx.de \
    --to=johannes.schindelin@gmx.de \
    --cc=anapsix@random.io \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).