Guide to make a real contribution to an open source project

Who am I?


@tushar_rishav
  • GSoC'16 student contributing to coala - a static code analysis tool, under Python Software Foundation.
  • A senior year, pursuing B.Tech from
    the National Institute of Technology, Trichy, India.
  • More at www.gtushar.co

Let's get started

http://tinyurl.com/epworkshop2016 http://tinyurl.com/epwgist

Version Control Systems

What?

  • A software tool that manages changes to source code over time.

How?

  • Keeps track of every changes using simple database and hence the changes can be easily reverted if required.
    So don't panic if your colleague messed up!

Why?

  • Enables collaborative programming (we will do shortly) with minimum disruptions.
  • Developers can work on unrelated features or changes and at the end get changes merged back together.

Centralised Vs Distributed VCS

Centralised VCS


  • A single server that contains all the versioned files, and a number of clients that check out working copy from that central place. Eg: Subversion.

Major Drawback


  • Temporary failure: Being centralised, if the server goes down for certain period of time, then nobody can collaborate at all.
  • Permanent failure: If proper backups haven't been kept and the central database becomes corrupt, then we lose the entire history of the project.

Having the entire history of the project in a single place, we risk losing everything.

Distributed VCS


  • Developers fully mirror the repository.

Distributed VCS


  • Every clone is really a full backup of all the data.
  • If the server is down or corrupted, then any of the client repositories can be copied back up to the server to restore it.
  • Examples are Mercurial and Git.

Created by Linus Torvalds and
the Linux development community.

Fundamentals


  • Stores data as a set of snapshots of a miniature file systems.
  • Nearly every operation is local. One can work offline and requires network connection while pushing/fetching the changes to/from the remote server only.

Fundamentals


Workflow

  • 1. Working Area
  • 2. Staging Area
  • 3. Committed Area

Fundamentals


Workflow

  • Working Area:
    Have changed the file but have not committed it to your database yet.
  • Staging Area:
    Have marked a modified file in its current version to go into your next commit snapshot.
  • Committed Area:
    The data is safely stored in your local database.
~/git> commands

File Status


  • Tracked: files that were in the last snapshot; they can be unmodified, modified, or staged.
  • Untracked: files in your working directory that were not in your last snapshot and are not in your staging area.
  • Merge: Adds a merge commit.
  • Rebase: Re-writes the project history by creating new commits. It adds the local commits on top of the
	$ git merge  
	# merge changes from feature to master
	$ git rebase 
	$ git rebase -i  # interactive rebase.
							

Reference

Let's start the contribution process :)