CISC/CMPE320 - Prof. McLeod

Slides:



Advertisements
Similar presentations
Source Control Repositories for Enabling Team Working Svetlin Nakov Telerik Corporation
Advertisements

SubVersioN – the new Central Service at DESY by Marian Gawron.
Version Control. What is Version Control? Manages file sharing for Concurrent Development Keeps track of changes with Version Control SubVersion (SVN)
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.
1 CSE 390 “Lecture 11” Version control with Git slides created by Ruth Anderson, images from
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Version control Using Git 1Version control, using Git.
Version Control with Subversion. What is Version Control Good For? Maintaining project/file history - so you don’t have to worry about it Managing collaboration.
Source Control Repositories for Team Collaboration: SVN, TFS, Git Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training.
Introduction to Version Control with SVN & Git CSC/ECE 517, Fall 2012 Titus Barik & Ed Gehringer, with help from Gaurav.
Introduction to Version Control
Source Control Repositories for Team Collaboration: SVN, TFS, Git.
Git – versioning and managing your software L. Grewe.
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
Version control Using Git Version control, using Git1.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
Information Systems and Network Engineering Laboratory II DR. KEN COSH WEEK 1.
Version Control.
Introduction to Version Control SE-2030 Dr. Rob Hasker 1 Based on material at and slides written.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Computer Science and Engineering The Ohio State University  Widely used, especially in the opensource community, to track all changes to a project and.
Introduction to Version Control with Git CSC/ECE 517, Fall 2014 A joint project of the CSC/ECE 517 staff, including Titus Barik, Gaurav Tungatkar, Govind.
Version Control Systems. Version Control Manage changes to software code – Preserve history – Facilitate multiple users / versions.
GIT.
Fall 2015CISC/CMPE320 - Prof. McLeod1 CISC/CMPE320 Project Wikis are private again. Assignment 3 is posted. Due Nov. 6. SDD framework must be in place.
It’s not just an insult from Harry Potter!. What is Git? Distributed Version Control System (DVCS) – Compared to a Centralized Version Control System.
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Introduction to Git - Chirag Dani. Objectives Basics of Git Understanding different “Mindset of Git” Demo - Git with Visual Studio.
Source Control Repositories for Enabling Team Working Doncho Minkov Telerik Corporation
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
GIT Version control. Version Control Sharing code via a centralized DB Also provides for Backtracking (going back to a previous version of code), Branching.
Source Control Dr. Scott Schaefer. Version Control Systems Allow for maintenance and archiving of multiple versions of code / other files Designed for.
Dr. Tanusri Bhattacharya
CompSci 230 Software Construction
CS5220 Advanced Topics in Web Programming Version Control with Git
4 Version control (part 1)
Information Systems and Network Engineering Laboratory II
Git and GitHub primer.
11 Version control (part 2)
SVN intro (review).
LECTURE 2: Software Configuration Management
Git Practice walkthrough.
Source Control Dr. Scott Schaefer.
Version control, using Git
CS5220 Advanced Topics in Web Programming Version Control with Git
Version Control System using Git
Storing, Sending, and Tracking Files Recitation 2
Concurrent Version Control
CISC/CMPE320 - Prof. McLeod
Version Control System
Akshay Narayan git up to speed with RCS Akshay Narayan
CISC/CMPE320 - Prof. McLeod
Source Code Management
Version Control with git
LECTURE 3: Software Configuration Management
Git CS Fall 2018.
Version Control System - Git
Version control with Git
CISC/CMPE320 - Prof. McLeod
CISC/CMPE320 - Prof. McLeod
CISC/CMPE320 - Prof. McLeod
Introduction to Version Control with Git
CISC/CMPE320 - Prof. McLeod
CISC/CMPE320 - Prof. McLeod
Version Control Software
Version Control with Git
Systems Analysis and Design I
Introduction to The Git Version Control System
Using GitHub for Papyrus Models Jessie Jewitt – OAM Technology Consulting/ ARM Inc. January 29th, 2018.
Presentation transcript:

CISC/CMPE320 - Prof. McLeod Winter 2013 CISC/CMPE320 8/25/2018 CISC/CMPE320 Notices Teamwork: You don’t have to, but if you wish to send RAD completion notices and links out, send them to your “mentor” instead. Assignment 2 due Friday, this week. Fall 2017 CISC/CMPE320 - Prof. McLeod Prof. Alan McLeod

CISC/CMPE320 - Prof. McLeod Today Finish up Operator Overloading. Repositories. Fall 2017 CISC/CMPE320 - Prof. McLeod

Overloading the Function Call Operator: ( ) Allows an object to behave as if it is a function. Called a function object. The only operator where the number of arguments is not fixed or limited to one or two. See the RandomInt class. Used in the STL. Fall 2017 CISC/CMPE320 - Prof. McLeod

Aside - inline Functions Used in the RandomInt class. Used when the function body is short: ≤ 3 assignment statements. one conditional. one return. An inline function is not placed on the activation record stack, but is expanded in place and so is executed faster. Must be in the declaration file. The downside is that a copy is made every time the function is invoked – so it should be short. Fall 2017 CISC/CMPE320 - Prof. McLeod

