how do i contribute?

110
How Do I Contribute? Tim Sutton Concordia University, Montreal

Upload: timothy-sutton

Post on 13-Apr-2017

183 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: How Do I Contribute?

How Do I Contribute?Tim Sutton

Concordia University, Montreal

Page 2: How Do I Contribute?

IT Operations

Page 3: How Do I Contribute?

IT OperationsDevelopment

Page 4: How Do I Contribute?

Source Control Management (SCM)

Page 5: How Do I Contribute?

Git

Page 6: How Do I Contribute?

Git Mercurial

Page 7: How Do I Contribute?

commit 922ae4e4d558cf5c47e8a815abf2f6fe7c25a409 Author: Graham Gilbert <[email protected]> Date: Mon Sep 1 15:03:34 2014 +0100

Symlink for backwards compatibility

diff --git a/Dockerfile b/Dockerfile index ee3529b..0f64d91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,6 +57,7 @@ CMD ["/run.sh"]

EXPOSE 8000 VOLUME ["$APP_DIR/plugins", "$APP_DIR/sal/settings.py"] +RUN mkdir -p /home/app +RUN ln -s $APP_DIR /home/app/sal RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Page 8: How Do I Contribute?

commit 071822982716877cf37634df6b0ec5cb3754545d Author: Timothy Sutton <[email protected]> Date: Fri Oct 24 14:59:57 2014 -0400

Install Mavericks: bump to 10.9.5

diff --git a/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist b/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist index c656813..bef4c33 100755 --- a/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist +++ b/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist @@ -17,7 +17,7 @@ <key>ignoreinstallfailure</key> <string>NO</string> <key>package</key> - <string>InstallOSX_10.9.4_13E28_custom_autobuild.pkg</string> + <string>InstallOSX_10.9.5_13F34_custom_autobuild.pkg</string> <key>postponedinstall</key> <string>NO</string> <key>targetname</key> @@ -31,6 +31,6 @@ </dict> </dict> <key>title</key> -<string> Upgrade to OS X Mavericks (10.9.4)</string> +<string> Upgrade to OS X Mavericks (10.9.5)</string> </dict> </plist>

Page 9: How Do I Contribute?

Good housekeeping

Page 10: How Do I Contribute?

Know where you are

Page 11: How Do I Contribute?
Page 12: How Do I Contribute?

Resources

2nd edition released mid-Octoberhttp://git-scm.com/book

https://github.com/progit/progit2

Page 13: How Do I Contribute?

Resources

http://stackoverflow.com/questions/tagged/git?sort=votes

Page 14: How Do I Contribute?

Resources

https://try.github.iohttp://onlywei.github.io/

explain-git-with-d3

Page 15: How Do I Contribute?

Resources

https://try.github.iohttp://onlywei.github.io/

explain-git-with-d3

Page 16: How Do I Contribute?

GUI

SourceTree

GitHub for MacGitX-dev

Tower

Page 17: How Do I Contribute?

http://git-scm.com/download/gui/mac

SourceTree

GitHub for MacGitX-dev

Tower

Page 18: How Do I Contribute?
Page 19: How Do I Contribute?
Page 20: How Do I Contribute?
Page 21: How Do I Contribute?
Page 22: How Do I Contribute?
Page 23: How Do I Contribute?

Practice, practice

Page 24: How Do I Contribute?

GitHub

Page 25: How Do I Contribute?

GitHub

Page 26: How Do I Contribute?

GitHub

Page 27: How Do I Contribute?

GitHub

Page 28: How Do I Contribute?
Page 29: How Do I Contribute?

Contributor Maintainer

Page 30: How Do I Contribute?

Contributor Maintainer

Page 31: How Do I Contribute?

Submitting changes$

Page 32: How Do I Contribute?

Submitting changes$

Page 33: How Do I Contribute?

Submitting changes$ git clone https://github.com/timsutton/munki-conditions

Page 34: How Do I Contribute?

Submitting changes$

Cloning into 'munki-conditions'...remote: Counting objects: 28, done.remote: Total 28 (delta 0), reused 0 (delta 0)Unpacking objects: 100% (28/28), done.Checking connectivity... done.

git clone https://github.com/timsutton/munki-conditions

Page 35: How Do I Contribute?

$

Submitting changes

Page 36: How Do I Contribute?

$

git:(master) >$

cd munki-conditions

Submitting changes

Page 37: How Do I Contribute?

$

git:(master) >$

cd munki-conditions

Submitting changescp /new/munki/condition/virtual .

