Top Banner
Let The Contribution Begin SeongJae Park <[email protected]>
135

Let the contribution begin (EST futures)

Apr 16, 2017

Download

Software

SeongJae Park
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Let the contribution begin  (EST futures)

Let The Contribution BeginSeongJae Park <[email protected]>

Page 2: Let the contribution begin  (EST futures)

Great To Meet You

SeongJae Park <[email protected]>

Researcher @ DCSLAB, SNU

Programmer @ KOSSLAB

Yet Another Newbie

Page 3: Let the contribution begin  (EST futures)

This Talk Is...

Page 4: Let the contribution begin  (EST futures)

This Talk Is...

For Newbie, By Newbie, Of Newbie

image src: http://1.bp.blogspot.com/_i0kiD-6jeeI/TRq1fzwZh8I/AAAAAAAAAGw/2ggLbFod4II/s1600/newbie.png

Page 5: Let the contribution begin  (EST futures)

This Talk Is...

For Newbie, By Newbie, Of Newbie

About F/OSS & Contribution(What, Why, How)

image src: http://www.mrmc-tool.org/images/contribute.jpg

Page 9: Let the contribution begin  (EST futures)

The History Of F/OSS1961, MIT purchased PDP-1

1969, Unix, C, and ARPAnet were invented

1975, Microsoft created1977, Apple Computer created

image src: http://upload.wikimedia.org/wikipedia/commons/a/a2/Steve_Jobs_and_Bill_Gates_(522695099).jpg

Page 10: Let the contribution begin  (EST futures)

The History Of F/OSS1961, MIT purchased PDP-1

1969, Unix, C, and ARPAnet were invented

1975, Microsoft created

1977, Apple Computer created

1982, RMS started GNU project1991, Linus Torvalds introduced Linux

image src: http://foro.ubuntu-guia.com/file/n3879119/rms-linus.jpg

Page 11: Let the contribution begin  (EST futures)

The History Of F/OSS1961, MIT purchased PDP-1

1969, Unix, C, and ARPAnet were invented

1975, Microsoft created

1977, Apple Computer created

1982, RMS started GNU project

1991, Linus Torvalds introduced Linux

1998, Open Source Initiative was organized

http://www.open-electronics.org/wp-content/uploads/2015/12/OpenSource2.png

Page 12: Let the contribution begin  (EST futures)

The History Of F/OSS

1961, MIT purchased PDP-11969, Unix, C, and ARPAnet were invented1975, Microsoft created1977, Apple Computer created1982, RMS started GNU project1991, Linus Torvalds introduced Linux1998, Open Source Initiative was organized

image src: http://upload.wikimedia.org/wikipedia/commons/a/a2/Steve_Jobs_and_Bill_Gates_(522695099).jpg

Page 13: Let the contribution begin  (EST futures)

Open Source Definition

● Determine whether a software license can be labeled with the open-source certification mark.

● “Open Source doesn’t just mean access to the source code.”

● 10 Criterias include: Free Redistribution, Source Code, Derived Works, Integrity of The Author’s Source Code, No Discrimination, …

● https://opensource.org/osd-annotated

Page 14: Let the contribution begin  (EST futures)

Contribution

Translation

Page 15: Let the contribution begin  (EST futures)

Contribution

Translation

Bug Fix

Page 16: Let the contribution begin  (EST futures)

Contribution

Translation

Bug Fix

Feature Implementation

Page 17: Let the contribution begin  (EST futures)

Contribution

Translation

Bug Fix

Feature Implementation

Use

Page 18: Let the contribution begin  (EST futures)

Contribution

Translation

Bug Fix

Feature Implementation

Use

In This Talk, Only Code Contribution

Page 19: Let the contribution begin  (EST futures)

Why Contribution

Page 20: Let the contribution begin  (EST futures)

Why Contribution

Honor

image src: http://www.mailandfemail.com/wp-content/uploads/2011/06/Medal-of-honor.jpg

Page 21: Let the contribution begin  (EST futures)

Why Contribution

HonorCareer

Page 22: Let the contribution begin  (EST futures)

Why Contribution

HonorCareerTraining

image src: http://1.bp.blogspot.com/-yzBPR57Pg2M/T_VmgM976VI/AAAAAAAABz0/Rgj-co8__aU/s1600/Maggie-million-dollar-baby-18619084-720-480.jpg

