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
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
150
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
0
540
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
270
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
340
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
190
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
140
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
430
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
2
1.3k
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
200
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
260
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
430
5分で問診!Composer セキュリティ健康診断
codmoninc
0
700
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
250
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
230
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Practical Orchestrator
shlominoach
191
11k
sira's awesome portfolio website redesign presentation
elsirapls
0
310
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
230
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
750
Mobile First: as difficult as doing things right
swwweet
225
10k
How to build a perfect <img>
jonoalderson
1
5.8k
Thoughts on Productivity
jonyablonski
76
5.3k
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/