Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Question about programming in team, and svn...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Vortez   Crossbones+   -  Reputation: 2704

Like
0Likes
Like

Posted 18 September 2013 - 03:01 PM

Hi, i've been programming for a long time, but i never actually worked on a project in parallel with someone else yet.

 

What id like to know is, how does merges work when using source version control? What if i really changed lots of thing in a certain file?

 

I know the question is pretty vague but im still learning to use SVN and was wondering how it worked.

 

thx.



Sponsor:

#2 markr   Crossbones+   -  Reputation: 1653

Like
2Likes
Like

Posted 18 September 2013 - 03:15 PM

In general, some level of collaboration is necessary to avoid doing the same thing.

 

If several people are working on the same file, normally they'll be doing unrelated things.

 

Whoever commits first, "wins" and the other person has to do a merge. Doing the merge is not normally particuarly difficult, but it can easily go wrong.

 

One of the biggest problems is if you have another developer who is a "tinkerer" and randomly changes stuff (e.g: comments, whitespace, random refactoring) not related to his tasks. This creates unnecessary merge work and gives other developers pain.

 

If you have such a developer on your project, and you are unable to convince him so stop such behaviour, your project manager should be involved.



#3 Muzzy A   Members   -  Reputation: 693

Like
1Likes
Like

Posted 18 September 2013 - 04:10 PM

There is usually an Interface which tells you what lines of code were changed in a file.  You have to see where they made their changes and merge it with yours into one copy, and usually you can see what that final copy looks like as well.  It's not hard, you just have to be careful when doing it because you can easily leave out someone else's code by accident and they'll have to either redo it, or revert back.



#4 Buster2000   Members   -  Reputation: 1778

Like
1Likes
Like

Posted 19 September 2013 - 01:39 AM

The thing to remmember is that you always update your code to what is in the reposity before committing.  If you update your code and it doesn't work then you can fix it before committing.  The key is that broken code should never be committed.  Even if you change hundreds of lines in hundreds of files and you have a dozen other people working on the same project (my situation this week), it shouldn't be a problem.

 

The biggest problem I find is when you have two or more teams working on feature branches that then need to be merged back into trunk.  This is when it can be a ball ache.



#5 LorenzoGatti   Crossbones+   -  Reputation: 2774

Like
0Likes
Like

Posted 19 September 2013 - 09:17 AM

The tinkerer problem can be approached with extremely strict code reformatting (e.g. no extra blank lines anywhere) before commits (Subversion offers "pre-commit hooks" that can run appropriate tools) and with deliberate campaigns of single-developer cleanup and refactoring before large multi-developer work. Both techniques limit merging to substantial code differences in the least possible number of source files.
Produci, consuma, crepa

#6 markr   Crossbones+   -  Reputation: 1653

Like
1Likes
Like

Posted 19 September 2013 - 01:55 PM

The tinkerer problem cannot be solved technically, it's something which has to be done culturally within the team.

 

Not only is "tinkering" highly annoying for other developers who have to tolerate merge conflicts, it's actively a problem because tinkering creates bugs.

 

Only when you have a culture of "if it ain't broke, don't fix it", can the tinkering be prevented.

 

I prefer the matra "Even if it is broke, still don't fix it until we have a bug report which has been triaged and scheduled into the release you're actually working on". Occasionally people fix bugs by accident though :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS