Version Control. DIFF Example. Version Control, continued. Lecture 12: Version Control & RCS. Things change

Similar documents
Review of Versioning. Configuration Management. Relation of Versioning to CM. Lecture 14: Configuration Management & Midterm Review

Difficult to keep track of different versions of a file if several people are making updates

RCS Tutorial. Dongsoo S. Kim

COSC345 Software Engineering. Version Control

Make. Dependency Graphs

Version control with RCS and CVS An introduction. Markus Bjartveit Krüger

Reuse in a Unix Environment. Creating a Library. Libraries. Lecture 10: Unix Libraries

Introduction to CVS. Sivan Toledo Tel-Aviv University

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Software Development. Hack, hack, hack, hack, hack. Sorta works. Main.c. COMP s1

Toolbox: Utilizing the Shared Cart Feature

Versioning. Terms. Configuration item (CI) Version Configuration Management aggregate Configuration Baseline

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

Department of Computer Science College of Engineering Boise State University

27-Sep CSCI 2132 Software Development Lab 4: Exploring bash and C Compilation. Faculty of Computer Science, Dalhousie University

Revision control. INF5750/ Lecture 2 (Part I)

Versioning. Jurriaan Hage homepage: Slides stolen from Eelco Dolstra.

CVS Application. William Jiang

CSCI 2132 Software Development. Lecture 5: File Permissions

Concurrent Versions System (cvs( cvs) Adviser Date August 31, 2004

Version Control Systems

Debugging (Part 1) The material for this lecture is drawn, in part, from The Practice of Programming (Kernighan & Pike) Chapter 5

TDDC88 Lab 4 Software Configuration Management

Source Control. Comp-206 : Introduction to Software Systems Lecture 21. Alexandre Denault Computer Science McGill University Fall 2006

Build. System building

Introduction to Supercomputing

Configuration. Monday, November 30, :28 AM. Configuration

Source Code Management wih git

Subversion FOUR. 4.1 What is Version Control? 4.2 What is Subversion? Types of Version Control SESSION

Con$nuous Integra$on Development Environment. Kovács Gábor

Microsoft Visual Source Safe (MVSS)

Git. CSCI 5828: Foundations of Software Engineering Lecture 02a 08/27/2015

Chapter 3. Revision Control

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

CS2720 Practical Software Development

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

9 and 11-Jan CSCI 4152/6509 Natural Language Processing Lab 1: FCS Computing Environment, SVN Tutorial. FCS Computing Environment, SVN Tutorial

Portions adapted from A Visual Guide to Version Control. Introduction to CVS

Good-Enough Design & Version Control. Kenneth M. Anderson University of Colorado, Boulder CSCI 5828 Lecture 11 02/16/2010

Moving Software Change Forwards, Backwards, and Sideways

Distributed Version Control

Barry Grant

Revision Control II. - svn

Source Code Management

Version Control Systems (Part 1)

A Gentle Introduction to CMSC311 labs and CVS Or How I learned to use CVS in CMSC311. William Arbaugh September 2, 2004

FEEG Applied Programming 3 - Version Control and Git II

CS 390 Software Engineering Lecture 3 Configuration Management

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

MNXB Working with SVN. Florido Paganelli Lund University Tutorial 2b

CSE 15L Winter Midterm :) Review

WinCvs Version 1.1. Users Guide. Don Harper

Decentralized Version Control Systems

2 Initialize a git repository on your machine, add a README file, commit and push

Version Control. Version Control

Today s Lecture. Types of Software Reuse. Software Reuse. Lecture 9: Software Re-Use

Computer Science Design I Version Control with Git

CS18000: Programming I

Outline. Configuration management. Main Phases MOTIVATION

CSC 2700: Scientific Computing

Crash Course in C++ R F L Evans. www-users.york.ac.uk/~rfle500/

[Software Development] Development Tools. Davide Balzarotti. Eurecom Sophia Antipolis, France

Programming in the large. Lecture 22: Configuration Management. Agenda for today. Bertrand Meyer. Bernd Schoeller

Version Control. So#ware Quality Quality Audit and Cer2fica2on. Master in Computer Engineering. Roberto García

Part I Part 1 Version Control Systems (VCSs)

Working with CVS in Eclipse

Praktische Aspekte der Informatik

Common Configuration Management Tasks: How to Do Them with Subversion

