Version Control. 1 Version Control Systems. Ken Bloom. Linux User Group of Davis March 1, 2005

Similar documents
Home Page. Title Page. Contents. Page 1 of 17. Version Control. Go Back. Ken Bloom. Full Screen. Linux User Group of Davis March 1, Close.

Managing Source Code With Subversion

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

Department of Computer Science College of Engineering Boise State University

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

Revision Control II. - svn

Chapter 3. Revision Control

Introduction to Version Control

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

Common Configuration Management Tasks: How to Do Them with Subversion

Decentralized Version Control Systems

TDDC88 Lab 4 Software Configuration Management

Subversion. An open source version control system. W. Miah escience Rutherford Appleton Laboratory

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

Introduction to Revision Control

Source Code Management

February 2 nd Jean Parpaillon

Revision control systems (RCS) and. Subversion

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

Part I Part 1 Version Control Systems (VCSs)

Subversion. CS 490MT/5555, Fall 2015, Yongjie Zheng

Using CVS to Manage Source RTL

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21

Tutorial: Getting Started with Git. Introduction to version control Benefits of using Git Basic commands Workflow

Part I Part 1 Version Control Systems (VCSs)

Version Control Systems

Part I Part 1 Version Control Systems (VCSs)

Version Control Systems

Version Control Systems

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

Version Control. Kyungbaek Kim. Chonnam National University School of Electronics and Computer Engineering. Original slides from James Brucker

Source control with Subversion A user perspective

Subversion Repository Layout

Introduction to version control. David Rey DREAM

Next Generation Software Configuration Management with Subversion

Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Software Tools Subversion

Version Control: Gitting Started

Version Control for Fun and Profit

Introduction to Version Control

VSO. Configuration Management

Git. all meaningful operations can be expressed in terms of the rebase command. -Linus Torvalds, 2015

Using RANCID. Contents. 1 Introduction Goals Notes Install rancid Add alias Configure rancid...

Distributed Software Development using Subversion and SubMaster

You Can t Move Forward Unless You Can Roll Back. By: Michael Black

Warmup. A programmer s wife tells him, Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.

Introduction to CVS. Sivan Toledo Tel-Aviv University

What is Subversion and what does it do?

Using Subversion with LeMANS and MONACO

Computer Science 62 Lab 8

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

Programming with Haiku

And check out a copy of your group's source tree, where N is your one-digit group number and user is your rss username

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

Yinghui Wang

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

git the SCM system Jan-Simon Möller training.linuxfoundation.org

A Practical Introduction to Version Control Systems

Revision control. INF5750/ Lecture 2 (Part I)

python-anyvcs Documentation

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

2/8/18. Overview. Project Management. The First Law. What is Project Management? What Are These Changes? Software Configuration Management (SCM)

Version Control. CSC207 Fall 2014

LAB 0: LINUX COMMAND LINE AND SVN

Project Management. Overview

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

FCM and the UM Reading 9th November 2012

GUIDE TO MAKE A REAL CONTRIBUTION TO AN OPEN SOURCE PROJECT 1. 1

Software configuration management

Code development using Subversion

CVS How-to. 17th July 2003

Apache Subversion Tutorial

CS480. Compilers Eclipse, SVN, Makefile examples

Task-Oriented Solutions to Over 175 Common Problems. Covers. Eclipse 3.0. Eclipse CookbookTM. Steve Holzner

Source Code Management wih git

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

Version Control Systems (VCS)

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Submitting your Work using GIT

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

SOFTWARE CONFIGURATION MANAGEMENT

Lecture 01 - Working with Linux Servers and Git

Workshop: High-performance computing for economists

Software Development I

Version Control Systems (Part 1)

Manage quality processes with Bugzilla

Version Control with Git

Managing a WordPress 2.6 installation with Subversion. Sam Bauers - Automattic

Git. A Distributed Version Control System. Carlos García Campos

Revision Control and GIT

About CVS. 1 Version Control - what is it? why is it useful?

Using Subversion for Source Code Control

CSE 390 Lecture 9. Version control and Subversion (svn)

Assumptions. GIT Commands. OS Commands

