3 ms·
Why are branches in SVN error prone? We branch constantly and haven't had any serious problems.
by nradov 8y ago
Why are branches in SVN error prone? We branch constantly and haven't had any serious problems.
- jdblair 8y agoI think my memory of pain is during merging. We settled on a fairly simple, conventional system: mainline new dev, branches for each release, and occasional personal branches for experimentation. This meant we rarely merged other than fixes to sustaining branches.
- MereInterest 8y agoThe branching isn't the problem, but the merging is. My experience is that it depends on how closely the team is working together. If everybody is working on separate files, then SVN can merge together on a file-level. If people are working on the same files, then every such file requires manual merging. Since git works on a line-by-line basis, merging is much easier. It still requires a human to look through the resulting merge for logical consistency, but it gets a lot closer on the first try.
- nradov 8y agoWe have multiple people working on the same files and use Eclipse to do line-by-line merges automatically (except when there are actually conflicts). It works fine. So I still haven't seen any real evidence of error prone merges.
- yitchelle 8y agoIf someone can come up with an error free merging for all situations, it would be the "killer app" for configuration management. I would especially look forward to merging for XML files as well.
- cpeterso 8y agoDo any source control systems have filetype-aware merge algorithms? We can do something smarter when merging XML than textual line diffs.
- yitchelle 8y agoTotally agree. Could AI or machine learning be used for this type of application? I don't know much about machine learning, but I could imagine that it could be used to learn the programming habits of a development team and, perhaps, use it as a context for determining its merging strategies.
- makapuf 8y agoOr any language grammar, in fact.
- jpeloquin 8y agoGit can be told to use custom diff and merge drivers for particular file extensions via .gitattributes: https://git-scm.com/docs/gitattributes https://git-scm.com/docs/gitattributes For example, I have used .gitattributes to make git use MS Word to merge docx files, and LabView to merge .vi files. TortoiseGit (for Windows) includes diff/merge driver scripts for use with MS Word files.
- jharger 8y agoWhile not a source control system, the JetBrains IDEs have a very good merge tool that is filetype aware. For example, WebStorm/IntelliJ Ultimate, when merging JavaScript, often has a "magic wand" option that can detect when merge conflicts are actually resolvable if you parse both sides first, and merge the AST. It doesn't always work quite right, but it's good enough that I use it quite often.
- fowl2 8y agoPlastic SCM claims to have C#, Java, C and VB.net semantic diff. Looks pretty impressive - sad that it's proprietary! https://www.plasticscm.com/features/semantic-version-control.html https://www.plasticscm.com/features/semantic-version-control...
- 8y ago
- nradov 8y agoYou're never going to avoid all errors, but with additional tools SVN merging seems no more error prone than Git. I do agree that source code control needs to move beyond lines to deal directly with nodes in a tree structure. That could be XML, JSON, a C++ parsed abstract syntax tree, etc.
- lmitchell 8y agoSo I've actually thought about this a fair bit recently, since I'm making some changes to C++ code that touch a lot of files in reasonably straightforward ways. The changes should be possible to merge conflict-free in basically 100% of cases, but since so many lines are touched, no VCS merge tool can manage it. Most of my changes are just typenames, so I figured, you could do some sort of AST-based merge to allow those changes to merge with semantic changes to the surrounding code. But this has a lot of problems. Namely - most of the time, when two people change the same line, the changes really do conflict, and someone really does need to manually merge them. In fact, sometimes even when your VCS merges things happily, it still gets them wrong because two changes conflict semantically but don't touch the same lines. So I guess I would say, I think merging is an impossible problem to 'solve', and going to a more granular merge strategy is actually a move in the wrong direction. You could maybe fix my particular case by 'whitelisting' those typename changes, and saying 'these are allowed to merge with anything else', but at that point... the effort required to specify that unambiguously and make it work properly is probably higher than just merging the changes.
- ams6110 8y agoIIRC SVN merges only created conflicts if the same lines were changed. If I edited line 10 and another developer edited line 200 there was no problem. It's been a while, but I also never encountered any serious issues with branching and merging in SVN.
- cesarb 8y agoAs others have mentioned, the problem with branches in SVN isn't the branching, it's the merging. IIRC, this was because SVN didn't track merges, so if for instance you have a "stable fixes for release X" branch which is repeatedly merged into the trunk, you'd soon encounter wonky behavior.
- xorcist 8y agoSubversion absolutely tracks merges, but you don't really need that just to keep a stable branch regularly updated. That's a very normal and expected use of a branch and should not give you "wonky behavior" in neither git nor svn. Thousands of projects do it every day. Any encountered problems are likely not inherent to your version control system.
- craigds 8y agoIt definitely didn't use to track merges. That got added after most people jumped ship to git. Before that, you had to specify the common ancestor commit of the things you were merging, which you usually didnt know and had to dig around in slow logs to find out.
- xorcist 8y agoIt has tracked merges longer than github has existed, just to keep things in perspective. But, again, it's not required just to keep stable branches around since commit numbering is linear in svn. It's very convenient for anything less trivial than that though.