1 February 6, 2008 1 Patches William Cohen NCSU CSC 591W February 6, 2008.

Slides:



Advertisements
Similar presentations
1 IST 410/420 Software Version Control 2 DevelopmentIntegration Test System Test User Acceptance Testing ProductionArchive DEVELOPMENTUSERS - Developers.
Advertisements

Version Control System (Sub)Version Control (SVN).
Software Configuration Management Donna Albino LIS489, December 3, 2014.
CS 501 : An Introduction to SCM & GForge An Introduction to SCM & GForge Lin Guo
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
By Steven Campbell and Erik Boone.  Sharing projects by putting them into a central repository.  Checking out copies of projects from the repository.
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Preparation and processing of in-session documents.
Article: Source Code Review Systems Author: Jason Remillard Presenter: Joe Borosky Class: Principles and Applications of Software Design Date: 11/2/2005.
Lesson 14: Installing and Uninstalling Programs how to install a new program what to do if the new program doesn’t work how to uninstall a program © CCI.
ITEC 370 Lecture 16 Implementation. Review Questions? Design document on F, feedback tomorrow Midterm on F Implementation –Management (MMM) –Team roles.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Chris Onions Getting started with CVS in ATLAS 11 Getting started with CVS in ATLAS Chris Onions (Tutorial based on that of Raúl Ramos Pollán CERN / IT.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Progress with migration to SVN Part3: How to work with g4svn and geant4tags tools. Geant4.
DireXions – Your Tool Box just got Bigger PxPlus Version Control System Using TortoiseSVN Presented by: Jane Raymond.
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
Copyright © 1994 Carnegie Mellon University Disciplined Software Engineering - Lecture 7 1 Design and Code Reviews - Overview What are design and code.
By: Anuj Sharma. Topics covered:  GIT Introduction  GIT Benefits over different tools  GIT workflow  GIT server creation  How to use GIT for first.
Samba – Good Just Keeps Getting Better The new and not so new features available in Samba, and how they benefit your organization. Copyright 2002 © Dustin.
Prepared by: Steve Teo Contributors: Tong Huu Khiem.
CSE 436—Requirements and Version Control Systems Ron K. Cytron 26 September 2005.
WinCvs. WinCVS WinCvs is a window based version control system. Use WinCvs when  You want to save every version of your file you have ever created. CVS.
INFO 637Lecture #71 Software Engineering Process II Product Implementation INFO 637 Glenn Booker.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
TOPIC 7.0 LINUX SERVICES AND CONFIGURATION. ROOT USER Root user is called “super user” because it has power far beyond those of mortal user. As root,
© 2012 Václav Rajlich Software Engineering: The Current Practice Ch Conclusion of software change The last phase of software change The activities.
Version Control and SVN ECE 297. Why Do We Need Version Control?
Recitation 2: Abhijit Warkhedi2/25/20161 Today’s Agenda u CVS u GDB.
TEAM FOUNDATION VERSION CONTROL AN OVERVIEW AND WALKTHROUGH By: Michael Mallar.
DIGITAL REPOSITORIES CGDD Job Description… Senior Tools Programmer – pulled August 4 th, 2011 from Gamasutra.
Chapter 25 – Configuration Management 1Chapter 25 Configuration management.
1 April 14, Starting New Open Source Software Projects William Cohen NCSU CSC 591W April 14, 2008.
1 April 2, Software Packaging and Releasing Best Practices William Cohen NCSU CSC 591W April 2, 2008.
1 February 6, Patch Submission and Review Process William Cohen NCSU CSC 591W February 11, 2008.
1 March 12, Testing William Cohen NCSU CSC 591W March 12, 2008.
1 January 14, Evaluating Open Source Software William Cohen NCSU CSC 591W January 14, 2008 Based on David Wheeler, “How to Evaluate Open Source.
1 January 31, Documenting Software William Cohen NCSU CSC 591W January 31, 2008.
1 April 21, Funding Open Source Software Projects William Cohen NCSU CSC 591W April 21, 2008.
Version Control Systems
Open source development model and methodologies.
CompSci 230 Software Construction
TOP project – STATUS UPDATE & Workflow demo
Development Environment
Regression Testing with its types
Open Source Software Development Environment
Software Packaging and Releasing
Source Control Dr. Scott Schaefer.
CVS revisions UML diagram
Version Control Systems
Maintaining software solutions
Concurrent Version Control
Issue Tracking Systems
Version Control System
Introduction of Week 3 Assignment Discussion
LECTURE 3: Software Configuration Management
Revision Control Daniel Daugherty
Design and Programming
Compilers, Make and SubVersion
Create PT: Complete the Task
Version Control at Google
CSE 303 Concepts and Tools for Software Development
Git CS Fall 2018.
Chapter 8 Software Evolution.
Concurrent Versions System
Software Re-engineering and Reverse Engineering
Lecture 3: Communicate in Writing
Presentation transcript:

1 February 6, Patches William Cohen NCSU CSC 591W February 6, 2008

2 2 Why Patches? ● Relatively compact compared to the original software ● Why send 40MB tarball for one line change? ● Focus people attention on the modification ● Possible to apply patches despite file changes ● Many revision control system generate patches easily ● Many tools available for dealing with patches

3 February 6, What is a “Patch”? ● A file that describes the changes in the files or files in a directory ● Usually applied to source code, but could have patch files so show changes to any text file

4 February 6, Example Patch --- opcontrol :12: ● +++ oprofile-0.5.3/utils/opcontrol :28: ● -229,7 +229,7 ● IS_TIMER=1 ● ;; ● 3|10|i386/athlon|x86-64*) ● -DEFAULT_EVENT=CPU_CLK_UNHALTED ● +DEFAULT_EVENT=RETIRED_INSNS ● ;; ● 6|11|i386/p4*) ● DEFAULT_EVENT=GLOBAL_POWER_EVENTS