Page 38: How Do I Contribute?

$

git:(master) >$

git:(master) ✗ >$

cd munki-conditions

Submitting changescp /new/munki/condition/virtual .

Page 39: How Do I Contribute?

$

git:(master) >$

git:(master) ✗ >$ git status

cd munki-conditions

Submitting changescp /new/munki/condition/virtual .

Page 40: How Do I Contribute?

$

git:(master) >$

git:(master) ✗ >$

On branch masterYour branch is up-to-date with 'origin/master'.Untracked files:

(use "git add <file>..." to include in what will be committed)

virtual

nothing added to commit but untracked files present (use "git add" totrack)

git status

cd munki-conditions

Submitting changescp /new/munki/condition/virtual .

Page 41: How Do I Contribute?

git:(master) ✗ >$

Submitting changes

Page 42: How Do I Contribute?

git:(master) ✗ >$ git branch add-virtual

git:(master) ✗ >$

Submitting changes

Page 43: How Do I Contribute?

git:(master) ✗ >$ git branch add-virtual

git:(master) ✗ >$ git checkout add-virtual

Switched to branch 'add-virtual'

git:(add-virtual) ✗ >$

Submitting changes

Page 44: How Do I Contribute?

git:(master) ✗ >$ git branch add-virtual

git:(master) ✗ >$ git checkout add-virtual

Switched to branch 'add-virtual'

git:(add-virtual) ✗ >$ git add virtual

git:(add-virtual) ✗ >$

Submitting changes

Page 45: How Do I Contribute?

git:(master) ✗ >$ git branch add-virtual

git:(master) ✗ >$ git checkout add-virtual

Switched to branch 'add-virtual'

git:(add-virtual) ✗ >$ git add virtual

git:(add-virtual) ✗ >$ git status

Submitting changes

Page 46: How Do I Contribute?

git:(master) ✗ >$ git branch add-virtual

git:(master) ✗ >$ git checkout add-virtual

Switched to branch 'add-virtual'

git:(add-virtual) ✗ >$ git add virtual

git:(add-virtual) ✗ >$ git status

On branch add-virtual Changes to be committed: (use "git reset HEAD <file>..." to unstage)

new file: virtual

git:(add-virtual) ✗ >$

Submitting changes

Page 47: How Do I Contribute?

git:(master) ✗ >$ git branch add-virtual

git:(master) ✗ >$ git checkout add-virtual

Switched to branch 'add-virtual'

git:(add-virtual) ✗ >$ git add virtual

git:(add-virtual) ✗ >$ git status

On branch add-virtual Changes to be committed: (use "git reset HEAD <file>..." to unstage)

new file: virtual

git:(add-virtual) ✗ >$ git commit

Submitting changes

Page 48: How Do I Contribute?

# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #

Submitting changes

Page 49: How Do I Contribute?

# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #

Adding new ‘virtual’ condition

Submitting changes

Page 50: How Do I Contribute?

# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #

Adding new ‘virtual’ condition

- returns ‘physical’ on a physical Mac, ‘vmware’ on Fusion

Submitting changes

Page 51: How Do I Contribute?

# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #

Adding new ‘virtual’ condition

- returns ‘physical’ on a physical Mac, ‘vmware’ on Fusion

:wq

Submitting changes

Page 52: How Do I Contribute?

[add-virtual c633790] Adding new 'virtual' condition 1 file changed, 20 insertions(+) create mode 100755 virtual

Submitting changes

Page 53: How Do I Contribute?

[add-virtual c633790] Adding new 'virtual' condition 1 file changed, 20 insertions(+) create mode 100755 virtual

git:(add-virtual) >$

Submitting changes

Page 54: How Do I Contribute?

[add-virtual c633790] Adding new 'virtual' condition 1 file changed, 20 insertions(+) create mode 100755 virtual

git:(add-virtual) >$ git status

On branch add-virtual nothing to commit, working directory clean

Submitting changes

Page 55: How Do I Contribute?

Submitting changes

Page 56: How Do I Contribute?

Submitting changes

Page 57: How Do I Contribute?

git:(add-virtual) >$

Submitting changes

Page 58: How Do I Contribute?

git:(add-virtual) >$ git remote add mactech \

https://github.com/mactech2014/munki-conditions

git:(add-virtual) >$

Submitting changes

Page 59: How Do I Contribute?

git:(add-virtual) >$ git remote add mactech \

https://github.com/mactech2014/munki-conditions

git:(add-virtual) >$ git push mactech add-virtual

Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 716 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To https://github.com/mactech2014/munki-conditions * [new branch] add-virtual -> add-virtual

