Version Control with Git and What is there in Project 1 PALLABI GHOSH COMPUTER NETWORKS RECITATION 1

Similar documents
Revision control. INF5750/ Lecture 2 (Part I)

Project 1: A Web Server Called Liso

CS118 Discussion Week 2. Taqi

Revision Control and GIT

Version control system (VCS)

Version control with Git.

Version Control. Version Control

COMP/ELEC 429/556 Introduction to Computer Networks

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

The Old World. Have you ever had to collaborate on a project by

Version control CSE 403

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

Revision Control. An Introduction Using Git 1/15

Version control CSE 403

Version Control with Git ME 461 Fall 2018

Version Control. CSC207 Fall 2014

Version Control: Gitting Started

CS314 Software Engineering Configuration Management

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

Assignment 2 Group 5 Simon Gerber Systems Group Dept. Computer Science ETH Zurich - Switzerland

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

I/O Models. Kartik Gopalan

Introduction to Version Control

Version control CSE 403

Git. Presenter: Haotao (Eric) Lai Contact:

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

CSE 391 Lecture 9. Version control with Git

Version Control Systems (Part 1)

Version Control Systems: Overview

Project Management. Overview

GIT VERSION CONTROL TUTORIAL. William Wu 2014 October 7

Git tutorial. Katie Osterried C2SM. October 22, 2015

Git for Version Control

Distributed Version Control


Why so software engineeringy? Athula Balachandran Wolf Richter

Version Control Systems

Tutorial 2 GitHub Tutorial

Software Development I

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

TDDC88 Lab 4 Software Configuration Management

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

Week 5. CS 400 Programming III

Beyond git add/commit/push

Today: VM wrap-up Select (if time) Course wrap-up Final Evaluations

Git(Lab) Tutorial and Hands-On

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Git for Subversion users

Chapter 3. Revision Control

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

Lab Exercise Git: A distributed version control system

Object Oriented Programming. Week 1 Part 2 Git and egit

Version Control System - Git. zswu

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

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

A BASIC UNDERSTANDING OF VERSION CONTROL

Fundamentals of Git 1

Software Development. Using GIT. Pr. Olivier Gruber. Laboratoire d'informatique de Grenoble Université de Grenoble-Alpes

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

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

Version Control. Version Control

Introduction to distributed version control with git

CONCURRENCY MODEL. UNIX Programming 2014 Fall by Euiseong Seo

Submitting your Work using GIT

Git. A fast distributed revision control system. Nils Moschüring PhD Student (LMU)

GETTING STARTED WITH. Michael Lessard Senior Solutions Architect June 2017

Git: Distributed Version Control

CSC 2700: Scientific Computing

A quick (and maybe practical) guide to Git and version control. By Jay Johnson

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

A Practical Introduction to Version Control Systems

Θερινό Σχολείο, Ιουλίου git. Αχιλλέας Πιπινέλης. Μονάδα Αριστείας ΕΛ/ΛΑΚ ΤΕΙ Αθήνας

MOOSE-Based Application Development on GitLab

EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

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

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

Version Control Systems (VCS)

Git: Distributed Version Control

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

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

Practical C Programming

SECTION 2: HW3 Setup.

Lab 08. Command Line and Git

Using GitHub to Share with SparkFun a

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

GIT TUTORIAL. Creative Software Architectures for Collaborative Projects CS 130 Donald J. Patterson

Git better. Collaborative project management using Git and GitHub. Matteo Sostero March 13, Sant Anna School of Advanced Studies

KTH Royal Institute of Technology SEMINAR 2-29 March Simone Stefani -

Subversion Repository Layout

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy

Git, the magical version control

Any of the descriptors in the set {1, 4} have an exception condition pending

CESSDA Expert Seminar 13 & 14 September 2016 Prague, Czech Republic

Version Control for Fun and Profit

Using Git to Manage Source RTL

Intro to Git. Getting started with Version Control. Murray Anderegg February 9, 2018

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

Revision control systems (RCS) and. Subversion

Transcription:

Version Control with Git and What is there in Project 1 PALLABI GHOSH (PALLABIG@ANDREW.CMU.EDU) 15-441 COMPUTER NETWORKS RECITATION 1

What is version control? Revisit previous code versions Backup projects Work with others Find where things broke

Version Control Workflow Check for any remote updates Do your work Test your work Check differences, try to isolate changes Check for any remote updates Commit your work

Options Git Subversion (svn) Mercurial (hg) Bazaar (bzr) CVS Dropbox Others

svn Usually remotely hosted, shared with a team. svn Repository svn commit svn checkout svn update Your private universe, before commit. Working Copy

git torvalds git pull git push kernel@ghub git push No notion of working copy each is a full repository. jaharkes git pull bgilbert git push git pull abalacha git pull wolf git pull

Creating a Repository (repo) Create locally git init. Create remote git init -bare Clone local copy git clone git://path/to/repo

--bare or not? No- bare Creates a repository in your working directory Don t need to create mulople copies of your repo Won t help if you nuke the directory/disk This is probably what you need if you ll work in AFS - - bare Creates a server copy for hosong the project Workflow more similar to svn (but soll beuer) Everyone pushes to shared bare repo (like svn) You don t work in this copy; must clone elsewhere You want this to develop on your PC