5 February 6, Applying Patch ● Unix patch command ● -p n (--strip=n) option to strip off n levels of path ● -b (--backup) save backups of patched files ● -R (--reverse) to reverse sense of patch ● Patch does not blindly apply changes ● Patch uses lines to get context of patch ● Section of patch may apply earlier or later than lines mentioned ● Patch may attempt to use less of context (fuzz factor 1 or 2) ● Section of patch may be rejected unable to find place to install: ● Prints message patch hunk failed ● Creates.rej files with unaccepted sections of patch

6 February 6, Patch Generation and Submission Process ● Start with unmodified version of code ● Add feature or fix bug in code ● Generate patch ● Patch Self Review: ● Look over patch ● Applies to current checkout of software ● Software builds ● Patch works in the expected manner ● Legal ● Patch peer review ● Revise patch, incorporate comments from reviews ● Check patch into code repository

7 February 6, Code ● Usually start with a current version of the code checked out ● May need other patches not currently in the code repository ● May need to update code from repository: ● Development work may take a while ● Other developers may check in changes ● Sometimes useful to have branch in source revision control system: ● Used for larger more complicated patches ● Eliminates checkin from others ● Allows others developers see proposed changes

8 February 6, Code Style Guidelines ● Many projects have code style for consistency: ● GNU coding standards ● linux/Documentation/CodingStyle ● oprofile/doc/CodingStyle ● Indicates how to format code: ● Indentation and space ● Line length ● What should be in include files ● Automated checkers to check simple things

9 February 6, Generating Patch ● Include new files ● Exclude machine generated files ● Possible approaches of generation: ● Unix diff command between files/directories ● Use revision control system

10 February 6, Patch Self Review ● Review patch yourself before having other people review ● Follow code style guidelines for project ● Read over the patch: ● Does it have all the expected changes? ● Does it have unexpected changes? ● Verify that the patch cleanly applies to the current code ● Some projects have frequent changes ● Conflicts may occur ● Check that the patched software builds ● Testing: ● Does the patch cause any regression? ● Does the patch fix some failures?

11 February 6, Patch Submission Checklists ● Some steps may not be obvious to new developers ● Some projects have lists of steps to catch problems before the patch is merged in: ● linux/Documentation/SubmitChecklist ●

12 February 6, Patchutils ● Patchutils Linux tools to examine and manipulate patches ● Scripts to simplify some common tasks ● Commands include: ● lsdiff, list files modified in patch ● splitdiff, break patch into smaller patches ● rediff, to fix offsets and counts of hand-edited diff

13 February 6, Legal ● If the changes from another project: ● Is the code covered by copyright? ● Is this an acceptable use of the code? ● Are the project licenses compatible? ● If you wrote the code: ● Does the project require copyright assignment? ● Do you have correct copyright notices in code?

14 February 6, Patch Peer Review ● Give other people opportunity to comment about work ● Usually performed on project mailing list ● Other developers may have insights that improve the patch: ● Point out cases that the patch does not address ● Suggest simpler/cleaner methods of implementation ● Peers verify the patch implement desired bug fix or feature

15 February 6, Revising Patch ● Peers may suggest changes to address issues with patch: ● These may be very trivial formatting or naming issues ● May be more substantial changes to address issues ● Peer review may comment on things that need to be addressed, but not solutions to implement them ● Person submitting the patch needs to revise patch to address comments received ● Stick to technical discussion ● Ask for clarification when needed ● Conflicting opinions: ● From different reviewers ● From same reviewer at different times

16 February 6, Checking in Patches ● Someone with commit privileges needs to commit patch: ● Could be you ● Could be maintainer for that area of code ● Changes from patch being checked in: ● Code repository moving target ● Update working set to represent current code with patches ● Check in

17 February 6, Suggestions for Patches ● Read and understand any project guidelines and procedures for patch submission ● Focused patch: ● Have the patch address one issue ● Avoid having unrelated things in patch ● Keep patch small ● Make it easier for people to review (and more likely to review)

18 February 6, Suggestions for Patches (continued) ● Break large patch into series of smaller patches: ● Incremental changes toward larger goal: ● First patches should be applicable by itself ● Following patches can be dependent on earlier patches ● Group changes logically: ● For example: arch independent code in one patch, then patch for each architecture ● Test patch before submitting

19 February 6, Problem Patches ● Patches that have many unrelated changes in them ● Patches that are huge, e.g. 100'sKB in size ● Patches that change things that are unrelated to the patch ● Patches ignore the project coding standards

20 February 6, Further Reading ● ● ●