Mercurial hosting with folders / repository organizing capabilities - version-control

I'm currently using Bitbucket for my Mercurial repositories and it's working great. I would however like to be able to organize my repositories in folders, as having them all in one long list is a bit disorganized for my liking.
To be clear I'd like to be able to access my repositories kind of like this:
hg clone https://username#bitbucket.org/username/foldername/reponame
While (AFAIK) it is currently only possible to use a single reponame, no foldername.
Is there any Mercurial hosting provider that does this, or is there some other method that might help me organize my stuff?
I'm aware of subrepos and I might look into that, but it seems like a hackish solution to my problem (also one of the clusters I am working on uses an ancient Mercurial version from way before subrepos were added). Another possibility would be to have multiple user accounts for Bitbucket, but again that doesn't really scale well (I don't want to wind up with 10 accounts).

You will have to use separate repositories.
Kiln has a nice interface that supports multiple repositories.
Organize Your Code
Start simply by just creating the repositories you need for your
code. Kiln introduces branch repositories, repository groups, and
projects to help keep things organized as you develop your own
workflow.
...
Repository Groups and Projects are there to help keep related code
grouped together. Whether your software project is large or small, it
can be really helpful to separate different parts of the code into
different repositories. What used to be accomplished with complicated
naming schemes is now accomplished with simple labels and
drag-and-drop organization.

Kiln (kilnhg.com) has a concept of projects and groups for organizing repositories along with several other really cool features.
It is a commercial product, however. (Your question didn't mention whether or not that was a problem for you.)

The only way you can obtain this using Bitbucket is to create a single repository named "foldername" and put the sub-repository inside this 'root repository'. This however is not the best practice according to the mercurial philosophy. Also, you will have a single bitbucket panel as per a single repository.
You can then use the mercurial feature Suprepositories to manage the whole collection:
https://www.mercurial-scm.org/wiki/Subrepository
Read about the kind of layout you are looking for here:
https://www.mercurial-scm.org/wiki/UnderstandingMercurial
(point 6, at the end of the page)
Of course you can setup your personal mercural server to do this, but is a little bit tricky and I discourage it. If you wanto to try, you can start from here:
http://ekkescorner.wordpress.com/blog-series/git-mercurial/step-by-step-install-mercurial-server-on-ubuntu/

Related

Should mini projects have their own repositories on GitHub?

I tried a few searches related to this questions on here and didn't see something similar.
As part of a bootcamp I am working on, I have a few mini-projects I have to submit. These projects take between 2-10 hours to complete and typically only contain 1-5 files each. I've seen other students have separate repositories for each of the projects, which allows them to have a clean readme.txt. Initially, I grouped these mini projects into folders within one repository dedicated to these mini projects to reduce clutter. So I can see potential advantages to either approach. At either rate, these small projects were designed to demonstrate very specific skills that are relevant to future employers, so I want them to be available for inspection.
So is there a "best practice" if I am intending to use GitHub as a portfolio of my code? Would it be better to declutter my repositories by keeping small projects together so my bigger projects can shine? Or to separate them so each project is readily in-sight?
have separate repositories for each of the projects, which allows them to have a clean readme.txt.
You can have a clean readme.txt/readme.md with one repo, which would:
explain what the subfolder represents
list your subfolders
link to sub-readme.md (one readme.md per subfolder, per project)
That being said, you can create an account dedicated for this bootcamp, and keep your repos separate, that way you avoid the clutter with your main GitHub account.

Grouping repos on GitHub? [duplicate]

This question already has answers here:
Can I arrange repositories into folders on Github?
(8 answers)
Closed 4 years ago.
Here's the situation: I'm migrating a bunch of repos to github. The repos are currently organized into groups/directories like 'stack', 'websites', 'applications', etc.
There's no way (I've found) to create groups or folders on GitHub for repos, except with organizations, which seems a poor choice. But maybe not? The problem here is that some of the groups are very small, while others are large... with sub-groups, and I'd like to keep all the projects in one root bucket.
So, I'm left with maybe using a naming convention. Like: 'stack-apache', 'website-foo.com', 'application-some-project'. Or just giving up on organizing them in github and let the project pages / website handle the organization.
Re. scale, I'm looking at 20+ repos initially, with new repos added over time at an estimated rate of 2-5 /year for the next few years.
Anyone have experience with this kind of thing?
Update 2020
I'm not sure exactly when, but Github has (somewhat recently) added the concept of projects, which kind of fill the missing gap. I would argue they aren't quite the same as Bitbucket Projects but they are better suited to grouping related repo's in Github than Orgs
Original answer
Organisations in my opinion fit a different purpose in Github than grouping repos (although they do serve to group repos). Organisations are more about fine grained control around repo access (thats my understanding).
Bitbucket has introduced the concept of "Projects", with the following hierarchy (with a comparison to Github):
Bitbucket: Team -> has N -> Projects -> has N -> Repos
Github: Organisation -> has N -> Repos
Bitbucket still allows Repos to not be assigned to an team or project, I am guessing to support older repos that existed before the concept of a project.
To answer the question, no, not directly. There are outstanding requests with Github to add groups, but it doesn't seem likely (at this point in time).
Prefixing works as a so-so solution:
Repo name: [project]__[repo name]
Lets say you have a client "acme" with two repos:
Eg: acme__api
Eg: acme__landing
Github's search is quick and inline, so doing a search for acme__ in your repo list will list all repos for the acme__ project.
The idea really is to use organizations to group your related repo together. This also makes it easier for your team member to filter their activity feeds to only organizations they're interested into.
This is like that on Github as git is repo based, not file system based like SVN.
Maybe "Organization" is not a very intuitive name, but on alternative Git platform like Gitlab, these divisions are named "group". You should really consider them like that.
I think, the idea to group repos on the github is that just put a delimiter between items you want to be related to each other. For example, "project1_projectA_projectX", or "project1-projectA-projectX", or even "project1--projectA--projectX".
For myself I prefer the double-dash delimiter as more intuitive for replacement of the slash character delimiter (/) and less usable in a standalone repository name.
Then the list of your planning projects you have to create would be:
project1
project1--projectA
project1--projectA--projectX
As soon as you create a repository with a delimeter (_ or -) in your name, there is won't be an option to set, for example, the repo description or license from the repo title page. You have to handle these from the repository title page after a first push has made. But you can leave it simple, for example, for the projectX it would be something like this: "project1--projectA submodule".

TFS- shall I create a branch or a separate team project?

I would like to know if I have a project, and I want to create a separate test and release projects/branches.
Shall I create one team project and then create branches like test, dev and release?
OR can I also go for a separate team project for each?
One of our clients have been using separate team projects for each.
Could you elaborate under which circumstances shall we opt for a team project instead of a branch? What are the pros and cons of each approach?
To the best of my knowledge, I think branches should have been used in this scenario.
Thanks for your help.
A new branch will provide merging and build options that can't be done from one project to another. If you create branches you can share work items (tasks, bugs, ...) between all of them, if you create projects, developers will need to go to each project to find tasks, etc.
Usually it's better to crate branches for each environment. If you go for team projects make sure there is a good reason for it.
Take a look to this article, it may be helpful:
http://nakedalm.com/when-should-i-use-areas-in-tfs-instead-of-team-projects-in-team-foundation-server-2010/
Branches should be just fine, no need for multiple team projects.

How to use Bazaar with Dropbox?

I want to write a code (in fact a latex file) with other collaborators. We wish to collaborate through Dropbox and version control our file with Bazaar.
How to do it? Is there a short tutorial how to do this?
Is there a better way to collaborate on a single file in Dropbox, that is, without a version control system?
Is there a better control version system suitable for Dropbox, which is also easy to learn.
NOTES: I use only the bare basics of version control in Bazzar. I don't know how to use any version control systems properly, unfortunately. I need some very simple mechanism.
Create a Bazaar repository without a working tree on your shared dropbox folder:
bzr init --no-tree /path/to/subfolder/in/dropbox
You and your team can checkout or branch from this common repository. The good thing about not have a working tree is that nobody will work on it directly by mistake. It's cleanest if each of you checkout/branch from this repository.
If you already have an existing repository, you can push it to the dropbox folder without a working tree like this:
cd /your/local/working/tree
bzr push --no-tree /path/to/subfolder/in/dropbox
The above is a standalone repository setup. If later you want to share multiple branches with your team, it will be more optimal to use a shared repository instead. That way will save storage space and bandwidth. I think it's probably a bit advanced for you now, but if you need it in the future, you can easily migrate your existing repository to a shared repository setup like this:
cd /path/in/dropbox
bzr init-repo --no-trees repo
bzr branch /path/to/old/repo repo/trunk
Afterward you can create multiple branches side by side with trunk inside the repo to share within your team, and it will be efficient.
As per your second question, I think it's better to use version control rather than a single unversioned file. This is a bit of an investment, but it will surely pay off in the long term.
As per your second question, Bazaar is a very easy to use, very intuitive tool. I think it's an excellent choice for you. (Disclaimer: I recently wrote a book on Bazaar.)

Multiple Git repositories for each Eclipse project or one Git repository

I am in the process of moving to Git from SVN. In SVN I had multiple eclipse projects in a single SVN repository that is convenient for browsing projects. I was going to move to having one git repository per eclipse project but EGit suggests doing otherwise.
The guide for EGit suggests putting multiple projects into a single Git repository.
Looking at similar questions such as this suggest one project per repository.
Which approach is best practice and what do people implement?
It depends on how closely-related these projects are. Ask yourself the following questions:
Will they always need to be branched/tagged together?
Will you want to commit over all projects, or does a commit mostly only touch one project?
Does the build system operate on all of them or do they have a boundary there?
If you put them all in one, some things from above will be easier. You will only have to branch/tag/stash/commit in one repository, as opposed to doing it for every repository separately.
But if you need to have e.g. separate release cycles for the projects, then it's necessary to have each project in an independent repository.
Note that you can always split up a repository later, or combine multiple repositories into one again without losing history.
Combining is a bit harder to do than splitting, so I would go for one repository first and see how it goes.
I use 1 repo per project.
Some reasoning:
When you discover you messed up something after several commits, it's much easier to fix when it's just one project. Just think about, you did commits to two other projects and now you need to fix the commit you did on the 3rd project.
As Fedir said, your history and log is much cleaner. It only shows the commits for that project.
It works better with the development workflow I have. I have a master branch for production, develop branch for, well, development, and I create branches to implement features (you can read more about it here: http://blog.avirtualhome.com/development-workflow-using-git/)
When you work in a team, and so "share" the git repo, do the team members really need all the other projects as well?
Just a few thoughts, but what it boils down to: Do what works for you.
I have multiple projects (Eclipse projects) and have tried different things to find out what worked best in terms of actual daily development. Here is what I found and I think that most people would find the same thing if they kept track of the results and analyzed the results objectively.
In short applying the following rules will give the best results:
Make a separate repository for each project group.
Each project group consist of a group of projects that are tightly connected to each other, that should be administered together and that cannot be easily decoupled from each other.
A project group can contain a single project.
A project group that contains multiple projects should be examined to see if some of its projects can be decoupled from each other so it can be split into smaller project groups that are still contain projects that are tightly connected to each other, that should be administered together and that cannot be easily decoupled from each other.
The following guidelines explain this process for determining which projects to put in the same repository in more detail:
If a project is not closely connected to any other project (for example, the project can be opened without other projects being opened and no other projects relies on the project being opened when they are opened) then you should definitely place it in its own repository for the reasons explained in the answers above this one.
If a project is dependent upon other projects or other projects depend upon the project then it comes down to exactly how connected are they upon each other, how well they can be packaged together and how easily can they be decoupled from each other.
A) For example a testing project that contains junit test classes to test the classes of a main project is a case where the two projects are very connected with each other, can easily be packaged together and cannot be easily decoupled from each other. These projects should be placed in the same repository for the reasons explained in part C below.
B) In a case where one project relies on another project to provide some sort of shared resources it really comes down to how well that they can be administered together and how easily that they can be decoupled from each other. For example if the project with the shared resources is relied upon by many projects, then it should be put in its own repository because the other unrelated projects are impacted by changes to the shared source code project. In a case like this, the shared resources project should be decoupled from the dependent projects instead of being directly connected to the dependent projects. (For example, it would be better to create versioned archive files [Jar files with a name like "projectName".1.0.1.0.jar for example] and include a copy of those in each project instead of sharing the resources by linking the projects together.)
C) If the multiple projects are connected, can be easily administered together but cannot be easily decoupled from each other, then it depends upon how tightly connected they are with each other.
I) If the projects are put into one repository, then the projects will be kept in sync with each other in the repository each time there is a commit, which can be a real life saver if the projects are tightly connected. However, this also creates the issues noted in the answers above this one.
II) If the projects are put into separate repositories, then you will have to take care to keep there commits in sync with each other and be sure to include some sort of mechanism to indicate which commits belong to the same sync point across the projects (Perhaps something like including the same sync point number in the comments for the commit of each project when a group of commits is done across the projects.)
III) So in cases like this, it is almost always better to put these projects together into a single repository to reduce the overhead of human effort in syncing the commits and to avoid human error should the commits need to be backed out. The only time that it might be better to place them in separate repositories is when only one of the projects is being changed regularly and the other connected projects are rarely changed.
I think this question is related to one I answered here. basically Git by its nature supports a very fine granular structure when it comes to projects/repositories. I have read and been taught that 1 repository per project is almost always best practice. You lose almost nothing by keeping the projects separate and gain a lot as other have been describing.
Probably, it will be more performant to work with if You will create multiple git repositories.
If You will make a branch, only project's files would be branched, and not all the projects.
Small project it will be faster to analyze, to commit. Operations will take less of time.
The log will be more clear also, You could make more granulated configuration if You will have multiple git repositories.