Page MenuHomePhabricator

Show full clone commands instead of URIs

Authored by epriestley on Jan 28 2014, 11:04 PM.



Ref T4175. Currently, the remote URIs for repositories are /diffusion/X/, which gives you a directory called X on disk. Users would rather have something called example/.

Eventually I'd like to implement T4175, but that requires some testing. For now (and as a general improvement), provide the user with the entire clone command instead of just the remote URI. This will generally produce the desired result. We can refine this later.

Test Plan

Viewed Git, Subversion and Mercurial repositories, saw full clone commands instead of just URIs.

Diff Detail

rP Phabricator
Lint Passed
No Test Coverage

Event Timeline

This seems like it would be problematic if I want the name of my repository to be different than the directory I expect it to be cloned into. The command you're generating probably doesn't work very well if there happen to be spaces in the repository name.

The command should work fine with spaces (and repositories named `sudo rm -rf /` and such), but you're right in general -- for example, this will clone Phabricator instead of phabricator. However, I think this will always clone a less surprising directory name than we did before (e.g., Phabricator is better than P).

I think we probably need to add additional configuration to set a name on disk -- we can prefill it with "lowercase and add some dashes" or something, but that won't always get things right. Then we could use that here, and provide it as the not-quite-canonical .git URI for Git.

Generally, this is an incremental step toward more reasonable behaviors, not a complete fix. I think it always produces reasonable results, and will sometimes produce the desired results.


(Minor, unrelated fix.)

Ok, that seems reasonable to me. Would it be possible to have a configuration option to suppress this until the "name on disk" is implemented?

If this isn't an improvement over the current behavior for you, I'll just hold it until we have a more sophisticated answer to T4175.