git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Javier Mora <cousteaulecommandant@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Potential problems with url.<base>.insteadOf
Date: Fri, 26 Aug 2022 09:16:40 -0700	[thread overview]
Message-ID: <xmqq35dj0yl3.fsf@gitster.g> (raw)
In-Reply-To: <CAH1-q0iPsnkypiF=2LRgXwNqE_+R0gj706FCKgqGEUum+OAhQg@mail.gmail.com> (Javier Mora's message of "Fri, 26 Aug 2022 01:47:08 +0200")

Javier Mora <cousteaulecommandant@gmail.com> writes:

> This results in an ambiguous case, and Git does nothing to prevent it!
> The documentation says that the longest insteadOf value wins, but both
> have the same length since both are the same URL.

The longest has this case in mind:

    [url "A"] insteadof = https://example.com/
    [url "B"] insteadof = https://example.com/special/

So "A" is used as a replacement for the whole site, except for the
special hierarchy that is rewritten to "B".

Getting rid of what you no longer need with "config --unset" is the
right thing to do, and you did fine in the previous example.

      parent reply	other threads:[~2022-08-26 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 23:47 Potential problems with url.<base>.insteadOf Javier Mora
2022-08-26  7:09 ` Andreas Schwab
2022-08-26  9:34   ` Javier Mora
2022-08-26 16:13 ` Junio C Hamano
2022-08-26 16:16 ` Junio C Hamano [this message]

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=xmqq35dj0yl3.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=cousteaulecommandant@gmail.com \
    --cc=git@vger.kernel.org \
    /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).