ARMmbed / ARMmbed/mbed-cli

mbed import treats URLs differently differently than git clone

Open
#706 13 comments 0 reactions 0 assignees View on GitHub
Jira status: OPEN mirrored type: bug
Dominant language
Python
Stars
339
Forks
187
PR merge metrics
No merged PRs in 30d

Description

I would like to import from a git repo on a computer.
```
mbed import --protocol git user@host:path/to/repo/from/home/dir
```
This fails, because it tries to clone from `ssh://user@host/path/to/repo/from/home/dir`
It then proceeds to try mercurial, and complains that mercurial isn't installed in spite of passing `--protocol`
If you do
```
git clone user@host:path/to/repo/from/home/dir
```
It effectively expands (no idea how it actually does it) to `ssh://user@host/home/user/path/to/repo/from/home/dir`
So the correct command is
```
mbed import user@host:/home/user/path/to/repo/from/home/dir
```

The moral of this story is I did `mbed import --protocol git user@host:path/to/repo/from/home/dir` and got the error that mercurial was not installed.

I'm not sure what a good solution to this is, because we can't assume `/home/user`, correct?

It was just fairly confusing.

Also how to get help on a subcommand is really unclear.
`mbed help` makes sense, so I tried `mbed help import`, `mbed import help`, `mbed --help import`, and then asssumed there was no help for subcommands.
I proceeded to start reading the source to figure out how the protocol was set, and I found what should be help for subcommands.
I started reading up on how the argparser library worked to try to suggest a fix, and saw that some tutorial used the invocation `command subcommand --help`.
Maybe mention that in the results of `mbed help`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the documented mbed import commands and then inspect the import subcommand source where protocol selection and repository URLs are handled. Read the argument-parser setup for subcommand help and compare its behavior with the commands described in the issue. Done means the reported URL and --protocol behavior is resolved or clearly reported, and mbed help points users to the supported subcommand help syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
cli, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.