Slide 1

Slide 1 text

GUIDE TO SOCIAL CODING

Slide 2

Slide 2 text

@sora_h

Slide 3

Slide 3 text

ͦΒ͸ʔ soraŋher

Slide 4

Slide 4 text

Shota Fukumori

Slide 5

Slide 5 text

@sora_h Ruby committer

Slide 6

Slide 6 text

@sora_h Ruby committer தଔϑϦʔλʔ

Slide 7

Slide 7 text

@sora_h Ruby committer தଔϑϦʔλʔ github.com/sorah

Slide 8

Slide 8 text

@sora_h Ruby committer தଔϑϦʔλʔ →sorah.jp

Slide 9

Slide 9 text

ఏڙ

Slide 10

Slide 10 text

This talk may seems promoting an one company I’m thinking this talk is not promotion GitHub is tool to code socially, right? DISCLAIMER

Slide 11

Slide 11 text

QUICK SURVEY (raise your hand)

Slide 12

Slide 12 text

QUICK SURVEY 1 (raise your hand) HAVE A GITHUB ACCOUNT

Slide 13

Slide 13 text

QUICK SURVEY 2 (raise your hand) USING GITHUB TO PUBLISH CODE

Slide 14

Slide 14 text

QUICK SURVEY 3 (raise your hand) I HAVE AN ACCOUNT, BUT DOING NOTHING

Slide 15

Slide 15 text

QUICK SURVEY 4 (raise your hand) I’VE SENT PULL REQUEST

Slide 16

Slide 16 text

QUICK SURVEY 5 (raise your hand) COLLABORATING AT PRIVATE REPO

Slide 17

Slide 17 text

QUICK SURVEY 6 (raise your hand) USING GITHUB ENTERPRISE

Slide 18

Slide 18 text

SOCIAL CODING

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Ruby community founds GitHub

Slide 21

Slide 21 text

GitHub and Ruby go together

Slide 22

Slide 22 text

GitHub —Ruby

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

(today’s) most common tool for Social Coding

Slide 25

Slide 25 text

HOW SOCIAL Follow people Star/watch projects Commit (line) note

Slide 26

Slide 26 text

HOW SOCIAL Fork & Pull Request

Slide 27

Slide 27 text

FORK & PULL REQUEST

Slide 28

Slide 28 text

FORK someone/project me/project

Slide 29

Slide 29 text

FORK USE CASE To customize

Slide 30

Slide 30 text

FORK USE CASE To customize To write a patch

Slide 31

Slide 31 text

FORK USE CASE To write a patch

Slide 32

Slide 32 text

PULL REQUEST A WAY TO SEND A PATCH is

Slide 33

Slide 33 text

PULL REQUEST WAY TO SEND A PATCH is a SHARED

Slide 34

Slide 34 text

PULL REQUEST WAY TO SEND A PATCH is a EASY

Slide 35

Slide 35 text

You can send a patch in just 4 STEPS

Slide 36

Slide 36 text

Fork Commit Push Pull Request

Slide 37

Slide 37 text

any projects any available at hosted in GitHub

Slide 38

Slide 38 text

FORK PULL REQUEST We can’t disable

Slide 39

Slide 39 text

We can easily send a patch to any projects in same protocol

Slide 40

Slide 40 text

but some projects are accepting patches at another place (Redmine, etc)

Slide 41

Slide 41 text

but some projects are accepting patches at another place (Redmine, etc) e.g. ruby/ruby

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

HOW TO PULL REQUEST

Slide 44

Slide 44 text

HOW TO PULL REQUEST Best Practices

Slide 45

Slide 45 text

YES, the main subject of this talk

Slide 46

Slide 46 text

1 Feel a problem

Slide 47

Slide 47 text

1 Feel a problem BUG Fix by your hand

Slide 48

Slide 48 text

1 Feel a problem FEATURE Implement it!

Slide 49

Slide 49 text

Fork the repo 2

Slide 50

Slide 50 text

Fork the repo 2

Slide 51

Slide 51 text

Fork the repo then clone it. 2

Slide 52

Slide 52 text

TIME TO HACK 2

Slide 53

Slide 53 text

2 But, don’t forget to create & checkout TOPIC BRANCH

Slide 54

Slide 54 text

2 But, don’t forget to create & checkout It’s not required, but recommended. TOPIC BRANCH

Slide 55

Slide 55 text

BEST PRACTICE 1 USE TOPIC BRANCH git checkout -b foo master

Slide 56

Slide 56 text

COMMIT & PUSH 3

Slide 57

Slide 57 text

OPEN github.com// then choose the branch 4

Slide 58

Slide 58 text

PRO TIP USE [W] key To quickly open branch/tag chooser

Slide 59

Slide 59 text

CLICK “Pull Request” THEN TYPE A DESCRIPTION OF YOUR PATCH 5

Slide 60

Slide 60 text

BEST PRACTICE KEEP TITLE SIMPLY

Slide 61

Slide 61 text

BEST PRACTICE 2 for bug fix INCLUDE TINY REPRODUCE STEP

Slide 62

Slide 62 text

BEST PRACTICE 2 for bug fix INCLUDE WHAT HAPPENED & EXPECTED