Ingegneria del Software Corso di Laurea in Informatica per il Management (D)VCS. Davide Rossi Dipartimento di Informatica Università di Bologna

CS2720 Practical Software Development

CVS Application. William Jiang

Push up your code next generation version control with (E)Git

Version Control Systems

Transcription:

Version Control Ken Bloom Linux User Group of Davis March 1, 2005 You ve probably heard of version control systems like CVS being used to develop software. Real briefly, a version control system is generally thought of as a centralized repository where developers put source code. They check out code from the project, work on it in a working directory on their own machine, and then commit the changes back to the repository when they are done. The oldest systems allowed only one user to edit a file at a time if they checked it out to make changes, it was locked and nobody else could check it out to make changes. Now, concurrent editing is a standard feature. 1 Version Control Systems CVS BitKeeper Arch Subversion SVK The first 3 should really be called Source Code Management Systems because their file system structures are pretty rigid, suited mostly for source code. The last two have a more flexible filesystem structure so they may more generally be called Version Control Systems. 1

2 CVS 2.1 History started in 1986 as a bunch of shell scripts for RCS algorithms remain as a basis for the C program 2.2 Features Concurrent editing Directory tree storage Source code stored in a centralized repository Branches and tags Plain text repository format 2.3 Disadvantages Bad support for binaries or symlinks. Can t move, copy, or delete files in the repository No atomic commits. 3 BitKeeper 3.1 Features Distributed source code management. Concept of changesets that is bigger than commits. Some GUI features built in. 3.2 Disadvantages Not free as in speech. Free as in beer to anyone willing to use Open Logging. Linus uses this for kernel development. 2

4 Arch 4.1 Features Changesets Distributed source code management. No particular preference for a given filesystem or protocol. 4.2 Disadvantages Very rigid repository structure. I think it s really difficult to learn Many more commands needed to do things that Subversion does automatically. 5 Subversion Learn from the net s experience of 10 years with CVS. Works a lot like CVS, with most obvious deficiencies gone. Most flexible. Also called by its command-name svn. 5.1 Features Centralized repository. Move, copy, delete files. Constant space and time copies Binary files Symlinks in client 1.1 or later No explicit branching and tagging features. Think of it as a versioned file system with version on one axis and the directory tree on the other. Subversion handles symlinks! It features a cool symlink emulation feature on Windows. We can see from the suggested repository layout how Subversion manages branching and tagging. Constant space copies make this possible. 3

6 SVN Repository Layout project-name trunk branches tags branch-1 branch-2 tag-1 tag-2 7 SVK Originally called SubversionKeeper. Decentralized features of arch and BitKeeper. Simpler repository structure than arch. Use with Subversion, CVS, Perforce servers without special server-side support Horrible documentation. 8 Using Subversion 8.1 Subversion commands Creating a repository: Importing files: Checking out a directory: Adding a file Committing changes Updating working directory Merge from one branch into another Make branches and tags, copy files Use for backups: svnadmin create <path> svn import <path> <URL> svn checkout <URL> svn add <path> svn commit svn update svn merge svn cp svnadmin dump svnadmin create: two repository formats to choose from: bdb (uses Berkeley DB), and fsfs. bdb can t be used over NFS, so you ll want to choose fsfs if you re setting up your subversion repository that way. These are the commands I used for my SVN/SVK demonstration: 4

svnadmin create --fs-type=fsfs THEREPO export SVN=file://$(pwd)/THEREPO cp -a /etc/x11. svn mkdir $SVN/trunk svn import X11 $SVN/trunk svn stat X11 rm -rf X11 svn ls $SVN svn ls $SVN/trunk svn co $SVN/trunk X11 cd X11 # make some edits to files svn diff svn stat svn revert #one file svn commit #the rest svn rm xkb ls #doesn t disappear svn commit ls #disappears svn mv Xresources MovingThisSomewhere ls #occurs immediately svn commit 8.2 svk commands Most of the Subversion commands are svk commands too! Mirror of a remote repository svk mirror <URL> <depotpath> Synchronize that mirror svk sync <depotpath> Merge specific commits svk cmerge -c <revisions> \ <srcpath> <destpath> Star-merge knows what s been svk smerge merged already Generate a patch file by adding the -p option to smerge or cmerge. More steps in the demonstration svk depotmap -i #setup svk for the first time svk ls // svk mirror $SVN //thex11repo svk ls // svk ls //thex11repo svk sync //thex11repo #import the whole version history svk rm //thex11repo svk mirror $SVN //thex11repo svnlook youngest THEREPO 5

