Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Git and GitHub at YAPC:Asia
Search
Andy Delcambre
August 30, 2014
Programming
3.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Git and GitHub at YAPC:Asia
Andy Delcambre
August 30, 2014
More Decks by Andy Delcambre
See All by Andy Delcambre
Git, GitHub, Etc
adelcambre
3
260
Systems Programming - SoCoded 2013
adelcambre
2
200
Ruby Systems Programming
adelcambre
4
1.2k
Debugging Production Service Oriented Systems
adelcambre
3
450
Ruby, Rails and Engine Yard - Úll
adelcambre
1
340
SFRuby Nov 2011 - Release Early and Release Often
adelcambre
2
97
Release early and Release often
adelcambre
2
560
Other Decks in Programming
See All in Programming
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
630
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
120
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
820
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
270
dRuby over BLE
makicamel
2
400
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
570
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
1k
コンテキストの使い捨てをやめる — ビジネスルール駆動開発と miko —
ioki
0
260
Performance Engineering for Everyone
elenatanasoiu
0
250
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
140
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.1k
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
210
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
220
The SEO identity crisis: Don't let AI make you average
varn
0
510
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
How to train your dragon (web standard)
notwaldorf
97
6.7k
The Curious Case for Waylosing
cassininazir
1
420
The Cost Of JavaScript in 2023
addyosmani
55
10k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
380
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
480
Transcript
Andy Delcambre sadelcambre
None
YAPC:Asia
I don’t write Perl
I rarely write Perl
Total source lines grouped by language: ! ruby: 316613 (98.99%)
sh: 2268 (0.71%) ansic: 743 (0.23%) perl: 179 (0.06%) python: 31 (0.01%)
None
None
DIRECTED ACYCLIC GRAPH
$ git log commit b3f13c1 Author: Andy Delcambre Date: Thu
Aug 28 08:29 2014 ! Commit 3 ! commit c79e797 Author: Andy Delcambre Date: Thu Aug 28 08:29 2014 ! Commit 2 ! commit 9a42679 Author: Andy Delcambre Date: Thu Aug 28 08:28 2014 ! Initial commit commit b3f13c1 Commit 3 commit c79e797 Commit 2 commit 9a42679 Initial commit HEAD
$ git cat-file -p b3f13c1 tree 9e68447 parent c79e797 author
Andy Delcambre 1409182168 committer Andy Delcambre 1409182168 ! Commit 3 commit b3f13c1 Commit 3 tree 9e68447 commit c79e797 Commit 2 Parent
$ git cat-file -p 9e68447 100644 blob b465ded README.md commit
b3f13c1 Commit 3 tree 9e68447 commit c79e797 Commit 2 Parent blob 9e68447 README.md
$ git cat-file -p b465ded # Test ! A test
repo, for YAPC:Asia. commit b3f13c1 Commit 3 tree 9e68447 commit c79e797 Commit 2 Parent blob 9e68447 README.md # Test ! A test repo, for YAPC:Asia.
GitHub
Hosting a Git repo is Secret: EASY
enzo $ git init --bare demo.git Initialized empty Git repo
in /home/adelcambre/git/demo.git/ ! yt $ git remote add origin adelcambre@enzo:git/demo.git yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To adelcambre@enzo:git/demo.git * [new branch] master -> master ! yt $ git clone adelcambre@enzo:git/demo.git Cloning into 'demo'... remote: Counting objects: 6, done. remote: Compressing objects: 100% (2/2), done. remote: Total 6 (delta 0), reused 0 (delta 0) Receiving objects: 100% (6/6), done.
None
yt $ git remote add -f origin
[email protected]
:adelcambre/demo.git Updating origin
From github.com:adelcambre/demo * [new branch] master -> origin/master ! yt $ git push origin master Counting objects: 6, done. Delta compression using up to 8 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (6/6), 473 bytes, done. Total 6 (delta 0), reused 6 (delta 0) To https://github.com/adelcambre/demo.git * [new branch] master -> master
None
None
Hosting a *lot* of Git repos is Not so Secret:
HARD
> 7 million repositories
1.5 million pushes
100 million pulls & clones
27 fileservers
100 TB of online storage
None
Grit
1st Commit GitHub 1st Commit Grit
Ruby wrapper around Git
repo = Grit::Repo.new(“grit.git”) ! repo.commits # => [#<Grit::Commit "e80bbd2ce67651aa18e57fb0b43618ad4baf7750">, #<Grit::Commit
"91169e1f5fa4de2eaea3f176461f5dc784796769">, #<Grit::Commit "038af8c329ef7c1bae4568b98bd5c58510465493">, #<Grit::Commit "40d3057d09a7a4d61059bca9dca5ae698de58cbe">, #<Grit::Commit "4ea50f4754937bf19461af58ce3b3d24c77311d9">]
This works for everything! ! (locally)
27 fileservers
Smoke “Grit in the cloud”
The Internet Chimney fs102 fs103 fs104 fs105 … fe102 fe103
fe104 fe105 …
module Smoke def self.install! ::Grit.send(:remove_const, :Git) ! ::Grit.const_set(:Git, Smoke::Git) end
end
ls_tree("HEAD").each do |entry| if entry.blob? load_blob(entry.oid) end end
Death by Round Trip
A condensed (and probably wrong) history of git
Bitkeeper
Git
Shared library?
libgit2
JGit
libgit2 http://github.com/libgit2/libgit2
Rugged http://github.com/libgit2/rugged
Ruby wrapper around libgit2
repo = Rugged::Repository.new("rugged.git") ! repo.last_commit # => #<Rugged::Commit:2227356240 oid: 0277b7df0fea08d5f3fc7177e47527fc24d96a0e>
Perl
Git-Raw https://metacpan.org/release/Git-Raw
None
GitRPC The New Hotness aka
Like Smoke, But Better
Caching
Pluggable Wire Protocols
Encoding Aware
GIT(1) Git Manual GIT(1) ! NAME git - the stupid
content tracker
GIT(1) Git Manual GIT(1) ! NAME git - the stupid
content tracker
Git doesn’t care about encodings
Smoke doesn’t either
GitRPC is encoding aware
Detect and tag as soon as possible
The Switch
class Repository def git Smoke::Repo.new(path) end ! def rpc GitRPC.new(path)
end end
None
Graphite
Graph Every Call Both GitRPC and Smoke
1 Year ago
None
None
None
Where are we today?
None
None
None
Good Progress But not done yet
Finding the Final 0.1%
Backscatter
Call Counting
def git backscatter_measure Smoke::Repo.new(path) end
None
Method Tracing
def git backscatter_trace 20 Smoke::Repo.new(path) end
None
Recap
Run both concurrently
Measure Everything
Use tracing to find the last 0.1%
Andy Delcambre sadelcambre
Further Reading Git for Computer Scientists http://eagain.net/articles/git-for-computer-scientists/ My mom told
me git doesn’t scale https://vimeo.com/64716825 How GitHub uses GitHub to build Github http://zachholman.com/talk/how-github-uses-github-to-build-github/