Slide 63

Slide 63 text

BEST PRACTICE 2 for feature adding INCLUDE USE CASES & USAGE

Slide 64

Slide 64 text

BEST PRACTICE 2 for feature adding TEST?

Slide 65

Slide 65 text

BEST PRACTICE 3 headers make description readable.

Slide 66

Slide 66 text

BEST PRACTICE 4 WRITE IN ENGLISH ӳޠॻ͚ (ओʹ)೔ຊਓ޲͚ ͨͱ͑૬ख͕೔ຊਓͰ΋ͳ!

Slide 67

Slide 67 text

BEST PRACTICE 4 CANNOT? LEARN! Ͱ͖ͳ͍? ษڧ͠·͠ΐ͏

Slide 68

Slide 68 text

BEST PRACTICE 4 CODE IS USEFUL TO EXPLAIN ίʔυͰޠΔͷ͸ΞϦ

Slide 69

Slide 69 text

BEST PRACTICE 4 Not bad, ೤ҙ΋͋Γ? https://github.com/igrigorik/em-websocket/pull/91

Slide 70

Slide 70 text

SEND! 6

Slide 71

Slide 71 text

Wait for a response Answer for reply 7

Slide 72

Slide 72 text

EXAMPLES

Slide 73

Slide 73 text

komagata/lokka #90 if wp:post_type is not post, page or attachment, variable model will be nil, and it makes NoMethodError at line 55.

Slide 74

Slide 74 text

komagata/lokka #121 WordPress ͱಉ͡Α͏ʹ Post ʹରͯ͠ͷ URL ΛΧελϚΠ ζͰ͖ΔΑ͏ʹ͠·ͨ͠ɽ This patch provides customizable Post's URL as like as WordPress.

Slide 75

Slide 75 text

komagata/lokka #121 ͜ͷػೳ͸ Wordpress Ͱ͢Ͱ ʹ࢖͍ͬͯΔਓ (Θͨ͠ͷΑ͏ ͳ) ͸طଘͷϦϯΫΛແବʹ ͠ͳ͍ͨΊʹҠߦʹ͸ඞਢͩ ͱ૝͍·͢ɽ

Slide 76

Slide 76 text

komagata/lokka #121 Some people (including me!) can't move (from WordPress) to Lokka because there is no custom permalink feature… :(

Slide 77

Slide 77 text

sinatra/sinatra #57 I fixed for ruby1.9.2-p0.

Slide 78

Slide 78 text

sinatra/sinatra #57

Slide 79

Slide 79 text

sinatra/sinatra #57 https://github.com/rkh/sinatra/commit/ 8a3aea14a2301a0f56689591dee12ac8966472c7

Slide 80

Slide 80 text

TIP: BE CAREFUL TO DUPES

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

COLLABORATION USING PULL REQUEST

Slide 83

Slide 83 text

tl;dr Benefit: Use pull request for reviewing codes!

Slide 84

Slide 84 text

We can send pull request to the same repository.

Slide 85

Slide 85 text

of course, available both public & private repository

Slide 86

Slide 86 text

GIT FLOW

Slide 87

Slide 87 text

GIT FLOW Case of sinsai.info

Slide 88

Slide 88 text

sinsai.info Portal site for Victims of the big earthquake at Mar 11, 2011

Slide 89

Slide 89 text

sinsai.info Many volunteers, developed on GitHub (private + public repo)

Slide 90

Slide 90 text

Flow at sinsai.info Create issue Push topic branch Pull Request Confirm & Merge

Slide 91

Slide 91 text

Flow at sinsai.info Create issue Push topic branch Pull Request Confirm & Merge ×

Slide 92

Slide 92 text

Flow at sinsai.info Create issue on redmine Push topic branch Redmine status: “Waiting to merge” Confirm & Merge

Slide 93

Slide 93 text

Flow at sinsai.info I didn’t know we can send Pull Request in the same repository then…

Slide 94

Slide 94 text

REVIEWING Line notes at Pull Request’s diff page useful to code reviewing

Slide 95

Slide 95 text

REVIEWING

Slide 96

Slide 96 text

REVIEWING

Slide 97

Slide 97 text

REVIEWING

Slide 98

Slide 98 text

PRO TIP :emoji: http://emoji-cheat-sheet.com/

Slide 99

Slide 99 text

PRO TIP :+1: :sushi: :trollface: :emoji:

Slide 100

Slide 100 text

FOR PRIVATE THINGS

Slide 101

Slide 101 text

We can push private things on GitHub and use socially features

Slide 102

Slide 102 text

if you’re paying money to GitHub (but students can get micro account at free, ͏Β΍·͍͠ͳ͋)

Slide 103

Slide 103 text

For enterprise: GitHub:enterprise provides internal installation (VM image)

Slide 104

Slide 104 text

PRO TIP USE `hub` defunkt/hub

Slide 105

Slide 105 text

PRO TIP Attach a patch to issue; Convert an issue to pull request USE `hub`

Slide 106

Slide 106 text

Let’s social coding CONCLUSION

Slide 107

Slide 107 text

HAVE FUN

Slide 108

Slide 108 text

THANK YOU