Human Version Control

Version Control. Version Control. Human Version Control. Version Control Systems

Part I Part 1 Version Control Systems (VCSs)

Computational Physics Compiling a C++ program

Jlint status of version 3.0

Version Control Systems: Overview

CSCI 4152/6509 Natural Language Processing. Lab 1: FCS Computing Environment

Revision Control. Software Engineering SS 2007

STATS Data Analysis using Python. Lecture 15: Advanced Command Line

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Using CVS Repositories with SAS

CSCI 2132 Software Development. Lecture 4: Files and Directories

Pattern Matching, set-up. Pattern Matching, example. Pattern Matching, set-up, cont. Lecture 9: Make Pattern Matching & Conceptual Integrity

Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring Topic Notes: C and Unix Overview

CVS Workshop. How to manage your projects, source code, and associated files using the Concurrent Versioning System

Source Code Revision Control Procedures

Practical C Programming

Systems Software. Recitation 1: Intro & Revision Control. Quite different from 213. Our Philosophy. Partly-free lunch

Using Subversion for Source Code Control

Debugging! The material for this lecture is drawn, in part, from! The Practice of Programming (Kernighan & Pike) Chapter 5!

Revision Control. An Introduction Using Git 1/15

History of the development of Lua

Intro Git Advices. Using Git. Matthieu Moy. Matthieu Moy Git 2016 < 1 / 11 >

Announcements. Reading. Today: 5.6 Tuesday: z Project proposal drafts due March 14,1997 z. CMSC S97 (lect 12)

COMP s1 Lecture 1

Lecture 2 Pre-processing Concurrent Versions System Archives

Outline. Introduction to Version Control Systems Origins of Git Git terminology & concepts Basic Git commands Branches in Git Git over the network

Version Control Systems

Excerpted from bash Cookbook. by Carl Albing, JP Vossen and Cameron Newham. ccopyright 2007 O Reilly Media, Inc.

CS631 - Advanced Programming in the UNIX Environment. UNIX development tools

Part I Part 1 Version Control Systems (VCSs)

Transcription:

Version Control Lecture 12: Version Control & RCS Kenneth M. Anderson Software Methods and Tools CSCI 3308 - Fall Semester, 2003 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 October 6, 2003 University of Colorado, 2003 2 Version Control, continued Versioning Keeping track of the changes to a file from one editing session to the next Computer Science has developed algorithms that can automatically detect the changes to a file especially text files One such algorithm is encapsulated in a Unix tool called diff DIFF Example world1.cc int main() { printf( hello world ); } world2.cc int main() { printf( Hello World! ); } % diff world1.cc world2.cc 2c2 < printf("hello world"); --- > printf("hello World!"); % diff world2.cc world1.cc 2c2 < printf("hello World!"); --- > printf("hello world"); October 6, 2003 University of Colorado, 2003 3 October 6, 2003 University of Colorado, 2003 4

More on DIFF Command Line diff file1 file2 Output show me how to change file1 into file2 Displays the ed commands needed to change file1 into file2 2c2 in the previous example meant change line 2 in file1 into line 2 of file2 See the diff and ed man pages for complete details Version Control Tracks all changes associated with a file Why? Rollback: Changes are not always an improvement. Often, you need to return to a prior version Experimentation: Lets software engineers explore what if scenarios Internationalization: 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 October 6, 2003 University of Colorado, 2003 5 October 6, 2003 University of Colorado, 2003 6 Tracking Changes Version Graphs 1 First draft of code, buggy All changes to a single file are tracked via a graph nodes are distinct versions 2.1 2 3 Fix some bugs, release version 1.0 Begin adding spellcheck feature edges denote that the target node was derived from the source node There are three possible configurations Extension: a single version derived from a single version Split: multiple versions derived from a single one Another bug fix, release as version 1.1 4 5 spellcheck feature complete, may have bugs changes merged, more bugs fixed, release as version 2.0 Merge: a single version derived from multiple versions; merge typically done by hand October 6, 2003 University of Colorado, 2003 7 October 6, 2003 University of Colorado, 2003 8

