Subversion merge help

Status
Not open for further replies.
Within Subversion, I have a project that I frequently create different branches for off of the trunk. I usually work on one branch at a time, and when I'm happy with the results, I merge them back to trunk. The last time I did this, I had a bunch of 'tree conflicts' which I though I resolved property.

The problem is, after comparing a few files I modified within the working copies of both the specific branch I was working on and the trunk, I am noticing that some of my updates in these files within branch didn't get merged over to the trunk.

I have tried to merge the problem files individually. Subversion is reporting a successful merge for the files, yet the updates from branch still aren't located in trunk.

Anyone have any idea what the issue could be?
 
Thanks for the info. Do you know if there is a way to remove all merge history from subversion for particular files in your project?

I can continue making modifications to particular files in the same branch and have them show up in the trunk copies after a merge, it's just the last merged changes that aren't showing up

By the way, I primarily use SmartSVN client, so I'm attempting to see if I can mark a particular merge operation to be ignored
 
Blacken00100":1wdfjscv said:
Sounds like a svn:mergeinfo issue. At work we remove all mergeinfo properties and force full merge comparisons for precisely this reason (which is slow as shit but an unfortunate consequence of SVN's retarded merge system).

Sounds like what I need to do (at least once). What svn command(s) do you use to remove mergeinfo properties + force a full merge?
 
MilleniX":3olr9yn2 said:
It would be something like 'svn propdel svn:mergeinfo file1 file2 ...', but please look at the documentation, including the online Subversion book before going ahead with that. It's has been a long time since I've used Subversion, and I never really used its present-day merge support.

Phil

Thanks Phil. I'm looking into that. I would need to do it at a project directory level though, just to make sure I catch all files in my project
 

dredphul

Ars Tribunus Angusticlavius
6,344
Subscriptor++
You might find the following blog post useful: http://blogs.open.collab.net/svn/2008/0 ... -merg.html

When doing merges in subversion, it's a good idea to add the revision level in the comment block for the merge. This makes it slightly easier for the next merge as you can read the svn log to find the revision number to limit the start of the merge for the next get go.
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
Is merging really a problem with SVN?
Merge tracking was added quite awhile ago, and beta tested extensively before that. Even so, I wouldn't be surprised to hear they have bugs. It's a difficult feature to get right. Especially when grafting it onto an existing system after the fact.

Then again, my experience chasing merge bugs for TFS reminds me that 95% of such reports are user error :) (I won't call it RTFM because doing the right thing isn't something you can spell out step-by-step, any more than a C++ text can make someone a programmer. Inevitably, fixing up bad merges requires some knowledge of your SCM's implementation details, or a very detailed mental model of its branch/merge invariants & assumptions at minimum. Not something you'd find in your average manual.)
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
TheDan666":b71zizz7 said:
Are you not using a GUI tool like TortoiseSVN? I'm sure you can do all of this from the command line but I'm also sure its a much bigger pain in the ass.

--The Dan
IMO, dealing with the ugly bits of SVN is way easier on the command line. I love TortoiseSVN for quick stuff like commits/updates/reverts and log/repo browsing, but complex stuff (including merges) is just a pain in the ass.
 
TheDan666":3p7ll7df said:
Are you not using a GUI tool like TortoiseSVN? I'm sure you can do all of this from the command line but I'm also sure its a much bigger pain in the ass.

--The Dan

I have TortoiseSVN installed, but prefer SmartSVN client (which is like the only Java app I mind using on a daily basis out of my daily Java apps....I digress). I use a combination of SmartSVN + cmdline.

I'm sure I screwed up regarding resolving my initial tree conflicts, leading to this bad merge, but Subversion doesn't seem to make it easy to fix merge issues.

The Collabnet articles do a good job explaining the inner-workings of a merge. Thanks for the links.

dredphul, good tip regarding placing repo-level revision numbers in my commit messages. I'll be sure to do that in the future
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
yakumo":23nxv645 said:
merging for me in svn has always been a PITA and non-event. I rarely had a good merge from svn, when I used it, it got confused so easily (this was before whatever merge tracking they added).

