Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to contribute to Git

How to contribute to Git

Gitに貢献する方法
Qiita主催のGet Great Git #2 at Nagoya での発表資料です
http://get-great-git-02.peatix.com

Hiroshige Umino

September 07, 2013
Tweet

More Decks by Hiroshige Umino

Other Decks in Technology

Transcript

  1. How to contribute to
    Git
    Get Great Git #2 @ Nagoya
    @yaotti

    View full-size slide

  2. ࣗݾ঺հ
    @yaotti Hiroshige UMINO
    Incrementsגࣜձࣾ CEO
    Ruby, Objective-C
    Scheme, Emacs
    Gitྺ5೥
    ޷͖ͳίϚϯυ: git rebase

    View full-size slide

  3. cherry-pick: allow "-" as abbreviation of '@{-1}'

    View full-size slide

  4. Gitʹߩݙ͢Δํ๏

    View full-size slide

  5. ֓ཁ
    Gitͷ։ൃମ੍
    ίʔυߏ੒
    ύον࡞੒͔ΒऔΓࠐ·ΕΔ·ͰͷྲྀΕ

    View full-size slide

  6. Gitͷ։ൃମ੍

    View full-size slide

  7. ϝʔϧ
    ΍ΓऔΓ͸શͯϝʔϦϯάϦετͰ
    http://dir.gmane.org/
    gmane.comp.version-control.git
    όάใࠂɼύονૹ෇ɼϨϏϡʔ
    GitHubͷPR͸࢖Θͳ͍ɼແࢹ͞ΕΔ

    View full-size slide

  8. ύον
    git commit; ...; git format-patch
    -> patches/0000-foo-bar.patch
    ϝʔϧʹinlineʹؚΊͯૹΔ
    ϝʔϧͷ৘ใ = ίϛοτσʔλ
    1ίϛοτ = ϝʔϧ1௨

    View full-size slide

  9. gitϨϙδτϦͷϒϥϯν
    master
    next: ϝϯςφʹΑΓ͓ͦΒ͘໰୊ͳ͍ͱΈͳ͞Εͨύον͕ೖΔ
    pu(proposed updates): topic branchΛू໿ͨ͠ϒϥϯν
    ௥Ճ࡞ۀ͕ඞཁͳύον͕ೖΔ(ςετෆ଍ɼυΩϡϝϯτෆ
    ଍)
    ࡞ۀ͕׬ྃͨ͠Βtopic branch͕nextʹϚʔδ͞ΕΔ
    maint: ϝϯςφϯεϦϦʔε༻ɽਖ਼ࣜϦϦʔε͝ͱʹ੾ΒΕΔ

    View full-size slide

  10. ݴޠߏ੒
    10%
    10%
    35%
    45%
    C ShellScript
    Perl Others

    View full-size slide

  11. ίʔυߏ੒
    git-* ίϚϯυ: ΄΅CͰ࣮૷͞Ε͍ͯΔ͕ɼ
    Ұ෦γΣϧεΫϦϓτ
    pull, rebase, stash, bisect, ...
    ςετ: γΣϦεΫϦϓτͰهड़
    git-add, commitͳͲ࣮ߦ!ϑΝΠϧ಺༰ͷ
    ൺֱͳͲ

    View full-size slide

  12. ύον࡞੒͔ΒऔΓࠐ·ΕΔ·Ͱ

    View full-size slide

  13. ࣄલ४උ
    GitϝʔϦϯάϦετΛߪಡ͠งғؾΛ஌Δ
    http://git-scm.com/community
    git clone https://github.com/git/git
    υΩϡϝϯτΛಡΉ
    SubmittingPatches, CodingGudelines,
    t/README

    View full-size slide

  14. ࣮૷
    όάमਖ਼: maint, ৽ػೳ: master͔Βcheckout
    ࣮૷࣌͸ςετ΋͖ͪΜͱॻ͘
    ϢʔςΟϦςΟ͸ t/test-lib-functions.sh
    ʹ (test_commit, test_mergeͳͲ)
    TAP: prove --timer --jobs 8 ./t[0-9]*.sh
    ίϛοτ࣌ʹ͸sign-off͢Δ(git commit -s)

    View full-size slide

  15. ίϛοτϝοηʔδ
    SubmittingPatchesʹॻ͔Ε͍ͯΔݪଇʹै͏
    1ߦ໨: 50จࣈ͕soft limitɼύονͷର৅Λઌ಄
    ʹॻ͘ɼͳͲ
    “cherry-pick: allow "-" as abbreviation
    of '@{-1}'”
    ӳޠͰ໌ྎͳίϛοτϝοηʔδΛॻ͘
    git log --no-merges

    View full-size slide

  16. ύονϑΝΠϧͷ࡞੒&ૹ৴
    git format-patch -M origin/master -o
    mypatches
    mypatches/0000-foo-bar-baz-
    of-1.patch
    “[PATCH 1/2] foo: bar baz”
    git send-email mypatches/*.patch

    View full-size slide

  17. ϨϏϡʔΛ଴ͭ
    ͱͯ΋ஸೡʹରԠͯ͠΋Β͑Δ
    Ϩεϙϯε͕ૣ͍
    σΟεΧογϣϯͰҙਤΛ͖ͪΜͱ఻͑Δ

    View full-size slide

  18. ໰୊͕͋ͬͨͱ͖
    ࠶౓मਖ਼͠ύονΛ࡞Δ
    ϝʔϧͷsubject͸[PATCH v2], [PATCH
    v3]ͷΑ͏ʹ͢Δ
    tip: “-- 8< --” (scissors)
    ίϛοτϝοηʔδʹ͸ؚΊͨ͘ͳ͍͕ϝʔϧ
    ʹೖΕ͍ͨจষΛॻ͘ͱ͖࢖͏

    View full-size slide

  19. ໰୊ͳ͔ͬͨͱ͖
    next(΋͘͠͸pu)ϒϥϯνʹऔΓࠐ·ΕΔ
    ద౰ͳλΠϛϯάͰmasterʹೖΔ
    “What's cooking in git.git”ϝʔϧ

    View full-size slide

  20. ·ͱΊ
    githubͷPRϕʔεͷ։ൃͱ͸ҧ͏
    ৭ʑࣗಈԽ͞Ε͍ͯΔͷͰ׳ΕΕ͹ָ
    ίϚϯυϥΠϯ, ΤσΟλ, ϝʔϥʔ
    GitʹԸฦ͠ :)

    View full-size slide