Submitting changes

Page 60: How Do I Contribute?

Submitting changes

Page 61: How Do I Contribute?

Submitting changes

Page 62: How Do I Contribute?

Submitting changes

Page 63: How Do I Contribute?

Submitting changes

Page 64: How Do I Contribute?

Pulling in changes git:(master) >$

Page 65: How Do I Contribute?

Pulling in changes git:(master) >$

Page 66: How Do I Contribute?

Pulling in changes git:(master) >$ git remote add mactech \

https://github.com/mactech2014/munki-conditions

git:(master) >$

Page 67: How Do I Contribute?

Pulling in changes git:(master) >$ git remote add mactech \

https://github.com/mactech2014/munki-conditions

git:(master) >$ git fetch mactech

From https://github.com/mactech2014/munki-conditions * [new branch] add-virtual -> mactech/add-virtual * [new branch] master -> mactech/master

Page 68: How Do I Contribute?

Pulling in changes git:(master) >$

Page 69: How Do I Contribute?

Pulling in changes git:(master) >$ git log mactech/add-virtual

commit c633790b8405d30d2681ae6b912cf7d89dcad5bc Author: MacTech 2014 <[email protected]> Date: Thu Oct 23 14:50:08 2014 -0400

Adding new 'virtual' condition

- returns 'physical' on a physical Mac, 'vmware' on Fusion

Page 70: How Do I Contribute?

commit c633790b8405d30d2681ae6b912cf7d89dcad5bc Author: MacTech 2014 <[email protected]> Date: Thu Oct 23 14:50:08 2014 -0400

Adding new 'virtual' condition

- returns 'physical' on a physical Mac, 'vmware' on Fusion

diff --git a/virtual b/virtual new file mode 100755 index 0000000..7697495 --- /dev/null +++ b/virtual @@ -0,0 +1,20 @@ +#!/bin/sh +# +# writes a condition: 'virtual', which can be:

Pulling in changes git:(master) >$ git log --patch mactech/add-virtual

Page 71: How Do I Contribute?

index 0000000..7697495 --- /dev/null +++ b/virtual @@ -0,0 +1,20 @@ +#!/bin/sh +# +# writes a condition: 'virtual', which can be: +# - 'physical' if a physical machine +# - 'vmware' if a VMware VM +# +# Designed to be analogous to the 'virtual' Facter fact. No +# other virtualization platforms are supported currently. + +DEFAULTS=/usr/bin/defaults +MUNKI_DIR=$("${DEFAULTS}" read /Library/Preferences/ManagedInstalls ManagedInstallDir) +COND_DOMAIN="${MUNKI_DIR}/ConditionalItems" +KEY="virtual" + +VALUE="physical" +if system_profiler SPHardwareDataType | grep Boot\ ROM | grep VMW; then + VALUE="vmware" +fi + +"${DEFAULTS}" write "${COND_DOMAIN}" "${KEY}" "${VALUE}"

Pulling in changes

Page 72: How Do I Contribute?

Pulling in changes git:(master) >$

Page 73: How Do I Contribute?

Pulling in changes git:(master) >$ git merge mactech/add-virtual

Updating 34c2366..c633790 Fast-forward virtual | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 virtual

git:(master) >$

Page 74: How Do I Contribute?

Pulling in changes git:(master) >$ git merge mactech/add-virtual

Updating 34c2366..c633790 Fast-forward virtual | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 virtual

git:(master) >$ git log -1

commit c633790b8405d30d2681ae6b912cf7d89dcad5bc Author: MacTech 2014 <[email protected]> Date: Thu Oct 23 14:50:08 2014 -0400

Adding new 'virtual' condition

- returns ‘physical’ on a physical Mac, ‘vmware’ on Fusion

Page 75: How Do I Contribute?

Pulling in changes

Page 76: How Do I Contribute?

Pulling in changes git:(master) >$

Page 77: How Do I Contribute?

Pulling in changes git:(master) >$ git push

Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 716 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To https://github.com/timsutton/munki-conditions 34c2366..c633790 master -> master

git:(master) >$

Page 78: How Do I Contribute?

Pulling in changes

Page 79: How Do I Contribute?

Pulling in changes

Page 80: How Do I Contribute?

Guidelines, ProTips

Page 81: How Do I Contribute?

Just do it

CC BY 2.0 chan yiu hao

https://flic.kr/p/kiHuDG

Page 82: How Do I Contribute?

Topic branches

Page 83: How Do I Contribute?

Topic branches