Seldom Overloaded Operators Address-of, & boolean logic, &&, || The comma, , Member access through pointer, ->* Not really useful… Overloading new, new[], delete and delete[] may be a bit more useful, but they are difficult to do properly and seldom really worth doing. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Final Cautions Beginning C++ programmers can get enthused about operator overloading! Make sure that the overloadings you code make sense to anyone reading your code. If they do not, write a member function that does the same thing instead. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Final Cautions, Cont. Don’t forget that you cannot change operator precedence. Suppose we overloaded the operator ^ for our complex number class to give us exponentiation: a = -1 + e ^ (i * pi) Normally the exponentiation would take place first in a normal mathematical expression. But ^ actually has a lower precedence than arithmetic operators since it is a boolean operator. What you actually get is: a = (-1 + e) ^ ((i * pi)) Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Final Cautions, Cont. In this case, it would be much better to forget the overloading and just use a member function instead: a = -1 + pow(e, (i * pi)) Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Repositories What if two or more people want to edit the same file at the same time? Option 1: make them take turns But then only one person can be working at any time And how do you enforce the rule? Option 2: patch up differences afterwards Requires a lot of re-working Stuff always gets lost Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Repositories, Cont. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Repositories, Cont. Keep the master copy of the file in a central repository. Each author edits a working copy. When they're ready to share their changes, they commit them to the repository. Other people can then do an update to get those changes. Even one coder can take advantage of this system if he works on multiple machines. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Version Control You might find that your work has gone completely in the wrong direction or you find that the errors are piling up – you might need to throw away some work and return to an earlier version of the software. Or you might just need to know the author of the latest changes to a file. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Version Control, Cont. The repository can store previous versions and keep track of who commits what and when: Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Repositories in Use Commercial ($$): Perforce: http://www.perforce.com Older: CVS: http://www.cvshome.org Replaced CVS: Subversion (or “SVN”): http://subversion.apache.org/ CVS: “Concurrent Versions System” SVN: “Apache Subversion” or just “Subversion” Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Best? - Git Stands for “Git”. Originally designed by Linus Torvalds starting in 2005 (what else did he design?). Built for Linux kernel development. Every git working directory is a full blown repository. Much faster and smaller footprint than SVN or CVS. Less required server interaction! Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Git Structure (Image from Wikipedia) Your local repository consists of three “trees”: The working directory is just that – the files that you are currently working on. The index is a staging area. The local repository contains links to your last commits. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Git Terms You clone to create your repository. You add to put files in the staging area. When you are ready, you commit files to your local repository. You have created a snapshot of your repository. A push sends your snapshot out to the remote repository. Other users will get your updates by using a “fetch” or a “pull”. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Git Terms, Cont. A fetch just updates your local repository and adds information to your log files and version records. It is pretty harmless and should be done frequently. A pull carries out a fetch followed by a merge of the Head branch. This will update the files in your working directory to the latest versions. If two people have changed the same file before the merge operation you get a merge conflict that has to be resolved. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Server in Git This is a de-centralized repository system. Everyone has a repository and all the necessary history and version log information in compressed format. Interaction with your local repository is very fast. You can do a lot of work without having to do a push. The server acts mainly to facilitate communication between all the separate repositories. In SVN and CVS the server is the single repository. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Git Branching Features can be developed in an isolated way by creating a branch. Eventually it will merge back to the “master” branch. Fall 2017 CISC/CMPE320 - Prof. McLeod

Repositories in Use, Cont. You need a server, we have bitbucket on caslab. Or (if you were not in this class) you could use a cloud-based server. And local client software. Such as “GitKraken”, “SourceTree” or “SmartGit”, etc. Many others, or your IDE (like Eclipse or Visual Studio) will have a git client built right into it. Also popular: GitLab and GitHub. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Conflicts What happens when two people commit the same file? Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Resolving Conflicts How to prevent? Option 1: only allow one person to have a writeable copy at any time (lock the file). This is called pessimistic concurrency or lock, modify, unlock. Used in Microsoft Visual SourceSafe. Option 2: let people edit, and resolve conflicts afterward by merging files. Called optimistic concurrency or copy, modify, merge. “It's easier to get forgiveness than permission”. Most modern systems (including Subversion) do this. Fall 2017 CISC/CMPE320 - Prof. McLeod

Resolving Conflicts, Cont. Using Git “terminology”: Hermione attempts a push, but Ron has done a push after Hermione has fetched (or cloned). Hermione’s push will be rejected, even if she has not changed the same files that Ron has changed. Hermione must do a fetch and merge to get Ron’s changes before she can push. Ron’s changes will be applied and then Hermione’s changes will be re-applied. Fall 2017 CISC/CMPE320 - Prof. McLeod

Resolving Conflicts, Cont. It may be that changes do not overlap, so a merge will work automatically, but if there is a conflict: The resolution process allows one person to view a merged file, with the differences marked. This person decides which revisions to keep/discard. Only works for text files, not binary files. If more than two people submit the same file – then the project needs better management… Fall 2017 CISC/CMPE320 - Prof. McLeod

Conflict Resolution, Cont. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Repositories, Cont. Note that not only are file changes tracked and recorded but directory structure changes are also monitored. Always add a comment when you commit noting your changes in a general way and why you made those changes. Was this a response to a bug fix, for example? Did you run your unit tests on your code before you committed? Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod How to Use Git, Cont. Fall 2017 CISC/CMPE320 - Prof. McLeod

CISC/CMPE320 - Prof. McLeod Fall 2017 CISC/CMPE320 - Prof. McLeod