Aside: network protocols Use different protocols to pull/push to repositories. If on the same computer: git://path/to/repo If hosted on AFS ssh+git://path/to/repo No ssh keys for AFS, sorry

Aside: Configure git git config --global user.name Pallabi Ghosh git config --global user.email pallabig@andrew.cmu.edu

Clone Pull a copy of the repo to develop on git clone git://path/to/repo git clone ssh+git:// unix.andrew.cmu.edu/afs/andrew/ course/15/441-641/andrewid/ ANDREWID-15-441-project-1.git

status Which files changed? Which files aren t being watched? Which files are stashed for commit? git status

Pull Get latest updates from remote copy git pull If this fails, you probably need to commit any unsaved changes

Commit Merge your changes into the repository git add foo.c git commit

Push Don t push broken code!! git push If this fails, you probably need to pull first

Branch & Merge Work on something different, without disturbing master/ trunk git branch branch_name git checkout branch_name do stuff git checkout master git merge branch_name

Tag Mark a revision as final or ready git tag tag_name git push --tags

Remote Hosting github.com bitbucket.org svnhub.com AFS Google code Sourceforge

Aside: AFS Permissions To make a bare repo in AFS that someone else can pull/ push from: 1. Make a new directory in your home dir 2. fs sa. ANDREWID rlidwk 3. git init - - bare

Good practices Small commits Useful messages Commit frequently Develop in branches Tag releasable versions

Small commits Only change one thing per commit When something breaks, easier to trace

Helpful commit messages Say what you changed Keep the first line short Make commits easy to find www.commitlogsfromlastnight.com

Commit Frequently Make changes, commit them When something breaks, go to the commit that broke it Only push when ready for others to get the changes Don t make your teammates hate you

Git questions?

Who took 15-213? And made an HTTP proxy?

Project 1: HTTP déjà vu Blast from the past 15-213 This Ome a real HTTP server with: SSL select() IO for concurrent connecoons HTTP 1.1 CGI Big project, start early!

Checkpoint 1 September 5 Create a git repo named 15-441- project- 1 Code a select()- based echo server handling mulople clients at once (building on the supplied echo server) Read the handout carefully lots of great references And once again start early J

What do you want to build? A webserver that can handle mulople concurrent connecoons!

What's the problem? Blocking!

What's the soluoon? Threading or select()

Threading approach Did in 15-213?? Main server blocks on accept() Accept incoming connecoon Fork() child process for each connecoon Pain! Need to manage a pool of threads And what if tasks have to communicate?

World of select() Event driven programming! Single process that muloplexes all requests. Caveat Programming is not so transparent! Server no longer acts like it has only one client!

How to use select()? Give select a set of sockets/file descriptors. select() blocks Oll something happens. Data coming in on some socket. Able to write to a socket. Exception at the socket. Once woken up, check for the event and service it the way the server would do.

select() #include <sys/select.h> int select (int nfds, fd_set* readfds, fd_set* writefds, fd_set* excepqds, struct Omeval *Omeout);

fd_set Datastructure Remember, file descriptor is just an integer! Datastructure is basically a bit array! Helper macros: FD_ZERO(fd_set* fdset); /* initializes fdset to have 0s for all fds */ FD_SET(int fd, fd_set* fdset); /* sets the bit for fd in fdset */ FD_CLR(int fd, fd_set* fdset); /* clears the bit for fd in fdset */ FD_ISSET(int fd, fd_set* fdset); /* returns non-0 if fd is set else 0 */

select() Parameters The FDs between 0 to nfds- 1 are checked. Check for reading in readfds. Check for wriong in writefds. Check for excepoon in excepqds. These fd_sets can be NULL. Omeout NULL blocking else how long to wait for the required condition before returning to the caller.

Return value, Error states Success number of ready descriptors. readfds, writefds and exceptfds are modified Time expired returns 0 (errno set to EINTR) Failure returns - 1 EBADF, EINTR, EINVAL, ENOMEM

Pseudo-code of Usage nfds = 0 IniOalize readfds, writefds, excepqds using FD_ZERO Add the listener socket to readfds using FD_SET and update nfds For each acove connecoon If connection has available read buffer, add fd to readfds (FD_SET) If connection has available write buffer, add to writefds (FD_SET) Add to exceptfds (FD_SET) not really needed for this project. Update nfds to ensure that the fd falls in the range select_return = select(nfds, readfds, writefds, excepqds, NULL) If select_return > 0 Handle exceptions if any fd in exceptfds is set to 1 (FD_ISSET) Read data from connections for which fd in readfds is set to 1 (FD_ISSET) Write data from connections for which fd in writefds is set to 1 (FD_ISSET) If listener socket is set to read, accept and handle new connection. Else handle error states

Checkpoint 1 Docs Makefile - make sure nothing is hard coded specific to your user; should build a file which runs the echo server (name it lisod) All of your source code - all.c and.h files readme.txt - file containing a brief descripoon of your current implementaoon of server tests.txt - file containing a brief descripoon of your tesong methods for server vulnerabilioes.txt - idenofy at least one vulnerability in your current implementaoon

Peek into the future Checkpoint 2 September 19 Implement HTTP 1.1 parser and persistent connections Checkpoint 3 October 3 Implement HTTPS handshaking and persistent connections via TLS Implement CGI server-side.

All questions?