svn and merging

Upload: bob-chatman

Post on 30-May-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 SVN and Merging

    1/15

    SVN AND MERGING

    An instructional document onhow to code on with a team

  • 8/14/2019 SVN and Merging

    2/15

    Our GoalTo answer the basic questions that ring upregarding team development systems.

    Why are there problems?SVN / CVS

    What can I do to help avoid these problems?FoldersTeam Merging (Nominees)Project Management

    What can I use to help avoid these problems?WinMerge http://winmerge.sourceforge.net/Tortoise SVN http://tortoisesvn.tigris.org/Tortoise CVS http://www.tortoisecvs.org/

  • 8/14/2019 SVN and Merging

    3/15

    Defining the problemFirst things first, Lets look at avery simple example.

    A single user is able to verysimply edit information in a givenfolder with no problems. If theyare trying to modify a file theyopen it and they edit the file,saving when finished.

    A very straight forward method of editing information in directories.You may have alreadyexperienced in this because of your usage of computers up tothis point. You have edited yourown files many times. Lets startlooking into how things changewith another person added to thesystem

    Bob

    File Modified

    Bob Wins!

  • 8/14/2019 SVN and Merging

    4/15

    Defining the problem

    So things havechanged. Bob is nowworking with a

    number of people, andhe has a few things toworry about, such asthe obvious problem

    Who gets to touch thefiles?

    Bob Pat Mike

    Directory Structure

  • 8/14/2019 SVN and Merging

    5/15

    Defining the problemIf any two people open up a file at the sametime, they may run the chance of over writing thechanges that the other person may be making.

    Bob

    Pat

    Mike

    File Modified Bob FTW

  • 8/14/2019 SVN and Merging

    6/15

    Why is this a problem

    Because Everyone needs to have the ability tocode, or they are wasting their abilities.Productivity & Time are lost if there is no systemused to monitor and oversee this process

    Possible SolutionsCommunicationMerge NominationManagementLocking or Read OnlySVN / CVS Systems

  • 8/14/2019 SVN and Merging

    7/15

    CommunicationLets go back to our previous system and set up a system of communication in which the users are using AIM or MSN tocommunicate their current steps, for instance

    Bob would tell Pat that he is editing somefile.cpp ,

    and that Pat shouldnt touch it.

    Pat

    File Modified Bob FTWBob

    The problem is still here. Pat is morallybound to listen to what Bob says, Whichworks very well for Bob, but if Pat forgetsthat Bob is editing the file than Bobschanges are lost to cyberspace.

    This shouldnt come down to moral ordecisions. It should be simple and easy tofollow.

    This system is limited, in that you shouldhave the entire team notified, and whenyou have a large team you may end upwith a large email listing of people whomay not check their emails as often as theyshould.

  • 8/14/2019 SVN and Merging

    8/15

    Merge NominationOne system that I have run into a number of times, andworks on the broad scale, is to nominate a person to havethe ability to merge their code and only allow that personto merge their code, while the rest of the team does nothave the ability to update the files.

    Pat

    Files Modified

    Pat FTW

    Bob Bob FTW

    This system is legitimate, in that it allowsmodification of files as the users see fit. The onlyproblem is that there is a very big problem withspeed and efficiency. In order to pull this system off there is a cycle that has to be kept running in orderto assure that the process does not lose time.

    The problem is that the conch does not get passedas often or quickly as it should be, and the coders allhave to have an understanding of what the otherusers are doing and they have to have the ability to

    jump into the code that you have been given and beable to pick and choose what you need to ask. This iseasiest using applications that monitor merging.

    This system is not limited by the number of users,but it becomes very slow and tedious when thegroups get larger than 10 people.

  • 8/14/2019 SVN and Merging

    9/15

    ManagementBoth of these options require the users to be overseen for best results.

    This instills some very inappropriate things in the users. No one likesbeing watched every step of the way. Programmers are a notorious bunchof people who rebel against oversight. Many people have written abouthow terrible management can be, and although you may not have

    read them, you shouldnt have to think sohard in order to come up with a fewcomplaints of your own.

  • 8/14/2019 SVN and Merging

    10/15

    Locking or Read OnlyBoth of these options are equivalent to thecommunication option, in that a single user has theability to edit a file. The only change is that instead of telling Pat I dont want him to touch a certain file, I lockor make it read only. This way pat at least has the abilityto read the file.

    Pat

    File Modified Bob FTWBob

    The same problems persist. Pat is stillvery dependant upon my progress andlikewise so am I on his.

    This impedes my progress while he isworking, and shows us that we arewasting time in this method of versioning our code.

  • 8/14/2019 SVN and Merging

    11/15

    What are some otheroptions?

    Having multiple folders?Working on a default code base, keepingtrack of all of our changes (differentiating)SubversionConcurrent Version System

    Give up, get drunk, die?

  • 8/14/2019 SVN and Merging

    12/15

    SVN v. CVSA debate could go on for hours comparing these two items, theyare equal and both capable of becoming useful under similarsituations. I would recommend SVN because I have found thatpeople have an easier time learning it. One thing to keep in mind isthat these methods do not take any of the management process

    out of your hands, they just keep track of files

    Here are their respective sites

    http://ximbiot.com/cvs/

    http://subversion.tigris.org/

    The only problem is that you have very little ability to modify orupdate the versioning system without a tool

    Enter tortoise .

    http://ximbiot.com/cvs/http://subversion.tigris.org/http://subversion.tigris.org/http://ximbiot.com/cvs/
  • 8/14/2019 SVN and Merging

    13/15

    Our Method of ManagementOver the last few years I have been learning more and more about takingcare of code in a team environment. I have come to a conclusion thatmerges much of the ideas that we have already pointed out.

    Our method is simple, but comes with a check list.

  • 8/14/2019 SVN and Merging

    14/15

    Our Method Of ManagementSince we are already using SVN, I will focus on this method of system management, along with the idea of using multiplefolders, and merging.

    Bob Pat Mike

    Directory Structure

    Lets look at the example in which three people are working onthe same code base. The problem was that we would be

    overwriting or blocking the process of change on anotherpersons part.

    Lets answer the problem step by step.

    Blocking This taken care of by the entrance of multiplefolders. The process is very straight forward; you never lock,set read only, or have to worry that anyone is working on a filebecause you only have your own code.

    Overwriting This is controlled by the process known asmerging. I recommend that you use an application, such aswinmerge, in order to run a differential on the files that youhave been modified against the files that you have in thesecond directory. This is also dependant upon the multiplefolder system that we highlighted earlier.

  • 8/14/2019 SVN and Merging

    15/15

    Our Method Of ManagementThis system that we are using requires a bit of disc space and doesnt taketoo kindly to anyone who cant tell the difference between debug and betabuilds, but in the end it causes little or no frustration.

    The requirements of this system to stay simple and sane are as follows:

    Do not upload anything to the SVN without confirming

    it works with the current code that is on the SVN. This is done by downloading the current version and merging your

    code into it. works means that you have merged, and confirmed that your

    code functions properly, allowing no unforeseen issues (A/B Bugs) Make sure you download the latest version of the code off of the SVN. Make sure your code works as you planned it to work. Do not overwrite, delete, or in any other way modify another persons

    code for any reason without notification to that person, and properly tothe team.

    Always fill out the log in the SVN updating utility, listing what your codedoes and what it affords the application (in other words, explain thepurpose of your update).