0

We use SVN for our version control and have a trunk for minor changes and a branch for more significant changes and also for the devs to be able to work off the same code base.

We regularly do trunk merges so our branch code-base stays up to date. When we work on a given bug / issue we do so generally on the branch and then commit all files related to that change.

We then merge that specific revision from the branch into the trunk and publish it.

This works most of the time, with occasional issues with merges. However, am I correct in thinking that eventually this is going to cause problems if we continue to use SVN's automatic merging?

My reasoning is that, for example, file A on branch is regularly tweaked, edited and committed by developer A and this may or may not be part of bug / issue commit, they might just be showcasing functionality.

Developer B gets the latest update of File A, makes changes related to a bug fix and commits. He then merges with the trunk using SVN's automatic merge functionality, no conflicts are reported.

Is it not possible for changes made by developer A to have ended up in the trunk because of the automatic merge? Using a HTML example, could an extra div be added because it didn't conflict with existing code but was 'new'?

  • yes that is what would happen. but dev B should have got the latest from the trunk if he didn't want the changes on the branch – Ewan Nov 8 '16 at 17:13
  • True, but in the case where the branch is used by both developers then this can happen. Is the only way around this to merge by hand? Seems painful. – Full Time Skeleton Nov 8 '16 at 17:15
  • omg no. the way around it is to get the correct 'latest' version from the correct branch. this applies to any source control system – Ewan Nov 8 '16 at 17:18
  • in fact, what are you doing merging a single file anyway?! – Ewan Nov 8 '16 at 17:19
  • Single file was just an example, this particular merge was about 30 files and two caused conflicts. When I checked I noticed extra code that was not part of the conflict but was also not supposed to be there. – Full Time Skeleton Nov 8 '16 at 17:21
3

Developer B should not get the feature branch when doing his bug fix.

The correct flow is to get the trunk version, apply the hotfix and merge it in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.