Recently we got complaint/suggestion from TG project about sample git clone commands we provide. We suggest form "git clone <repo url=""> <project name="">", but that doesn't work well for project with multiple repos, for example TG gets:
git clone git://git.code.sf.net/p/turbogears2/tg2 turbogears2 git clone git://git.code.sf.net/p/turbogears2/tg2devtools turbogears2 git clone git://git.code.sf.net/p/turbogears2/tg2docs turbogears2
As a stop-gap measure, Mark suggested using just "git clone <repo url="">" if there're >1 repos in a project. That should work well until we settle how to make sure that name for even one repo is selected by users well (i.e. we guide users to select what they want, instead of current default "code").
I'd actually like to see us modify the clone command so it takes project_shortname/mount_point and converts slashes to dashes:
This will also fix the problem of subprojects trying to clone to nested directories.
git clone git://git.code.sf.net/p/turbogears2/tg2 turbogears2-tg2
Would this be what TG people want? I'm not sure. And I'm sure that's not what I'd want in the following scenario: I created project "my-hacky-tools", it has just one repo which I smartly called to match the project name. Then, I don't want my users to be presented with command like:
git clone git://git.code.sf.net/p/my-hacky-tools/my-hacky-tools my-hacky-tools-my-hacky-tools
Rather, I'd prefer to be presented with command git://git.code.sf.net/p/my-hacky-tools/my-hacky-tools.git . That's also what almost everybody else does out there - just have good repo name. And IMHO we should do just that, and guide users into selecting good repo name and allow to change it if they find it not suitable.
I'm not fully aware of problems with subprojects' repos, that's why I guess we should fix obvious issue (multi-repo case) and think out whole concept on dealing with SCM URLs.
Well, the problem is that the repo names are all going to default to 'code' -- git, svn, and hg. And if you want to change the name of your checkout directory, it's trivial to either edit your checkout command or use 'mv'. Allowing users to change mount points is an unknown-difficulty problem since we use the mount point as part of various artifact urls, email routing, solr indexing, shortlinks, etc. The reason I like my proposal is that it gives you something that a) is meaningful (i.e. not 'code' or 'src' or 'git'), b) is conflict-free (for multiple repositories in a project, and c) handles subprojects better (i.e. not 'pylonsproject/turbogears', as we saw before when we used the project shortnames).
(just saw Rick's post, sending mine anyway to reinforce our opinions I guess. And not wast time editing)
The default mount point for all 3 scms, and used upon project creation, is "code". So just using that mount point would not produce a good checkout command.
I'm in favor of Rick's recommendation. The most common checkout could be like "my-hacky-tools-code". An alternate option is use something (e.g. the project name) if only one repo, and something else if there are more than one. I don't like that though because it is complex and changes things when you add another repo.
I vote for rick's solution as a sort term solve. Long term we could allow the default checkout directory to become configurable, but I don't see that as being valuable enough to spend time on it given all of our other priorities.
The decision's been made (sorry Paul).
Also see [#1793], maybe it at the same time. That would also let other Allura implementors change how this works on their instance.
Related
Tickets:
#1793Closing as out-of-date in favor of #1793.