After I did the git svn clone –stdlayout …, everything looks good and I have converted remote branches. But when git log –graph, I don’t see any branch merging graph. Is it normal?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since version 1.5.0 released in summer of 2008 Subversion does support merge-tracking. Subversion keeps information on performed merges as svn:mergeinfo property set on merge target, be it a branch directory, like ^/trunk/, or any other directory.
There are major differences between merge-tracking mechanisms in Git and Subversion:
The whole branch merge.
When you’re on master branch, the command
results in a merge commit with its first parent set to the commit referenced by master and the second parent set to the commit referenced by some-branch (I don’t take into account fast-forward and conflicted merges here).
For git it means that created merge commit includes the whole history of both master and some-branch.
When you’ve checked out ^/trunk/ branch into svn working copy and then run
Subversion will set svn:mergeinfo property on trunk-working-copy directory as follows:
The range 10-20,30-40,50-60 includes those revisions which are not yet merged into ^/trunk/ branch from ^/branches/some-branch/ (Subversion detects them automatically).
Mergeinfo property just specifies those revisions which were once merged into the branch. And it’s up to user to check whether all these merged revisions include the whole history of the branch.
Cherry-pick merge.
When you need to merge changes from a single commit into your master branch, you run
After that git creates a commit with corresponding changes and a single parent set to the commit previously referenced by master branch.
That is, git doesn’t create any kind of merge commit for cherry-pick. So, git has no means to track cherry-picked commits via its graph structure.
Opposite to that Subversion does track cherry-pick merges by adjusting svn:mergeinfo property with respect to cherry-picked revision:
This command is quite straight-forward, it adjusts svn:mergeinfo as follows:
That means Subversion tracks cherry-pick merges.
So, you don’t get merge commits after the translation. To my best knowledge git-svn has certain problems when it comes to merge history.
But as subgit developer I have to say that subgit should correctly handle the merge-tracking info. Most probably svn:mergeinfo property set on your branches doesn’t include the whole history of the branches merged to them. Here’s how that could happen:
To fix that you have to find the skipped part of merge-tracking information and add it into your branches:
Try to find which revision are not yet merged:
The output must include all the revision you haven’t yet merged from ^/branches/some-branch/ to ^/trunk/.
Try to merge not yet merged revisions by svn.
As a nice bonus you may refer to SubGit specification related to the merge-tracking stuff, it has some pretty diagrams for all I’ve said above.