9 Backing up svk sync -s 5 //thex11repo #import version history starting at version 5 svk cp //thex11repo/trunk //localbranch svk co //localbranch svk rm Xsession.d #this is an easy edit. svk rm fluxbox svk smerge //localbranch //thex11repo/trunk svn ls $SVN/trunk #smerge propagated changes back to the original repository This script is called from part of a larger script that generates a backup.iso and then actually burns it. #!/bin/bash export R=/home/bloom_svn LAST=$(svnlook youngest $R) if [ -e /cdrom/subversion_latest ]; then FIRST=$( cat /cdrom/subversion_latest ) FIRST=$(($FIRST + 1)) else FIRST=0 fi svnadmin dump $R --deltas --incremental \ -r${first}:${last} > $1 echo $LAST > $2 6

10 At $HOME in Subversion I keep my whole home directory (except for mail) in Subversion. 10.1 Reasons for my setup Keep computers in sync Easy incremental backups of my documents Version history Joey Hess says: distributed backups 10.2 Features of my setup Three (nonoverlapping) sets of dotfiles:.hide,.home-plus, home-base. Partial Checkouts 10.3 Tools (and kludges) for my setup ~/bin/recursive.svnfix jpilot-backup Joey Hess used to use CVS modules to create different checkouts of his system. CVS would automatically recursively check those files in and out. The most analagous feature on Subversion is the svn:externals property. But that doesn t have recursive commits. I don t use svn:externals anyway, but I like recursive commits I check out anything I need into the top level of my home directory. I let ~/bin/recursive traverse into these directories and commit and update them. 7

10.3.1 /bin/recursive #!/bin/sh echo ======= echo * ~ cd $HOME svn $1 for x in *.home-plus.hide; do if [ -e $x ] ; then echo ======= echo * $x cd $x && svn $1 cd $HOME fi done 10.3.2.svnfix Lives in.home-plus and.hide Links things into their appropriate places fixes some permissions..ssh/authorized keys ssh secret keys.fetchmailrc Copied from Joey Hess svn repository at http://svn. kitenet.net/trunk/ 10.3.3 jpilot-backup I use jpilot as my PalmPilot desktop software. jpilot s default backup behavior is to rename directories a lot (too much to keep things backed up in Subversion) Solution: the jpilot-backup plugin. check the PersistentArchive checkbox sync once to get all of the databases in place. keep.jpilot/backup/mainarchive in Subversion. 8

11 Where do things live in my home directory 11.1 The root bin/ I absolutely need this otherwise some things just don t work hide/ rename this to.hide after checking it out hide-insecure/ contains an SSH private key with a password home-base/ move everything here into the root of the home directory after checking out home-plus/ parts/ research/ this has been here since before I moved everything to Subversion. I decided to leave research where it was, rather than moving it into parts/ because I still had several working directories checked out, pointing to it. It s probably quite insecure to have.hide kept in the same repository, even though I only check it out over ssh or locally. The best way for you to determine which dotfiles should go where is to review your own usage habits on your computers, and determine which files you would like to have move around with your profile, which ones you would like to have only on computers with larger capacities, and which ones are truly secret. Each of the.directories is liable to have its own collection of included/excluded files, for example browser cache files aren t included, and lots of files that change really frequently aren t included. 9

12 Resources http://subversion.tigris.org/ Subversion http://svnbook.red-bean.com/ Subversion Book http://svk.elixus.org/ SVK http://www.kitenet.net/~joey/cvshome.html The original article At $HOME in CVS http://www.kitenet.net/~joey/svnhome.html Joey s new article posted after I agreed to do this talk. http://better-scm.berlios.de/comparison/ comparison.html A comparison of source code management systems 10