ARMmbed / mbed-cli

Arm Mbed Command Line Interface
https://os.mbed.com
Apache License 2.0
333 stars 176 forks source link

mbed add mangles ssh URLs and shows confusing messages #242

Closed bremoran closed 8 years ago

bremoran commented 8 years ago

The normal git way of handling ssh urls is not followed by mbed add:

annirak:~/workspace $ git clone git@github.com:ARMmbed/mbedtls.git
Cloning into 'mbedtls'...
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
remote: Counting objects: 41705, done.
remote: Compressing objects: 100% (906/906), done.
remote: Total 41705 (delta 637), reused 0 (delta 0), pack-reused 40799
Receiving objects: 100% (41705/41705), 21.54 MiB | 4.94 MiB/s, done.
Resolving deltas: 100% (30958/30958), done.
Checking connectivity... done.
annirak:~/workspace $ cd mbedtls/
annirak:~/workspace/mbedtls (development) $ git remote -v show
origin  git@github.com:ARMmbed/mbedtls.git (fetch)
origin  git@github.com:ARMmbed/mbedtls.git (push)

With mbed add:

annirak:~/workspace/test (master) $ mbed add --protocol ssh git@github.com:ARMmbed/mbedtls.git
[mbed] Adding library "mbedtls" from "https://github.com/ARMmbed/mbedtls/" at latest revision in the current branch
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
[mbed] Updating reference "mbedtls" -> "https://github.com/ARMmbed/mbedtls/#e012aa3ae2471f6e742a09ca44aa609acffa7e52"
The following paths are ignored by one of your .gitignore files:
mbedtls.lib
Use -f if you really want to add them.
annirak:~/workspace/test (master) $ cd mbedtls/
annirak:~/workspace/test/mbedtls (development) $ git remote -v show
origin  ssh://github.com/ARMmbed/mbedtls.git (fetch)
origin  ssh://github.com/ARMmbed/mbedtls.git (push)

Note that mbed add incorrectly reports https://github.com/ARMmbed/mbedtls/ and saves ssh://github.com/ARMmbed/mbedtls.git as the remote. Both of these should be the same as the original: git@github.com:ARMmbed/mbedtls.git

mbed update similarly reports https URLs when updating an ssh repo.

screamerbg commented 8 years ago

Now implemented in mbed CLI 0.8.1

bremoran commented 8 years ago

Version 0.8.1 still shows incorrect messages.

annirak:~/workspace $ mbed new --protocol ssh mbed-os-ucmm
[mbed] WARNING: Directory "mbed-os-ucmm" is not empty.
---
[mbed] Creating new program "mbed-os-ucmm" (git)
[mbed] Adding library "mbed-os" from "https://github.com/ARMmbed/mbed-os/" at latest revision in the current branch
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/core" from "https://github.com/mbedmicro/mbed/" at rev #737a7809f9e7
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_IPV6/sal-stack-nanostack-eventloop" from "https://github.com/ARMmbed/sal-stack-nanostack-eventloop/" at rev #c163be9183b0
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_IPV6/mbed-mesh-api" from "https://github.com/ARMmbed/mbed-mesh-api/" at rev #0e92921f3dce
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_IPV6/nanostack-hal-mbed-cmsis-rtos" from "https://github.com/ARMmbed/nanostack-hal-mbed-cmsis-rtos/" at rev #36968fc133c7
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_IPV6/mbed-trace" from "https://github.com/ARMmbed/mbed-trace/" at rev #e419c488f4f8
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_IPV6/sal-stack-nanostack-private" from "https://github.com/ARMmbed/sal-stack-nanostack-private/" at rev #5d3365ce7df3
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_IPV6/nanostack-libservice" from "https://github.com/ARMmbed/nanostack-libservice/" at rev #f61c845e0c59
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_CLIENT/mbed-client-randlib" from "https://github.com/ARMmbed/mbed-client-randlib/" at rev #80f5c491dd4d
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_CLIENT/coap-service" from "https://github.com/ARMmbed/coap-service/" at rev #7a11be1ccb07
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_CLIENT/mbed-client-mbed-tls" from "https://github.com/ARMmbed/mbed-client-mbed-tls/" at rev #b14e7b3303c8
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_CLIENT/mbed-client" from "https://github.com/ARMmbed/mbed-client/" at rev #a6a46726f027
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_CLIENT/mbed-client-classic" from "https://github.com/ARMmbed/mbed-client-classic/" at rev #c8ccada6b9ff
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/features/FEATURE_CLIENT/mbed-client-c" from "https://github.com/ARMmbed/mbed-client-c/" at rev #086b9c97f65b
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/frameworks/greentea-client" from "https://github.com/ARMmbed/greentea-client/" at rev #646297c0a1aa
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Adding library "mbed-os/frameworks/unity" from "https://github.com/ARMmbed/unity/" at rev #14fd303f30f9
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
[mbed] Updating reference "mbed-os" -> "https://github.com/ARMmbed/mbed-os/#60b8656d29dbd5a9d7f619f3cace1a7a1da96c7d"

Here, it reports https, when the protocol is ssh.

mbed add also reports the wrong address.

annirak:~/workspace/mbed-os-ucmm (master) $ mbed add git@github.com:ARMmbed/update-client-manifest-manager.git
[mbed] Adding library "update-client-manifest-manager" from "git@github.com:ARMmbed/update-client-manifest-manager.git/" at latest revision in the current branch
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
[mbed] Updating reference "update-client-manifest-manager" -> "https://github.com/ARMmbed/update-client-manifest-manager/#bb460384a55d6f1a7df5223e1e40cf415f4ede58"
The following paths are ignored by one of your .gitignore files:
update-client-manifest-manager.lib
Use -f if you really want to add them.