robust merging is probably the best thing the DVCS's got right
This. It's amazing how easy merges in Git or Mercurial are. At work (where we use SVN, sadface dot jpg) I just do a manual diff from my branch and apply it to trunk - it's easier.
 

dredphul

Ars Tribunus Angusticlavius
6,344
Subscriptor++
sonicdeath":2rz6qyrv said:
Hmm this news is somewhat disheartening. I have been using SVN for some time now, but not on a large project and haven't had to do any big merges. Is merging really a problem with SVN?

Is git better? From what I hear git is very good at merges... is that true?

Subversion merging can be an issue but it really depends on the project. Are you working on a personal project, an open source project that releases every 3 months, a business project that has a weekly release cycle? Svn merging can take a bit of time to do and it can be acceptable if you're not facing an oncoming deadline.

Git appears to have good merging, but it's distributed nature can be a little difficult for people to understand. Also, Git has the ability to rewrite submissions and its lack of a permissions model may be an issue at some workplaces. Mercurial is supposed to be nicer to use than Git, but I haven't had time to study it. Joel Spolsky seems to like Mercurial: http://www.joelonsoftware.com/items/2010/03/17.html

At where I work, we moved from Subversion to Perforce (http://www.perforce.com) - a commercial scm product. Subversion merge capabilities can't scale at my workplace for the number of projects (20+) and a short development cycle.
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
dredphul":2mbyolu4 said:
sonicdeath":2mbyolu4 said:
Hmm this news is somewhat disheartening. I have been using SVN for some time now, but not on a large project and haven't had to do any big merges. Is merging really a problem with SVN?

Is git better? From what I hear git is very good at merges... is that true?
At where I work, we moved from Subversion to Perforce (http://www.perforce.com) - a commercial scm product. Subversion merge capabilities can't scale at my workplace for the number of projects (20+) and a short development cycle.
Sorry, but this part, at least, is untrue. We have 40 to 50 projects active and branched at any given time; the head copy of our tree checks in at 7.2GB (around 300,000 files). The average life cycle of our branched projects is around four to five days. SVN merging works at that scale and doesn't puke on itself.

Doesn't work well (and one guy spent a day or two writing up a couple scripts to make it work better), but neither would Perforce. It's why some of us are pushing for a transition to git (thank you, git-svn).
 
dredphul":2owcjdnt said:
sonicdeath":2owcjdnt said:
Hmm this news is somewhat disheartening. I have been using SVN for some time now, but not on a large project and haven't had to do any big merges. Is merging really a problem with SVN?

Is git better? From what I hear git is very good at merges... is that true?

Subversion merging can be an issue but it really depends on the project. Are you working on a personal project, an open source project that releases every 3 months, a business project that has a weekly release cycle? Svn merging can take a bit of time to do and it can be acceptable if you're not facing an oncoming deadline.

Git appears to have good merging, but it's distributed nature can be a little difficult for people to understand. Also, Git has the ability to rewrite submissions and its lack of a permissions model may be an issue at some workplaces. Mercurial is supposed to be nicer to use than Git, but I haven't had time to study it. Joel Spolsky seems to like Mercurial: http://www.joelonsoftware.com/items/2010/03/17.html

At where I work, we moved from Subversion to Perforce (http://www.perforce.com) - a commercial scm product. Subversion merge capabilities can't scale at my workplace for the number of projects (20+) and a short development cycle.

Well, at work, we use Subversion, so I don't have a choice there. At home though, I just setup my own personal Subversion server on my G4 Cube 'dev server' running OS X Tiger primarily for personal projects. It runs fine, and so far, my main projects on it (iOS app projects) don't require any merging (mainly because I just started them :) ) I just setup a Jira server instance on my G4 Cube as well, and it looks like there is some good integration with Jira + Subversion.

At work is where i'm doing more consistant merging, probably once a week on average.

By the way, I thought that simply supplying the 'ignore-ancestry' flag might do the trick, but it doesn't. In addition, I think I found the root-cause of my merge issues: In my last merge, I believe I was merging to a mixed-revision trunk.....should have ran an update :-(
 

MilleniX

Ars Tribunus Angusticlavius
8,140
Subscriptor++
dredphul":invjpgec said:
Git appears to have good merging, but it's distributed nature can be a little difficult for people to understand. Also, Git has the ability to rewrite submissions and its lack of a permissions model may be an issue at some workplaces.
Git's conceptual model has fewer moving pieces than Subversion's (a repository is a repository, no matter where it lives), but it combines them in potentially much more complicated ways. I've found these articles to be good conceptual introductions, at least for programmers using Git to track source code.

In terms of auditing, the ability to rewrite commits is no different from someone just keeping a bunch of changes in a working copy, and committing them later. It just means that developers can benefit from version control while they're keeping changes from everyone else, and that a policy of "no broken commits" is actually possible to meet retrospectively. Yes, it's a potential way to shoot yourself in the foot, but many powerful tools are. It offers benefits that aren't directly possible with a centralized tool.

Your claim that Git lacks a permissions model is spot on - it obeys whatever policy the owner of a repository wants to implement. If you want to control who can see or change various branches or paths, use a server like Gitolite or Gerrit that enforces those restrictions. As with most tools, access control is actually an orthogonal issue to the tool's purpose.

Phil
 

dredphul

Ars Tribunus Angusticlavius
6,344
Subscriptor++
Blacken00100":2urto5b3 said:
dredphul":2urto5b3 said:
At where I work, we moved from Subversion to Perforce (http://www.perforce.com) - a commercial scm product. Subversion merge capabilities can't scale at my workplace for the number of projects (20+) and a short development cycle.
Sorry, but this part, at least, is untrue. We have 40 to 50 projects active and branched at any given time; the head copy of our tree checks in at 7.2GB (around 300,000 files). The average life cycle of our branched projects is around four to five days. SVN merging works at that scale and doesn't puke on itself.

Doesn't work well (and one guy spent a day or two writing up a couple scripts to make it work better), but neither would Perforce. It's why some of us are pushing for a transition to git (thank you, git-svn).

After setting up Perforce branch mapping templates and label templates, a merge across all the projects takes me 3 minutes unless someone did something stupid.
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
SVN takes a little longer, but not much (unless you're doing something stupid). So you are conceding your blanket assertion that "Subversion merge capabilities can't scale" for that number of projects and that sort of dev cycle is a giant steaming load of horseshit?

Heck, I don't even like SVN but I don't try to say that sort of nonsense.
 

dredphul

Ars Tribunus Angusticlavius
6,344
Subscriptor++
Blacken00100":wcagr4kk said:
SVN takes a little longer, but not much (unless you're doing something stupid). So you are conceding your blanket assertion that "Subversion merge capabilities can't scale" for that number of projects and that sort of dev cycle is a giant steaming load of horseshit?

Heck, I don't even like SVN but I don't try to say that sort of nonsense.

Like I mentioned in my previous posts in this subject, it depends on your project. If Subversion works for you that's great. It didn't work well for the company I'm at.

Subversion (version 1.4.4) at my workplace didn't scale when the company moved from a 4 week cycle to a 1 week cycle. The merges took a day or more to resolve and this was with about 2/3 the number of projects we currently have.

With the templates, any developer with the Perforce GUI on Windows, Linux, or Mac OS X can do the merge of all the projects in about 3 to 10 minutes following a wiki page. Without the templates, one would have to go through each individual project and perform the merge activities and labeling, so roughly about an hour.
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
As with most tools, access control is actually an orthogonal issue to the tool's purpose.
A VCS is not "most tools." It's the tool you use to preserve your most critical IP. You can't seriously contend that access control is unrelated to its broader purpose.

Subversion (version 1.4.4) at my workplace didn't scale when the company moved from a 4 week cycle to a 1 week cycle. The merges took a day or more to resolve and this was with about 2/3 the number of projects we currently have.
SVN didn't add merge tracking until v1.5.
 

sonicdeath

Ars Tribunus Militum
1,962
Richard Berg":3qplp4x8 said:
As with most tools, access control is actually an orthogonal issue to the tool's purpose.
A VCS is not "most tools." It's the tool you use to preserve your most critical IP. You can't seriously contend that access control is unrelated to its broader purpose.

Access control is not an issue for open-source projects. But for closed-source projects it is. Access control is important but it depends on whether you are open or closed-source. And I'd be surprised if git wasn't used in closed-source environments... but I could be wrong.

Subversion (version 1.4.4) at my workplace didn't scale when the company moved from a 4 week cycle to a 1 week cycle. The merges took a day or more to resolve and this was with about 2/3 the number of projects we currently have.
SVN didn't add merge tracking until v1.5.

Yeah, Subversion 1.4.4 is over 3 years old.., so I'm not sure that is presently valid criticism.
 

Fink_Ployd

Ars Tribunus Militum
2,748
Richard Berg":30ft46fn said:
As with most tools, access control is actually an orthogonal issue to the tool's purpose.
A VCS is not "most tools." It's the tool you use to preserve your most critical IP. You can't seriously contend that access control is unrelated to its broader purpose.

Not unrelated, orthogonal. A git repository is just a bunch of files. If you want to have multiple people pushing to the same repository (and keep in mind there's good reasons not to if you don't have to), filesystem permissions will work just fine and you can push over ssh exactly like you ordinarily would. Or you can use fancier tools for code review.

Not integrating everything can be an advantage, and in this case it is. No need to reinvent the wheel.

Also, access control isn't a closed vs. open source thing...
 

sonicdeath

Ars Tribunus Militum
1,962
Fink_Ployd":1ui30g5c said:
Richard Berg":1ui30g5c said:
As with most tools, access control is actually an orthogonal issue to the tool's purpose.
A VCS is not "most tools." It's the tool you use to preserve your most critical IP. You can't seriously contend that access control is unrelated to its broader purpose.

Not unrelated, orthogonal. A git repository is just a bunch of files. If you want to have multiple people pushing to the same repository (and keep in mind there's good reasons not to if you don't have to), filesystem permissions will work just fine and you can push over ssh exactly like you ordinarily would. Or you can use fancier tools for code review.

Not integrating everything can be an advantage, and in this case it is. No need to reinvent the wheel.

Also, access control isn't a closed vs. open source thing...

Yeah you're right. I thought I had a point but not sure if it's even valid. Heh. Just more like being able to read/store (ie access) the code is less of an issue for open-source code than closed-source code, which could be less valid than I thought it was.
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
Not unrelated, orthogonal. A git repository is just a bunch of files.
No, it really isn't orthogonal.

Sure, every VCS is ultimately implemented via files (and processes, threads, handles, logon credentials, mutexes, pipes, GUI primitives, etc etc). And yes, your OS already manages access control for each of those things. But the purpose of a VCS is not to manipulate kernel objects willy-nilly; it's to encapsulate them into useful features.

You can't just declare git's access control mechanism is the filesystem. The filesystem knows nothing about git semantics. The best it can do is manage access to repository files with the same granularity as non-versioned files. In other words, you might be able to control who has permission to Write (a filesystem-level feature). But barring intimate knowledge of git internals, you can't control who has permission to Annotate or Soft Delete or Create SubBranches Of /foo/bar (VCS-level features).
Not integrating everything can be an advantage, and in this case it is. No need to reinvent the wheel.
What wheel? If filesystems already incorporated VCS-like features, we wouldn't need a VCS. But they don't, and we do.

Imagine someone came up to you and said...
I have this great new VCS! Branches are handled by the filesystem -- why reinvent the wheel? To create a branch, run "cp -R foo foo2." To fold your changes back into the mainline, run "rm -rf foo & mv foo2 foo."

The only logical conclusion: their VCS does not support branching at all.
 

ShuggyCoUk

Ars Legatus Legionis
10,387
Subscriptor++
Yeah, access control is only orthogonal if your granularity of access bears no relation to the fundamental operations on the VCS.

Even if your permission model it was a direct mapping to the OS's CRUD (add files to repo, read file,(any version) from repo, add revision to file, add revision indicating the removal of the file from this version) you have problems dempending on the underlying details.

An example here would be cross file deltas which are stored as such (i.e. they are stored in the repo as a separate 'thing' and linked to both both files). What if yo have differing levels of access (at the OS level) to those two files/directories?

Suddenly it gets a bit complicated as something assuming sub permissions within git would surely have issues here if you couldn't see the file the change came from. Is it possible with any git/mercurial permmission layer to have permissions finer grained than "the repo"?
 

MilleniX

Ars Tribunus Angusticlavius
8,140
Subscriptor++
Yes, it's possible, and I named two systems that do it in the post that started this argument. Gitolite lets administrators directly grant permission to read, fast-forward (push in a way that only builds on existing history), destructive update (push in a way that modifies or loses history), create branch, and delegate permissions on a per-branch basis. Gerrit, being more directed at code review, can control who gets to change what branches, but generally encourages a structure where most developers push to temporary branches for review, and those with approval authority can then choose whether the pushed changes get integrated to whatever real working branch they belong on.

Beyond that, there's nothing preventing a shop that wants to be paranoid about the code they consider "part of the product" from adopting the Linux kernel development model internally - no one but the project chief gets write access to "the" repository, they all just send pull requests up the chain.

Taking one step further, Git also allows hook scripts which can make any sort of checks one likes before accepting a branch update. If you have some weird policy that a computer could enforce, you can have the computer hosting your 'main' repository enforce it.

Phil
 

ShuggyCoUk

Ars Legatus Legionis
10,387
Subscriptor++
Yes, it's possible, and I named two systems that do it in the post that started this argument.

Right, so the limit is "some (possibly moving) cut through the repo" in that that's what branches/tags are.
No per file/dir permissioning.
(sorry the gitolite site is not returning any response at the moment or I'd be able to check these things myself)

Can you prevent someone reading anything but the entire repo/branch/tag in this world? (I'm not arguing that this is a good thing with git - but svn lets you restrict directories, which is pretty fundamentally linked to how svn, as a VCS operates)

But this doesn't affect either mine (or Richard's) point. You cannot delegate access control to something outside the VCS unless it understands the underlying VCS and plays by the limitations enforced.

In the case of gitole it's not orthogonal since you must entirely replace your api[1] with one that looks like, but isn't git. This doesn't strike me as being meaningfully orthogonal in the non mathematical sense I expect it to be used "mutually independent or well separated".

By that logic I could write a wrapper round any VCS executable that said "computer says no" and you'd call it orthogonal.

[1] s/api/whatever your happy calling it/ for /usr/bin/git - I have no intention of perpetrating a war on the *nix way of doing things
 

MilleniX

Ars Tribunus Angusticlavius
8,140
Subscriptor++
You can't do per-file or directory read control in Git, to the best of my knowledge, because its network protocol operates solely on commits. If you want to do that in Git, you would make a separate repository (which Git practices generally encourage for any pieces that aren't directly coupled), or use something that provides branch control and commit the confidential stuff on an access-controlled branch. This is what my lab does for some NDA variants of programs we develop. I don't know whether this is superior or inferior to explicit path-based control, but it seems to work well.

Your understanding of Gitolite seems to be flawed. It serves the same role in the Git repository hosting realm as Apache would in Subversion. The users work with whatever standard VCS client, and the server does some checks on who the client represents and what it's asked for before handing off to the underlying VCS code. For things that aren't in the servers, you can write hook scripts for either one that passes more detailed information about the operation requested. Has something changed in the Subversion world that embeds access control in the repository structure itself, or otherwise makes it any less orthogonal? I think both systems equally well satisfy the "well separated" notion - the thing providing access control (purely server-side in both cases) has to have some understanding of what it's controlling, but the thing being controlled blithely operates as it always would.

Clearly, I'm taking a more expansive view on 'orthogonal' than you are, and I'm willing to concede that my view may not be well founded. That particular bit of terminological disagreement doesn't have much bearing on how the systems compare in practice.

Phil
 

Richard Berg

Ars Legatus Legionis
43,037
Subscriptor
Your understanding of Gitolite seems to be flawed. It serves the same role in the Git repository hosting realm as Apache would in Subversion. The users work with whatever standard VCS client, and the server does some checks on who the client represents and what it's asked for before handing off to the underlying VCS code.
I admit I didn't research Gitolite before writing my last post. But from my POV, the architecture you're describing just reinforces my point. For all practical purposes, "the server" and "the VCS" are synonymous. The fact your VCS is actually a composite of Git + Gitolite is just an implementation detail. Clients don't know or care about the distinction, any more than they care about the individual modules / source files / database structure / whatever that make up Git proper.

This isn't a bad thing, mind you. It would be impossible to achieve Gitolite's featureset without tight coupling. But you can't be coupled like that and still call yourself "orthogonal." (Unless you're prepared to explain how Gitolite's access control works equally well with SVN, Perforce, and ClearCase backends!)
 

Fink_Ployd

Ars Tribunus Militum
2,748
What is your point? Are you just splitting hairs for the sake of it, or is there something you actually think Git lacks?

As far as I can tell, you're just complaining about not being able to do things the way you're used to doing them with other SCMs. You haven't actually come up with anything that Git is unable to do because it doesn't integrate permissions.

The main thing to keep in mind is that with DSCMs, you don't need to keep everything in one giant repository. Which you'll probably say you already know, but what that means is that you have different solutions available that may well be more appropriate anyways. So yes, I think it is perfectly justified to say that access control is orthogonal to git.

As far as the existence of tools like Gitolite, the original point was that there is no need to integrate access tools into git, a tool that stacks on top really doesn't invalidate that argument unless you're more interested in splitting hairs and masturbating than getting things done.
 

ShuggyCoUk

Ars Legatus Legionis
10,387
Subscriptor++
The main thing to keep in mind is that with DSCMs, you don't need to keep everything in one giant repository.

You can't do get atomic changeset commits across multiple repos except via submodules.

I'd argue that the benefits involved in going multi repo outweigh the cons, but plainly the choice of VCS strongly influences what is and isn't possible.

If something is designed well with permissions in mind from the get go that are viewed as important then the system will likely make soem trade offs in other areas to allow such things to work. One is not better than the other in the abstract, if you need the feature you accept the trade offs. Git had no need for the lvel of security we're talking about for it's intended need (nor do many people) but obviously layering it on top later you can't easily go back in and change those parts that you don't actually need that make adding the layer you want easier.

Obviously its the real world so people screw things up, and in several cases you can say with some serious weight that, for most peoples needs things are nearly universally better due to poor implementation of the alternatives.

Speaking from experience on this I would much rather *use* mercurial than svn at work. But policies work have regarding access control would have made using it (or any DVCS) and absolute nightmare. Whatever my feelings on the security policies they are important to my company so you work with the best possible tool in that situation that justifies the cost (in this case svn over VSTS).

Both I (and I think Richard) were taking issue with the rather blase statement that access control was orthogonal and git was "just a bunch of files". I fail to see how you can do any sort of access control beyond read or read|write everything in repo based on that assertion. In fact the tools then brought up very clearly rely on no longer treating git as a bunch of files.

Saying "you can do permissioning with X and Y" is just fine, and it is entirely possible this is sufficient for most people who need it and is in no way implying that that is worse than "you can do it with just Z" without further study based on the users needs.
 

Fink_Ployd

Ars Tribunus Militum
2,748
A real world example might help people see where you're coming from. Keep in mind not everyone has the same background and what might seem like an obvious problem to you might not to someone else for whatever reason....

Especially with things like SCMs where the whole point is to adapt your workflow. If you were complaining because you were used to using tarballs as your SCM, and git wasn't very useful to you with that workflow... well, people would rightly tell you that your problem isn't git.

I'm not saying it's anything that clearcut with permissions, but there are still a plethora of tools available to solve most problems with git so... give us something more to chew on.
 
at home I run gitosis that does read/write perms per user. at work we run cvs which only security is Active Directory based, whatever perms you have on the windows folders are what is applied, again read/write etc. micromanagement of permissions was something I never quite understood the point of.

for years we had a fully open cvs server where anyone could commit to any project... but nobody cared ;) thus the nature of boring work I think.
 
Status
Not open for further replies.