CF Objective Notes - What's a Pull Request? (Contributing to Open Source)

May 14, 2014

What's a Pull Request? (Contributing to Open Source)
Brad Wood

What is "Free"?
Not all free software is open source
not all open source software is free (e.g. linux flavors that pay for support)

the license controls what you can/can't do
don't HAVE to use a license but most do
choosealicense.com
– great site for reading thru all the license craziness. Much easier way to pick which license is best for you.

GPL
Apache
MIT
BSD
...common licenses

What is open source?
Support, training, or feature development may be offered for charge

Everyone can view, understand and exploit your code
...which is both good and bad

Why release OSS?
Open Exchange
instead of a big giant company putting things out, it's a community where people collaboratively build stuff
1 dev shop may only have a few developers but the OSS community could have dozens/hundreds of people working on a production
Transparency
Meritocracy

Why use OSS
less restrictive in what you can do
many OSS things let you take the code and make it part of your project
easier to debug
can be modified
want to change how it works, go for it
but be careful. If you change internals and then a new version comes out, you'll be stuck

can avoid lock-in
if you spend $$$ for a closed source app, then want to move somewhere else, will feel bad about spending all that money (this assumes the OSS is free of course).

Security / quality (many eyes)

Why avoid OSS
poor community support
small projects could 'dry up' (but same could happen with commercial projects)
documentation can suffer
might want to look at recent commits to see if there is any good documentation for the project before using it

Bad ease of use
OSS doesn't often pay UX consultants to make sure it's easy to use

Disorganized

(none of these problems are "guaranteed" to exist in OSS, and all could exist in closed source apps too)

Plug in
stay current – follow peole on twitter, mailing lists, etc, to see what's happening
ask questions
answer questions – help out when you know the answer to something
report bugs
most OSS things have SOME kind of issue tracker
Give back to the project
help with documentation, update the wiki, etc
most OSS projects won't turn you down if you offer to help
contribute new features
bug fixes (even fixing typos are helpful)

How do we contribute code
BitBucket
owned by the same guys that make Jira and SourceTree

Google Code
SourceForge (lots of java projects here)
Assembla
GitHub

source control –
"a giant undo" button
multiple people won't step on each other's toes

there's not a "right or wrong" way to organize a repo

but there are "common" ways...

bleeding edge = the last bit of code that rolled off the developers fingertips

GitHub terms
distributed source control
fork (create a copy of an entire repo)
usually on GitHub you're forking someone else's repo and copying it to your own account

Push / Pull

Remotes (origin, upstream)
how you push/pull to other repos
most common names: origin and upstream
origin – the repo you cloned
upstream – if you forked it from someone else

clone – as close as you get to a "check out" in Git

branch – same as SVN

Pull Request – how you contribute code back to someone else's repo

Git Extensions – a good IDE for Git

On GitHub, Can only have 1 pull request per branch at a time
so create a branch for each feature you want to contribute so you can do multiple features at 1 time