Page 23: Let the contribution begin  (EST futures)

Why Contribution

HonorCareerTrainingUpstream Development

image src: http://dustinkirkland.files.wordpress.com/2009/07/upstream.jpg

Page 24: Let the contribution begin  (EST futures)

Why Contribution

HonorCareerTrainingUpstream DevelopmentTo Change The World

image src: http://media.focusonthefamily.com/blogmedia/images/jim-daly/changetheworld.jpg

Page 25: Let the contribution begin  (EST futures)

Why Contribution

HonorCareerTrainingUpstream DevelopmentTo Change The WorldBecause We Can

image src: http://www.blogtap.net/wp-content/uploads/2010/02/obama-yes-we-can.jpg

Page 26: Let the contribution begin  (EST futures)

Why Contribution

HonorCareerTrainingUpstream DevelopmentTo Change The WorldBecause We Can...Need More?

Page 27: Let the contribution begin  (EST futures)

General Contribution Process

Page 28: Let the contribution begin  (EST futures)

General Contribution ProcessGet Source Code

Page 29: Let the contribution begin  (EST futures)

General Contribution ProcessGet Source Code

Make a Goal

Page 30: Let the contribution begin  (EST futures)

General Contribution ProcessGet Source Code

Modify Source Code(Make Patch)

Make a Goal

Page 31: Let the contribution begin  (EST futures)

General Contribution ProcessGet Source Code

Modify Source Code(Make Patch)

Send Patch

Make a Goal

Page 32: Let the contribution begin  (EST futures)

General Contribution ProcessGet Source Code

Modify Source Code(Make Patch)

Send Patch

Get Review

Make a Goal

Page 33: Let the contribution begin  (EST futures)

General Contribution ProcessGet Source Code

Modify Source Code(Make Patch)

Send Patch

Get Review

Approved?No

Make a Goal

Page 34: Let the contribution begin  (EST futures)

General Contribution ProcessGet Source Code

Modify Source Code(Make Patch)

Send Patch

Get Review

Approved?

Yes

No

Make a Goal

Page 35: Let the contribution begin  (EST futures)

Keep In Mind

Page 36: Let the contribution begin  (EST futures)

Keep In Mind

Coding style

image src: http://www.emacswiki.org/pics/static/TabsSpacesBoth.png

Page 37: Let the contribution begin  (EST futures)

Keep In MindCoding style

You are just a newbie here

Page 39: Let the contribution begin  (EST futures)

Keep In MindCoding Style

You Are Just A Newbie Here

Start from jab

Commit log style

Page 40: Let the contribution begin  (EST futures)

Keep In Mind - Commit Log Style

Summarized title on first line

aio: v3: fix kioctx not being freed after cancellation at exit time v3 corrects a typo in v2 of this patch. The wrong version of the patch was copied over and misspelled ctx in the first hunk. A known good tree with this patch is at git://git.kvack.org/~bcrl/linux-next-20130213.git-v3 . Signed-off-by: Benjamin LaHaise <[email protected]>

Page 41: Let the contribution begin  (EST futures)

Keep In Mind - Commit Log Style

Summarized title on first line

Just \n on second line

aio: v3: fix kioctx not being freed after cancellation at exit time v3 corrects a typo in v2 of this patch. The wrong version of the patch was copied over and misspelled ctx in the first hunk. A known good tree with this patch is at git://git.kvack.org/~bcrl/linux-next-20130213.git-v3 . Signed-off-by: Benjamin LaHaise <[email protected]>

Page 42: Let the contribution begin  (EST futures)

Keep In Mind - Commit Log Style

Summarized title on first line

Just \n on second line

Detailed log from third line aio: v3: fix kioctx not being freed after cancellation at exit time v3 corrects a typo in v2 of this patch. The wrong version of the patch was copied over and misspelled ctx in the first hunk. A known good tree with this patch is at git://git.kvack.org/~bcrl/linux-next-20130213.git-v3 . Signed-off-by: Benjamin LaHaise <[email protected]>

Page 43: Let the contribution begin  (EST futures)

Keep In Mind

Coding style

You are just a newbie here

Start from jab

Commit log style

Page 44: Let the contribution begin  (EST futures)

Practice: Linux

