Presentation is loading. Please wait.

Presentation is loading. Please wait.

P51UST: Unix and SoftwareTools Unix and Software Tools (P51UST) Version Control Systems Ruibin Bai (Room AB326) Division of Computer Science The University.

Similar presentations


Presentation on theme: "P51UST: Unix and SoftwareTools Unix and Software Tools (P51UST) Version Control Systems Ruibin Bai (Room AB326) Division of Computer Science The University."— Presentation transcript:

1 P51UST: Unix and SoftwareTools Unix and Software Tools (P51UST) Version Control Systems Ruibin Bai (Room AB326) Division of Computer Science The University of Nottingham Ningbo, China 1

2 Introduction Version control systems –Principles –Problems they face Copy-Modify-Merge cycle Locking and Version Tracking –How they avoid conflicts –Benefits of each technique 2 P51UST: Unix and SoftwareTools

3 Version Control Things change … –New requirements lead to… –new or changed designs that lead to… –new or changed source code, etc. –Or bugs are discovered and must be fixed –… software engineers need to keep track of all these changes 3 P51UST: Unix and SoftwareTools

4 Version Control Systems Support The quality of maintainability and visibility and the principle of incrementality Synchronisation –Manages the changes made by different programmers so they don’t need to continually email code between each other Rollback –Changes are not always an improvement. Often you need to return to a prior version 4 P51UST: Unix and SoftwareTools

5 Version Control Systems Support (2) Experimentation –Lots software engineers explore “what if” scenarios Internationalisation –Different versions for different languages Historical Record –A customer reports a bug on version 1.1 but you are at version 2.3. You need a way to recreate version 1.1 to check out the bug 5 P51UST: Unix and SoftwareTools

6 Tracking Changes First draft of code, buggy Fix some bugs, release version 1.0 Begin adding spellcheck feature Spellcheck feature complete, may have bugs Changes merged, more bugs fixed, release as version 2.0 1 2 3 4 5 2.1 Another bug fix, release as version 1.1 6 P51UST: Unix and SoftwareTools

7 Version Graphs All changes to a single file are tracked via a graph –Nodes are distinct versions –Edges denote that the target node was derived from the source node 7 P51UST: Unix and SoftwareTools

8 Version Graphs (2) There are three possible configurations: –Extension A single version derived from a single version –Split Multiple versions derived from a single version –Merge A single version derived from multiple versions; most systems have support for this but major differences have to be resolved by hand 8 P51UST: Unix and SoftwareTools

9 Version Control Files Graphs are stored (centrally) in version control files Space saving techniques may be used: –Forward deltas The original version is stored, all subsequent versions are stored as sets of changes or “deltas” –Backward deltas The most recent version is stored, all previous versions are stored as sets of changes 9 P51UST: Unix and SoftwareTools

10 What does a Version Control System do? A Version Control System lets you “check out” versions of a version control file –E.g. if I ask for version 2.2, and we are using a forward delta system, it starts with the original file and applies all of the deltas that lead to version 2.2 in the version graph 10 P51UST: Unix and SoftwareTools

11 Checking Out Alice and Charlie have checked out all files Bob has just checked out File 2 11 P51UST: Unix and SoftwareTools

12 Copy-Modify-Merge 1.A developer copies the version of the system in which they are interested into their own filespace 2.They then make any changes they want to the system 3.This is then merged back into the central version (which may have been modified by other developers in the meantime) 12 P51UST: Unix and SoftwareTools

13 Copy-Modify-Merge (Alice Modifies a File) 13 P51UST: Unix and SoftwareTools

14 Alice Modifies a File followed by Bob 14 P51UST: Unix and SoftwareTools

15 Alice, Bob, Alice 15 P51UST: Unix and SoftwareTools

16 Conflicts Suppose Alice and Bob both copy the same file, make some changes and then try to merge them? What happens? 16 P51UST: Unix and SoftwareTools

17 A Conflict 17 P51UST: Unix and SoftwareTools

18 Locking or Version Tracking Version Control Systems vary in how they cope with conflicts –Some systems implement locking so it is impossible for two people to both have a file checked out at the same time –Other systems may keep track of the versions of a file each user has and require them to update their version before they can merge it 18 P51UST: Unix and SoftwareTools

19 File Locking in Action 19 P51UST: Unix and SoftwareTools

20 Version Tracking in Action 20 P51UST: Unix and SoftwareTools

21 Conflict Resolution Many version control systems support conflict resolution, making guesses about an appropriate way to merge the two versions of the file In the end, though, they will give up and leave it to the user to do this by hand 21 P51UST: Unix and SoftwareTools

22 Locking Vs. Version Tracking Locking –prevents complicated conflict resolution problems arising –also prevents duplication of effort (two programmers both doing the same thing at the same time) 22 P51UST: Unix and SoftwareTools

23 Locking Vs. Version Tracking (2) Version tracking –prevents one person’s work being held up because someone else is using the file they want - or worse still, has forgotten to check the file back in –allows two developers to work on different sections of the same file at once 23 P51UST: Unix and SoftwareTools

24 Summary Version Control Systems are a way of tracking and recording changes to a software project They help teams of people coordinate their work 24 P51UST: Unix and SoftwareTools


Download ppt "P51UST: Unix and SoftwareTools Unix and Software Tools (P51UST) Version Control Systems Ruibin Bai (Room AB326) Division of Computer Science The University."

Similar presentations


Ads by Google