Page 84: How Do I Contribute?

Topic branches

http://stackoverflow.com/questions/1628563/move-the-most-recent-

commits-to-a-new-branch-with-git

Page 85: How Do I Contribute?

Follow coding style

Page 86: How Do I Contribute?

git status git diff --staged git diff --check

Page 87: How Do I Contribute?
Page 88: How Do I Contribute?
Page 89: How Do I Contribute?
Page 90: How Do I Contribute?

Referencing code on GitHub

Page 91: How Do I Contribute?

Referencing code on GitHub

Page 92: How Do I Contribute?

Referencing code on GitHub

https://help.github.com/articles/writing-on-github/https://help.github.com/articles/github-flavored-markdown/

Page 93: How Do I Contribute?

https://github.com/autopkg/recipes/blob/mozilla-cdn-s3/Mozilla/MozillaURLProvider.py

Referencing code on GitHub

Page 94: How Do I Contribute?

https://github.com/autopkg/recipes/blob/mozilla-cdn-s3/Mozilla/MozillaURLProvider.py#L93-L96

Referencing code on GitHub

Page 95: How Do I Contribute?

https://github.com/autopkg/recipes/blob/mozilla-cdn-s3/Mozilla/MozillaURLProvider.py#L93-L96

Referencing code on GitHub

Page 96: How Do I Contribute?

https://github.com/autopkg/recipes/blob/2a9594fcc660b812cd917e5c85698585eed04fed/Mozilla/MozillaURLProvider.py#L93-L96

Referencing code on GitHub

Page 97: How Do I Contribute?

One-time pull

git pull <url> <branch>

Page 98: How Do I Contribute?

One-time pull

git pull \ https://github.com/newspaperclub/osx-vm-templates \ easier-renaming-of-vagrant-user

Page 99: How Do I Contribute?

Checking out pull requests$

Page 100: How Do I Contribute?

Checking out pull requests

$

$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'

Page 101: How Do I Contribute?

Checking out pull requests

$ git pull

$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'

Page 102: How Do I Contribute?

Checking out pull requests

remote: Counting objects: 36, done.remote: Compressing objects: 100% (27/27), done.remote: Total 36 (delta 15), reused 19 (delta 9)Unpacking objects: 100% (36/36), done.From https://github.com/timsutton/osx-vm-templates* [new ref] refs/pull/1/head -> origin/pr/1* [new ref] refs/pull/16/head -> origin/pr/16* [new ref] refs/pull/2/head -> origin/pr/2* [new ref] refs/pull/3/head -> origin/pr/3* [new ref] refs/pull/4/head -> origin/pr/4* [new ref] refs/pull/6/head -> origin/pr/6* [new ref] refs/pull/8/head -> origin/pr/8

$ git pull

$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'

$

Page 103: How Do I Contribute?

Checking out pull requests

remote: Counting objects: 36, done.remote: Compressing objects: 100% (27/27), done.remote: Total 36 (delta 15), reused 19 (delta 9)Unpacking objects: 100% (36/36), done.From https://github.com/timsutton/osx-vm-templates* [new ref] refs/pull/1/head -> origin/pr/1* [new ref] refs/pull/16/head -> origin/pr/16* [new ref] refs/pull/2/head -> origin/pr/2* [new ref] refs/pull/3/head -> origin/pr/3* [new ref] refs/pull/4/head -> origin/pr/4* [new ref] refs/pull/6/head -> origin/pr/6* [new ref] refs/pull/8/head -> origin/pr/8

$ git pull

$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'

$ git checkout origin/pr/16Note: checking out 'origin/pr/16'.

Page 104: How Do I Contribute?

https://help.github.com/articles/checking-out-pull-requests-locally

http://git-scm.com/book/en/v2/GitHub-Maintaining-a-Project#Managing-Pull-Requests

http://nedbatchelder.com/blog/201407/fetching_github_pull_requests.html

Checking out pull requests

Page 105: How Do I Contribute?

TextMate mode (press ’t’)

Always make a topic branch

Keep commits logical

Page 106: How Do I Contribute?

TextMate mode (press ’t’)

Always make a topic branch

Keep commits logical

Page 107: How Do I Contribute?

Shell integration

https://github.com/jimeh/git-aware-prompt

Page 108: How Do I Contribute?

Shell integration

https://github.com/jimeh/git-aware-prompt

Oh-My-ZSH (default robbyrussel theme) http://ohmyz.sh

Page 109: How Do I Contribute?

macops.ca/mactech-2014

Page 110: How Do I Contribute?