One Of Famous, Successful F/OSS Project

Page 45: Let the contribution begin  (EST futures)

Practice: Linux

One Of Famous, Successful F/OSS Project

Documentation/HOWTO

Documentation/development-process

Page 46: Let the contribution begin  (EST futures)

Linux - Get Source Code

So many Source Trees at git.kernel.org

image src: https://twimg0-a.akamaihd.net/profile_images/1794549696/SourceTree_newlogo.png

Page 47: Let the contribution begin  (EST futures)

Linux - Get Source Code

So many Source Trees at git.kernel.org

Use The linux-next Source TreeSource Tree For Next Release

Page 48: Let the contribution begin  (EST futures)

Linux - Get Source Code

So many Source Trees at git.kernel.org

Use The linux-next Source TreeSource Tree For Next ReleaseStephen Rothwell Manages

Page 49: Let the contribution begin  (EST futures)

Linux - Get Source Code

So many Source Trees at git.kernel.org

Use The linux-next Source TreeSource Tree For Next ReleaseStephen Rothwell Manages

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

Page 50: Let the contribution begin  (EST futures)

Linux - Make a Goal

Find your task

Page 51: Let the contribution begin  (EST futures)

Linux - Make a Goal

Find your task

Coding style can be a good start point

Page 52: Let the contribution begin  (EST futures)

Linux - Make a Goal

Find your task

Coding style can be a good start point

$ ./scripts/checkpatch.pl --help

Page 53: Let the contribution begin  (EST futures)

Linux - Version Control

Usual Life Of File

FileA ver 0 FileB ver 0

Page 54: Let the contribution begin  (EST futures)

Linux - Version Control

Usual Life Of File

FileA ver 0 FileB ver 1

Page 55: Let the contribution begin  (EST futures)

Linux - Version Control

Usual Life Of File

FileB ver 1 FileA ver 1

Page 56: Let the contribution begin  (EST futures)

Linux - Version Control

Usual Life Of File

FileB ver 2FileA ver 1

Page 57: Let the contribution begin  (EST futures)

Linux - Version Control

Usual Life Of File

FileB ver 2FileA ver 1

Page 58: Let the contribution begin  (EST futures)

Linux - Version Control

Usual Life Of File

$ ls

foo.c

foo_20140111.c

foo_final.c

foo_realfinal.c

foo_planb.c

foo_finalfinal.c

Page 59: Let the contribution begin  (EST futures)

Linux - Version Control

Usual Life Of File

$ ls

foo.c

foo_20140111.c

foo_final.c

foo_realfinal.c

foo_planb.c

foo_finalfinal.c

Page 60: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0

Page 61: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0

commit 1

Page 62: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0

commit 1

./

../FileAFileB

Page 63: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0

commit 1

Page 64: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0

commit 1

master branch

Page 65: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0 FileB ver 1

commit 1

master branch

Page 66: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0 FileB ver 1

commit 1 commit 2

master branch

Page 67: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileB ver 0 FileB ver 1

commit 1 commit 2

master branch

Page 68: Let the contribution begin  (EST futures)

Linux - Version Control

Life Of File Under git

FileA ver 0 FileA ver 1FileB ver 0 FileB ver 1 FileB ver 2

commit 1 commit 2 commit 3

master branch

Page 69: Let the contribution begin  (EST futures)

Linux - Version Control

Topic Branch

FileA ver 0 FileA ver 1FileB ver 0 FileB ver 1

commit 1 commit 2 commit 3

master branch topic branch

FileB ver 2

Page 70: Let the contribution begin  (EST futures)

Linux - Version Control

Topic Branch

FileA ver 0 FileA ver 1FileB ver 0 FileB ver 1 FileB ver 2

commit 1 commit 2 commit 3

master branch

FileA ver 2

commit 4

topic branch

Page 71: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Topic Branch: First time, looks unnecessary

Page 72: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Topic Branch: First time, looks unnecessary

Page 73: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Topic Branch: First time, looks unnecessary

Page 74: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

clone!

Topic Branch: First time, looks unnecessary

Page 75: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Topic Branch: First time, looks unnecessary

Page 76: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Pull me!

Topic Branch: First time, looks unnecessary

Page 77: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Pull me!

Thanks :)

Topic Branch: First time, looks unnecessary

