[bitbake-devel] [PATCH] fetch/git: Change to use clearer ssh url syntax for broken servers

Andre McCurdy armccurdy at gmail.com
Wed Jan 13 23:59:57 UTC 2016


On Wed, Jan 13, 2016 at 3:20 PM, Andre McCurdy <armccurdy at gmail.com> wrote:
> On Wed, Jan 13, 2016 at 2:19 PM, Richard Purdie
> <richard.purdie at linuxfoundation.org> wrote:
>> On Wed, 2016-01-13 at 13:37 -0800, Andre McCurdy wrote:
>>> On Thu, Jan 7, 2016 at 5:18 AM, Richard Purdie
>>> <richard.purdie at linuxfoundation.org> wrote:
>>> > Some servers, e.g. bitbucket.org can't cope with ssh:// as part of
>>> > the git url syntax. git itself is happy enough with this but you
>>> > get server side errors when using it.
>>> >
>>> > This changes the git fetcher to use the more common ssh url format
>>> > which also means we need a : before the path.
>>>
>>> This seems to break SRC_URIs using ssh to access self hosted git
>>> servers setup following the process described here:
>>>
>>>   https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Ser
>>> ver
>>>
>>> An example of such a SRC_URI, which now fails to work:
>>>
>>>   SRC_URI = "git
>>> ://git at mylocalserver.com:/opt/git/myrepo.git;protocol=ssh"
>>
>> Does:
>>
>> SRC_URI = "git://git@mylocalserver.com/opt/git/myrepo.git;protocol=ssh"
>>
>> work though?
>
> Removing the ':' breaks things from the command line, but it does work
> OK in a SRC_URI (previously because of the ssh:// prefix and now
> because the fetcher is effectively adding the ':' back again).
>
> Updating my SRC_URIs looks like the best solution.
>
>> I'm not sure we ever suggested people should use ":/" in SRC_URI since
>> that isn't a url format the system was ever designed to cope with. It
>> might have happened to work but that is different...
>
> ":/" comes from the examples in the git-scm.com documentation:
>
>   https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server
>
> It would be nice if those examples (continued to) work in SRC_URIs and
> it's also nice if git URLs from SRC_URIs can be tested with git on the
> command line. Maybe those goals aren't worth the extra complexity
> though...

One final comment is that the original problem in #8864 seems to be
due to git's handling of URLs which contain both ssh:// and ':' (and
not an issue with BitBucket).

Setting GIT_SSH to a wrapper script which calls 'ssh -v' shows:

  $ git ls-remote ssh://git@bitbucket.org:armcc/openembedded-core.git
  ...
  debug1: Sending command: git-upload-pack '/openembedded-core.git'

ie the BitBucket username (armcc in this case) has already been
dropped before the git-upload-pack command is set to the server.

Trying to use the ssh:// prefix together with a URL containing a ':'
fails in exactly the same way with GitHub as well.

(Tested with git 1.9.1).


>> Cheers,
>>
>> Richard



More information about the bitbake-devel mailing list