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

Re: [PATCH 1/3] connect.c: Improve parsing of literal IPV6 addresses

From
Torsten Bögershausen <tboegi@web.de>
Date
Feb 20, 2015, 22:11 UTC
Message-ID
<54E7B105.8020100@web.de>
In-Reply-To
<20150219194050.GA5021@vauxhall.crustytoothpaste.net>
On 2015-02-19 20.40, brian m. carlson wrote:
> On Thu, Feb 19, 2015 at 09:54:52AM -0800, Junio C Hamano wrote:
>> I can see that you do not agree with the "If we accept it" part
>> (where "it" refers to "allowing [...] was a bug.")---past acceptance
>> was not a bug for you.
Do we talk about the same thing here ?
The support for the ssh://host/path was introduced 2005, I think here:
commit 2386d65822c912f0889ac600b1698b0659190133
Author: Linus Torvalds <torvalds@g5.osdl.org>
Date:   Wed Jul 13 18:46:20 2005 -0700
    Add first cut at "git protocol" connect logic.
------------
It happily accepted everything for host, including 
 ssh://bmc@2001:470:1f05:79::1/git/bmc/homedir.git/

And this was the only way to connect to a server using a literal IPV6 address, the support for [] came in later.

Today, in 2015, we can declare this syntax as deprecated, no problem.

The parser we have in git.master does not handle URLs like ssh://bmc@[2001:470:1f05:79::1]/git/bmc/homedir.git/ correctly.

Instead of this, ssh://[bmc@2001:470:1f05:79::1]/git/bmc/homedir.git/ needs to be used, and this is the main purpose of the series. (If we ignore updates of the test cases, which I think are good to prevent regressions)

I could probably shorten the commit message of [1/3] to read like this: 
  Improve the parsing to handle URLs which have a user name and a literal
    IPV6 like "ssh://user@[2001:db8::1]/repo.git".
    (Thanks to Christian Taube <lists@hcf.yourweb.de> for reporting this long
    standing issue)
Show 36 quoted lines
>>
>> Brian is for that "If we accept it", and sees it as a bug.
>>
>> So let's see what he comes up with as a follow-up to the "we should
>> explicitly document it" part.
> 
> Here's what I propose:
> 
> -- >8 --
> Subject: [PATCH] Documentation: note deprecated syntax for IPv6 SSH URLs
> 
> We have historically accepted some invalid syntax for SSH URLs
> containing IPv6 literals.  Older versions of Git accepted URLs missing
> the brackets required by RFC 2732.  Note that this behavior is
> deprecated and that other protocol handlers will not accept this syntax.
> 
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> Documentation/urls.txt | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/urls.txt b/Documentation/urls.txt
> index 9ccb246..2c1a84f 100644
> --- a/Documentation/urls.txt
> +++ b/Documentation/urls.txt
> @@ -38,6 +38,10 @@ The ssh and git protocols additionally support ~username expansion:
> - git://host.xz{startsb}:port{endsb}/~{startsb}user{endsb}/path/to/repo.git/
> - {startsb}user@{endsb}host.xz:/~{startsb}user{endsb}/path/to/repo.git/
> 
> +For backwards compatibility reasons, Git, when using ssh URLs, accepts
> +some URLs containing IPv6 literals that are missing the brackets. This
> +syntax is deprecated, and other protocol handlers do not permit this.
> +
> For local repositories, also supported by Git natively, the following
> syntaxes may be used:
> 
Previous: brian m. carlson
Message 9 of 9 in “connect.c: Improve parsing of literal IPV6 addresses”
  1. 1/3 connect.c: Improve parsing of literal IPV6 addressesTorsten Bögershausen, Jan 19, 2015
  2. brian m. carlsonJan 22, 2015
  3. Torsten BögershausenJan 22, 2015
  4. brian m. carlsonJan 22, 2015
  5. Junio C HamanoFeb 18, 2015
  6. Torsten BögershausenFeb 19, 2015
  7. Junio C HamanoFeb 19, 2015
  8. brian m. carlsonFeb 19, 2015
  9. Torsten BögershausenFeb 20, 2015

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.