Page 78: Let the contribution begin  (EST futures)

Linux - Version Control

Topic Branch: What if time goes by...

Upstream

Local Repository

Page 79: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Topic Branch: What if time goes by...

Page 80: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Pull me!

Topic Branch: What if time goes by...

Page 81: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Pull me!

Conflict Occurred. Why should I merge

your change manually? :p

Topic Branch: What if time goes by...

Page 82: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Pull me!

Also, merging you manually will make history looks ugly

Topic Branch: What if time goes by...

Page 83: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Pull me!

Also, merging you manually will make history looks ugly

If Upstream merge the change manually

Topic Branch: What if time goes by...

Page 84: Let the contribution begin  (EST futures)

Linux - Version Control

Upstream

Local Repository

Pull me!

Also, merging you manually will make history looks ugly

If nobody use topic branch

Topic Branch: What if time goes by...

Page 85: Let the contribution begin  (EST futures)

Linux - Version Control

Topic Branch: Again.

Upstream

Local Repository

Page 86: Let the contribution begin  (EST futures)

Linux - Version Control

Topic Branch: Get latest code while your change resides in topic branch safely

Upstream

Local Repository

Page 87: Let the contribution begin  (EST futures)

Linux - Version Control

Topic Branch: Ensure the branch can be merged cleanly

Upstream

Local Repository

Page 88: Let the contribution begin  (EST futures)

Topic Branch: Ensure the branch can be merged cleanly

Linux - Version Control

Upstream

Local Repository

Pull me!

Page 89: Let the contribution begin  (EST futures)

Topic Branch: Ensure the branch can be merged cleanly

Linux - Version Control

Upstream

Local Repository

Pull me!

Applied, thanks! :)

Page 90: Let the contribution begin  (EST futures)

Linux - Version Control

● Golden rule○ Patch should be made from latest source code

$ git remote update

$ git merge upstream/master

○ Your change(s) should live inside topic branch

$ git checkout -b <fix_the_foo>

Page 91: Let the contribution begin  (EST futures)

Linux - Make a Patch

Topic Branch

Edit Code As You Prefer

image src: http://secretgeek.net/image/real-programmers-code-in-binary.jpg

Page 92: Let the contribution begin  (EST futures)

Linux - Make a Patch

Topic Branch

Edit Code As You Prefer

Commit using -s option

Page 93: Let the contribution begin  (EST futures)

Linux - Make a PatchTopic Branch

Edit Code As You Prefer

Commit using -s optioncommit 106edea2fe051df65a1a6231e9ffa2876cc391cc

Author: Stephen Rothwell <[email protected]>

Date: Fri Mar 1 15:52:01 2013 +1100

Add linux-next specific files for 20130301

Signed-off-by: Stephen Rothwell <[email protected]>

Page 94: Let the contribution begin  (EST futures)

Linux - Make a Patch

Signed-Off-By Means:(a) I created this change; or(b) Based this on a previous work with acompatible license; or(c) Provided to me by (a), (b), or (c) and notmodified(d) This contribution is public.

Page 95: Let the contribution begin  (EST futures)

Linux - Make a Patch

Topic Branch

Edit Code As You Prefer

Commit using -s option

$ git format-patch master..HEAD

Page 96: Let the contribution begin  (EST futures)

Linux - Send Patch

$ ./scripts/get_maintainer.pl \

<path to patch file>

Page 97: Let the contribution begin  (EST futures)

Linux - Send Patch$ ./scripts/get_maintainer.pl \

<path to patch file>

$ sudo apt-get install git-email

Page 98: Let the contribution begin  (EST futures)

Linux - Send Patch$ ./scripts/get_maintainer.pl \

<path to patch file>

$ sudo apt-get install git-email

$ git config sendemail.smtpserver \

smtp.gmail.com

$ git config sendemail.smtpserverport 587

$ git config sendemail.smtpencryption tls

$ git config sendemail.smtpuser \

<your-email-address>

Page 99: Let the contribution begin  (EST futures)

Linux - Send Patch$ ./scripts/get_maintainer.pl \

<path to patch file>

$ sudo apt-get install git-email$ git config sendemail.smtpserver \

smtp.gmail.com

$ git config sendemail.smtpserverport 587

$ git config sendemail.smtpencryption tls

