#248: Enhance GetComponents functionality when dealing with git branches ----------------------------+----------------------------------------------- Reporter: bmundim | Owner: eric9 Type: enhancement | Status: accepted Priority: minor | Milestone: Component: GetComponents | Version: Resolution: | Keywords: git branches ----------------------------+-----------------------------------------------
Comment (by hinder):
Do you mean that local branches should be created for all remote branches? There is a --mirror option to git clone which does this, but it only works for bare repositories. I seem to remember some advice which said that cloning all remote branches by default, while it sounds like a good idea, is in practice more trouble than it is worth, because you have to keep them all up-to-date. I'm not sure of the details, but maybe google a bit to read up on it.
I think users of GetComponents would expect git repositories to behave as "standardly" as possible, so it might not be a good idea to do too much "extra" work. Cloning the repository pulls in all data, and we can select the default branch to check out in the CRL file. If a user wants to check out another branch, they can use the appropriate git command to do that.
The way that I usually work with multiple branches is to have a different arrangement for each branch. I would have two separate repositories, each with one of the branches checked out, and the symbolic links in the arrangements directory would point to the appropriate thorns. So for example, for the Kranc Examples arrangement, I have
KrancExamples -> ../repos/Kranc/Examples KrancExamplesVector -> ../repos/KrancVector/Examples
I don't have this configured in my thornlist, I do it by hand. But I think it would be possible to have this work in a thornlist if you could specify the arrangement name and the branch to check out, and just have two entries for the arrangement.