Page MenuHomePhabricator

Running `git clone` against a Mercurial repository does not produce an error message with explicit guidance
Closed, ResolvedPublic

Description

I work at a company with a large number of repositories - around 300 - some of which are little-used. The vast majority are Git repos, but a couple are still in hg (especially some of the more obscure repos). Today, one of our engineers went to clone one of these little-used repos - navigating there by directly typing the repo slug into the URL, rather than through the Diffusion UI (because we have so many repos). He attempted to git clone it, and received an error message informing him:

fatal: '/phab_path/repos/<redacted>' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

After some minutes of attempting to figure out whether his git configuration was somehow messed up, or if he didn't have access rights, he came to our team, and fortunately someone knew offhand that this was an hg repository. (Otherwise, I'm sure we would have eventually noticed the .hgignore file in the base of the repo, but it's not the first place we looked.)

The root problem, as I see it, is that if an engineer attempts to use the wrong VCS on a repo, there is not an immediate and obvious way for them to realize the nature of their simple mistake. In this case, the engineer (and I) suspected a number of other things before we realized he was using the wrong VCS.

My proposed solution would be that we indicate in the "Details" view which VCS is in use. I know that the type is shown when browsing repositories, but it's easy to miss, especially if you directly navigate to the repository page URL.

Event Timeline

We only take feature requests that state root problems, see Contributing Feature Requests and Describing Root Problems.

Ok, appreciate the feedback - I'll try to tackle it in a bit more detail.

Basically, if this request is just a suggestion, we'll probably pass on accepting it (see Hypotheticals). But if people are frequently having issues (we haven't seen this) please give us more details on the workflow, etc, people are tripping up on. I don't think just adding the word "Git" somewhere will necessarily solve any core problem since people are not likely to read, for instance.

Absolutely makes sense - provided some more background on the problem. Looking forward to hearing your thoughts.

Thanks! We can just improve this error message, which should resolve the problem more directly.

$ git clone ssh://local@localvault.phacility.com/source/quack.notgit/
Cloning into 'quack.notgit'...
phabricator-ssh-exec: This repository ("quack.notgit") is not a Git repository. Use "hg" to interact with this repository.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
epriestley renamed this task from Type of repository visible in Diffusion repository page to Running `git clone` against a Mercurial repository does not produce an error message with explicit guidance.Dec 2 2016, 3:30 PM
epriestley triaged this task as Normal priority.
epriestley added a project: Diffusion.

Damn, that was fast! This should be a perfect solution - thank you for your help.