Message ID | 1384799896-28321-2-git-send-email-jabk@prevas.dk |
---|---|
State | Changes Requested |
Delegated to: | Esben Haabendal |
Headers | show |
jabk@prevas.dk writes: > From: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk> > > git clone will interpret git@git.mygitserver.org:mygit.git as ssh if it > exist. This commits fixes implicitly given ssh protocol. > This is not error prone. If a @ is not given git may prompt for username, but it > fixes more cases. > --- > lib/oelite/baker.py | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/oelite/baker.py b/lib/oelite/baker.py > index dfb99d2..8243902 100644 > --- a/lib/oelite/baker.py > +++ b/lib/oelite/baker.py > @@ -201,6 +201,13 @@ class OEliteBaker: > if url.startswith('%s://'%(protocol)): > srcuri = 'git://%s'%(url[len(protocol)+3:]) > break > + if protocol == 'ssh': > + index = url.find('@'); > + if index > 0: > + srcuri = 'git://%s'%( > + url.replace(':/','/').replace(':','/') > + ) > + break This check should be done after the for loop, not in it. The actual url syntax we should support is: [user@]host.xz:path/to/repo.git/ So checking for a '@' in the url does not cover the use case where 'user@' is not included. So perhaps just let the current for loop run to an end, and if nothing matched, do some kind of sanity checking and if it looks okay, convert the colon thingy. > self.config.set('MANIFEST_ORIGIN_URL', url) > self.config.set_flag('MANIFEST_ORIGIN_URL', 'nohash', True) > if srcuri is None: /Esben
Hi Jakob Any updates on the below patch? /Christian
diff --git a/lib/oelite/baker.py b/lib/oelite/baker.py index dfb99d2..8243902 100644 --- a/lib/oelite/baker.py +++ b/lib/oelite/baker.py @@ -201,6 +201,13 @@ class OEliteBaker: if url.startswith('%s://'%(protocol)): srcuri = 'git://%s'%(url[len(protocol)+3:]) break + if protocol == 'ssh': + index = url.find('@'); + if index > 0: + srcuri = 'git://%s'%( + url.replace(':/','/').replace(':','/') + ) + break self.config.set('MANIFEST_ORIGIN_URL', url) self.config.set_flag('MANIFEST_ORIGIN_URL', 'nohash', True) if srcuri is None:
From: Jacob Kjaergaard <jacob.kjaergaard@prevas.dk> git clone will interpret git@git.mygitserver.org:mygit.git as ssh if it exist. This commits fixes implicitly given ssh protocol. This is not error prone. If a @ is not given git may prompt for username, but it fixes more cases. --- lib/oelite/baker.py | 7 +++++++ 1 file changed, 7 insertions(+)