From 5f380c3848c680769986e9b953ee53cbe021ec0c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 10 Sep 2014 14:17:02 -0400 Subject: Fix parsing of ipv6 address in git remote address when it was not formatted as an url. --- Git/Remote.hs | 8 +++++++- debian/changelog | 2 ++ doc/bugs/ssh_over_IPv6.mdwn | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Git/Remote.hs b/Git/Remote.hs index 9d969c416..7573c87ee 100644 --- a/Git/Remote.hs +++ b/Git/Remote.hs @@ -102,7 +102,13 @@ parseRemoteLocation s repo = ret $ calcloc s && not ("::" `isInfixOf` v) scptourl v = "ssh://" ++ host ++ slash dir where - (host, dir) = separate (== ':') v + (host, dir) + -- handle ipv6 address inside [] + | "[" `isPrefixOf` v = case break (== ']') v of + (h, ']':':':d) -> (h ++ "]", d) + (h, ']':d) -> (h ++ "]", d) + (h, d) -> (h, d) + | otherwise = separate (== ':') v slash d | d == "" = "/~/" ++ d | "/" `isPrefixOf` d = d | "~" `isPrefixOf` d = '/':d diff --git a/debian/changelog b/debian/changelog index eb917a0b9..fee2a3666 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ git-annex (5.20140832) UNRELEASED; urgency=medium * init: Automatically detect when a repository was cloned with --shared, and set annex.hardlink=true, as well as marking the repository as untrusted. + * Fix parsing of ipv6 address in git remote address when it was not + formatted as an url. -- Joey Hess Thu, 04 Sep 2014 16:17:22 -0400 diff --git a/doc/bugs/ssh_over_IPv6.mdwn b/doc/bugs/ssh_over_IPv6.mdwn index d4f2e70f7..b5e9f0358 100644 --- a/doc/bugs/ssh_over_IPv6.mdwn +++ b/doc/bugs/ssh_over_IPv6.mdwn @@ -18,3 +18,12 @@ local repository version: 5 supported repository version: 5 upgrade supported from repository versions: 0 1 2 4 ``` + +> [[Fixed|done]] by adding support for ipv6 addresses when git-annex +> converts a git remote loction into an url. BTW, the +> simple workaround is to give it a valid url from the beginning +> `ssh://[fcb8:b10:1cb8:c94:58d0:2522:89f9:c89e]/home/thomas/git/musik"` +> +> As to any problems using an ipv6 remote once it's set up, I've used them +> with no problems. +> --[[Joey]] -- cgit v1.2.3