Closed GoogleCodeExporter closed 9 years ago
Relative urls often don't have to start with a '.', so this won't work.
urljoin will already use the second parameter url if it is not relative. What
exactly does the function end up returning in your example?
Original comment by conl...@google.com
on 2 Nov 2011 at 4:45
for example,
urlparse.urljoin("http://manifest-url.net/manifest.git", \
"git@ssh.my-gitolite.net:some/project")
returns;
'http://manifest-url.net/git@ssh.my-gitolite.net:some/project'
It should be;
'git@ssh.my-gitolite.net:some/project'
I did it with Python 2.6.6 in Ubuntu10.10.
Original comment by ff4...@gmail.com
on 3 Nov 2011 at 2:25
it's not bug from the urlparse.
I found following description in http://docs.python.org/library/urlparse.html
> Following the syntax specifications in RFC 1808, urlparse recognizes a netloc
only if it is properly introduced by ‘//’. Otherwise the input is presumed
to be a relative URL and thus to start with a path component.
How about check the url with '@'?
new patch attached.
Original comment by ff4...@gmail.com
on 3 Nov 2011 at 3:21
Attachments:
Seems a bit aggressive. Could you change this so that this only gets triggered
when the first '@' comes before the first '/'?
Also, while you are at it, could you change the comment to something like:
# Prevent urljoin from misinterpreting urls with a username
# as relative (ex: git@example.com:port/project)
Original comment by cco3@android.com
on 4 Nov 2011 at 5:18
[deleted comment]
I concerned about ssh address which not contains '/' like this:
git@example.com:port
But, I think checking the url with '@' and ':' is good enough.
Patch attached.
Original comment by ff4...@gmail.com
on 5 Nov 2011 at 5:20
Attachments:
I'm pretty sure that both @ and : are valid url characters after the host and
port.
What I'm asking for is something like re.match(r'[^/]+@', url)
Original comment by cco3@android.com
on 7 Nov 2011 at 5:10
Thanks for keep responding.
In that case, even "git@example.com:port" can be a relative url.
and, can't judge with silly regex magic.
So, I think a new attibute -something like "abs_fetch"- needed in
remote node of the xml to avoid ambiguity. for example:
<remote name="my_github" abs_fetch="git@github.com:suapapa" />
I can work for it if you agree with it.
Please give me some advice.
Original comment by ff4...@gmail.com
on 8 Nov 2011 at 12:08
If you want to avoid ambiguity, I think it would be best to simply specify the
scheme (ie ssh://) in the url. Do you have any problems if you do that?
Original comment by cco3@android.com
on 9 Nov 2011 at 6:58
As we discussed here, current repo handle URL as a relative one
if it don't have protocol header (ie ssh://).
git@example.com:path/to/projetct.git
It's a scp-like syntax. (check 'GIT URLS' in `git help clone`)
Oh! I forgot mention it. In scp syntax use ':' for path not port.
and can't attach 'ssh://' in front of the URL
(becasue of in ssh:// they use ':' for port)
following is part of `git help clone`:
GIT URLS
...
An alternative scp-like syntax may also be used with the ssh protocol:
· [user@]host.xz:path/to/repo.git/
And, It's very common.
Many git host use this scp-like syntax.
Even the GitHub use this URL in private clone address.
I think protocol header mandatory policy in current repo is too restrict.
Original comment by ff4...@gmail.com
on 10 Nov 2011 at 1:21
You can't do "ssh://git@git.mysite.net/mirror/github"?
Original comment by cco3@android.com
on 11 Nov 2011 at 10:12
It works!
With some fix in my manifest.xml like this;
ssh://git@git.mysite.net/mirror/github
everything works fine now.
What I tried before is:
ssh://git@git.mysite.net:mirror/github
Thanks for the help and patient.
Original comment by ff4...@gmail.com
on 14 Nov 2011 at 6:28
No problem!
Original comment by cco3@android.com
on 14 Nov 2011 at 7:26
Original comment by david.pu...@sonymobile.com
on 9 Apr 2013 at 1:23
Original issue reported on code.google.com by
ff4...@gmail.com
on 2 Nov 2011 at 8:10Attachments: