My company is using Kiln so developers can use their preferred tool between Git and Mercurial. I’m a Git user and never used Mercurial.
There are some incomprehensions in the use of branches with Kiln. When I create a new branch using the Kiln interface, it, in reality, creates a new repository, not a branch. Even if Kiln displays it as a "branch" and not a "repository". And when I clone the repository in Git, git branch -a
does not show me the remote branch I just created. I need to clone every pseudo-branch independently.
On the other side, if I create a branch in Git and push it to the remote, it does not create a branch on Kiln but some kind of "sub-branch" called a "head" visible in all branches. Very confusing. But there is apparently no way to create these "sub-branch" that work perfectly with Git via the Kiln interface. I also don't know if they work well on Mercurial.
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/feature2
remotes/origin/master
I’m convinced this is related to the pro-Mercurial "philosophy" of Kiln. I made some researches on Mercurial and find out that the branch system is completely different from Git. It is normal to clone the repository to create a branch while in Git it is non-sense. Mercurial has also "named branches" which cannot be deleted and their use is discouraged by the Kiln developers. Can my "sub-branches" be actually "named branches"? The problem is that I can delete those "sub-branches" using git push origin :sub-branch
.
The answer must be obvious since branching is an important features of both Mercurial and Git and Kiln must have done a simple and elegant way of doing branch working using both tools. But I’m unable to figure out the logic of Kiln. I’m afraid Kiln may be too Mercurial-friendly and that the Git support may be more like a hack.
On the Kiln UI, when you create a branch, it is a "clone branch", not a Mercurial named branch.
If you use named branches in Mercurial, they will be automatically translated to Git branches. However, when you commit to the Git branch it will not convert back to the same named branch in Mercurial. The Kiln Team had to figure out the best analogue for the Git-to-Mercurial translation of Git branches, and they decided that a Mercurial 'bookmark' works the best. So when you push to a Git branch it will update or create a corresponding Mercurial bookmark (https://www.mercurial-scm.org/Bookmarks, http://mercurial.aragost.com/kick-start/en/bookmarks/) with the same Git branch name, and that bookmark will be on the 'default' branch in Mercurial. I'd check with the members of your team that use Mercurial to see if using bookmarks as an analogue to Git branches would work for them.
Another option would be to try and see if your team likes the Kiln UI's "clone branch" to maintain separate lines of development versus using the named branch approach.