$ git config sendemail.smtpuser \

<your-email-address>

$ git send-email --to \

<reviewer mail address> \

<path to patch file>

Page 100: Let the contribution begin  (EST futures)

Linux - Get Review

Just E-Mail

Page 101: Let the contribution begin  (EST futures)

Linux - Get Review

Just E-Mail

Be gentle citizen

Page 102: Let the contribution begin  (EST futures)

Linux - Get Review

Just E-Mail

Be gentle citizen

Mail should be plain text

Page 103: Let the contribution begin  (EST futures)

Linux - Get Merged Notification Mail

This is a note to let you know that I've just added the patch titled

staging: csr: Remove struct CsrEvent

to my staging git tree which can be found at

git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git

in the staging-next branch.

The patch will show up in the next release of the linux-next tree

(usually sometime within the next 24 hours during the week.)

The patch will also be merged in the next major kernel release

during the merge window.

If you have any questions about this process, please let me know.

Page 104: Let the contribution begin  (EST futures)

Practice: AOSP

Android Open Source Project

Page 105: Let the contribution begin  (EST futures)

Practice: AOSP

Android Open Source Project

World's most closed Open Source Software

Page 106: Let the contribution begin  (EST futures)

Practice: AOSP

Android Open Source Project

World's most closed Open Source Software

Development Source Tree Is Not Open

Page 107: Let the contribution begin  (EST futures)

AOSP: World's Most Closed OSS

From community

Google internalsource treeAOSP

From Googler

Release

Page 109: Let the contribution begin  (EST futures)

AOSP: Tools AOSP Uses

repo: Manages multiple projects of AOSP$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

$ chmod a+x ~/bin/repo

Page 110: Let the contribution begin  (EST futures)

AOSP: Tools AOSP Uses

repo: Manages multiple projects of AOSP$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

$ chmod a+x ~/bin/repo

gerrit: Web UI based code review system

Page 111: Let the contribution begin  (EST futures)

AOSP: Contribution Process

Get Source CodeAgree Contributor Agreement

Make Goal

Write Patch

Send Patch Merged / AbandonedCommented

Get Review / Approval

Page 113: Let the contribution begin  (EST futures)

AOSP: Agree Contributor Agreement

Page 114: Let the contribution begin  (EST futures)

AOSP: Agree Contributor Agreement

Page 115: Let the contribution begin  (EST futures)

AOSP: Agree Contributor Agreement

Page 116: Let the contribution begin  (EST futures)

AOSP: Agree Contributor Agreement

Page 117: Let the contribution begin  (EST futures)

AOSP: Agree Contributor Agreement

Page 118: Let the contribution begin  (EST futures)

AOSP: Get Source Code

$ repo init -u \https://android.googlesource.com/platform/manifest

$ repo sync

Page 120: Let the contribution begin  (EST futures)

AOSP: Make Patch

Topic Branch$ repo start <branch_name> <project path>

Page 123: Let the contribution begin  (EST futures)

AOSP - Send Patch

$ repo upload

Page 124: Let the contribution begin  (EST futures)

AOSP - Get Review

Page 125: Let the contribution begin  (EST futures)

AOSP - Get Review

Need Verification and Approval

Page 126: Let the contribution begin  (EST futures)

AOSP - Get Review

See git log to select Appropriate Reviewer

Page 127: Let the contribution begin  (EST futures)

AOSP - Upload New Patchset

Reviewer wants modified patch?

$ git commit --amend

$ repo upload

Page 128: Let the contribution begin  (EST futures)

Summary

Page 129: Let the contribution begin  (EST futures)

Summary

Get Source Code

Page 130: Let the contribution begin  (EST futures)

Summary

Get Source Code

Make Goal

Page 131: Let the contribution begin  (EST futures)

Summary

Get Source Code

Make Goal

Make Patch

Page 132: Let the contribution begin  (EST futures)

Summary

Get Source Code

Make Goal

Make Patch

Send Patch

Page 133: Let the contribution begin  (EST futures)

Summary

Get Source Code

Make Goal

Make Patch

Send Patch

Get Review

Page 134: Let the contribution begin  (EST futures)

LET IT GOThe Code Never Bothered You Anyway

Page 135: Let the contribution begin  (EST futures)

This work by SeongJae Park is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported

License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/.