Version Control Files Version graphs are stored in version control files Space saving techniques are 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 Version Control Systems Version Control Systems let you check versions out of a version control file If I ask for version 2.2, and we are using a forward delta system then it starts with the original file and applies all of the deltas that lead to version 2.2 in the version graph October 6, 2003 University of Colorado, 2003 9 October 6, 2003 University of Colorado, 2003 10 RCS: Revision Control System The version control system for our class is RCS. RCS is a backward delta system It stores the complete text for the most recent version of the file And derives old versions by applying deltas to the recent version Check-In and Check-Out Commonly used RCS commands ci - check in Used to check changes into a version control file; can also create an initial version control file co - check out Used to check out a specific version of a file October 6, 2003 University of Colorado, 2003 11 October 6, 2003 University of Colorado, 2003 12

RCS Locks RCS has a notion of locks If you check out a file, with a lock, no other person can check out that file for editing (they can still read it, however) This prevents multiple people from changing the same file at once This is a different strategy than one used by another popular version control system, CVS CVS allows a file to be edited by multiple people, but then potentially requires a merge step when checking a file into the repository RCS Version Control File The version control file for RCS has a suffix,v You can think of this file as a tar file A single file with multiple files stored within This time the contained files are just different versions of the same file And all but one are stored as deltas October 6, 2003 University of Colorado, 2003 13 October 6, 2003 University of Colorado, 2003 14 RCS Example RCS Example, continued Start with a file rw- CommentBook %ci CommentBook initial revision: 1.1 To Retrieve original file %co CommentBook r-- CommentBook Note: the version control file is created in the same directory as the original file UNLESS there is a directory called RCS If RCS exists, the version control file is created in the RCS directory The checked out file is called the working file You can always retrieve a working file from the version control file r-- CommentBook %rm CommentBook %co CommentBook r-- CommentBook October 6, 2003 University of Colorado, 2003 15 October 6, 2003 University of Colorado, 2003 16

RCS Example, continued A normal co command produces a read-only working file; to get a writeable version, you must lock the working file %co -l CommentBook rw- CommentBook After you have made changes, you can check them in to make a new version %ci CommentBook new revision: 1.2 Flags for CO -r# - Retreive revision number # -l - Retrieve a locked working file -u - Retrieve an unlocked working file -p - Print contents of file to stdout, do not retrieve a working file -f - force overwrite of working file -q - Quite mode; diagnostics not printed -I - Interactive Mode See man page for more info October 6, 2003 University of Colorado, 2003 17 October 6, 2003 University of Colorado, 2003 18 Flags for CI -r# - Save as revision number # -l - Save and retrieve a new locked working file -u - Save and retrieve an unlocked working file -i - Initial check in, report error if a,v file already exists -f - Force creation of new version -q - Quite mode -I - Interactive Mode See man page for more info RCS Keywords RCS will look for certain keywords in a file and will substitute values for them during check-in and checkout Think of these keywords as Make Macros, where RCS provides the definition for the Macro Keywords are delimited with two dollar signs Example:if $Author$ appears in a text file stored in RCS then when checked out, RCS replaces the above string with: $Author: kena $ or more generically with $Author: <username> $ October 6, 2003 University of Colorado, 2003 19 October 6, 2003 University of Colorado, 2003 20

Example Keywords RCS Version Numbering $Author$ - name of user who performed ci $Date$ - The date and time of a ci $Locker$ - name of the user who locked a revision $Log$ - log message supplied during ci 1.1 1.2 1.1.1.1 1.1.2.1 An RCS version number has a branch number and a version number. The version number is always last $Revision$ - revision number assigned during ci $Name$ - The name of a revision (if named) $RCSfile$ - The name of the RCS file without path info 1.3 1.1.1.2 1.1.2.2 1.1.2.1.1.1 1.1.2.1.2.1 $Source$ - The full pathname of the RCS file $Header$ - See co man page for details $Id$ - See co man page for details 1.4 1.1.1.3 1.1.2.3 1.1.2.1.1.2 1.1.2.1.2.2 October 6, 2003 University of Colorado, 2003 21 October 6, 2003 University of Colorado, 2003 22 Other RCS Tools rcs - an admin tool; can perform tasks such as breaking locks, change log messages, erase versions, etc. See man page for details. rlog - display log messages for a particular file (each time you check in a file, you are asked to enter a log message describing the changes) rcsdiff - a diff command for rcs versions e.g. rcsdiff -r1.1 -r1.2 CommentBook will show the differences between the specified versions without checking those versions out October 6, 2003 University of Colorado, 2003 23