views:

535

answers:

1

My web hosting provider lets me access my webspace via WebDAV, so I thought I'd set up a git repository over there just to see what happens. Cloning the repository read-only works just fine, as "git clone http://my.server.com/repo.git" just uses the standard HTTP transport.

Problems arise when I try to use WebDAV, because my user id is "[email protected]" and I have to use port 2077. This means I have to do something like

git config remote.origin.pushurl http://[email protected]@my.server.com:2077/repo.git

and the two @ signs in the URL must be causing problems because "git push origin master" reports "error 22".

I tried creating a .netrc file entry

machine    my.server.com
login      [email protected]
password   ****

but that didn't seem to help.

I've also tried replacing the first "@" with a "%", "\@" and "%40" but none of those worked.

+1  A: 

If the URI used by WebDAV does follow the Uniform Resource Identifier (URI): Generic Syntax (rfc3986), there should not be any @ in the userinfo

 authority     = [ userinfo "@" ] host [ ":" port ]
 userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
 pct-encoded   = "%" HEXDIG HEXDIG

 unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
 sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
               / "*" / "+" / "," / ";" / "="


 reserved      = gen-delims / sub-delims
 gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"

So did you try just with http://[email protected]:2077/repo.git?

VonC
I tried dav://[email protected]:2077/ on my Ubuntu laptop before I got anywhere near Git. It didn't work, and took several fruitless hours to discover that I needed dav://my.server.com:2077/, then enter [email protected] and password when prompted. Whoever wrote that bit of cPanel-11 (used by my hosting provider) obviously wasn't thinking about RFC-compliant usernames :-(
kbro
So my question actually has nothing to do with Git. The WebDAV implementation on my server uses usernames that don't comform to RFC 3986, so unless it supports a replacement character for "@" then I'm stuffed!
kbro
@kbro I am afraid it starts to look that way... And I do not know about any replacement for the at sign in an id username.
VonC
I tried every one you listed in sub-delims, and most of gen-delims too. No joy. I've asked my webhost provider to get onto the cPanel developers to report the problem.
kbro
@kbro: sorry it has to come to that. I hope they will find some kind of solution or workaround.
VonC