Tim Pettersen @kannonboy @kannonboy What do the following have in - - PDF document

tim pettersen kannonboy kannonboy what do the following
SMART_READER_LITE
LIVE PREVIEW

Tim Pettersen @kannonboy @kannonboy What do the following have in - - PDF document

4/24/13 Git as a Platform | by @kannonboy Tim Pettersen @kannonboy @kannonboy What do the following have in common? Homebrew Flashbake Ticgit The German legislature This presentation localhost:8000 1/30 4/24/13 Git as a Platform | by


slide-1
SLIDE 1

4/24/13 Git as a Platform | by @kannonboy localhost:8000 1/30

Tim Pettersen @kannonboy @kannonboy What do the following have in common? Homebrew Flashbake Ticgit The German legislature This presentation

slide-2
SLIDE 2

4/24/13 Git as a Platform | by @kannonboy localhost:8000 2/30

Git

AS A PLATFORM

Homebrew Flashbake Ticgit Bundestag Gesetze

AS A PLATFORM

slide-3
SLIDE 3

4/24/13 Git as a Platform | by @kannonboy localhost:8000 3/30

slide-4
SLIDE 4

4/24/13 Git as a Platform | by @kannonboy localhost:8000 4/30

slide-5
SLIDE 5

4/24/13 Git as a Platform | by @kannonboy localhost:8000 5/30

# turn on console coloring # turn on console coloring $ git config --global color.ui auto $ git config --global color.ui auto $ git diff $ git diff

  • 50 shades of Puce
  • 50 shades of Puce

+ 50 shades of Grey + 50 shades of Grey $ git diff --color-words $ git diff --color-words 50 shades of 50 shades of Eggshell EggshellGrey Grey

slide-6
SLIDE 6

4/24/13 Git as a Platform | by @kannonboy localhost:8000 6/30

$ git diff | /git/contrib/diff-highlight $ git diff | /git/contrib/diff-highlight

  • 50 shades of
  • 50 shades of Charcoal

Charcoal + 50 shades of + 50 shades of Grey Grey

slide-7
SLIDE 7

4/24/13 Git as a Platform | by @kannonboy localhost:8000 7/30

slide-8
SLIDE 8

4/24/13 Git as a Platform | by @kannonboy localhost:8000 8/30

slide-9
SLIDE 9

4/24/13 Git as a Platform | by @kannonboy localhost:8000 9/30

$ git log $ git log

commit 28cfdb2 commit 28cfdb2 Author: Alice Author: Alice Date: Date: Sat Apr 13 19:36:20 2013 -0700 Sat Apr 13 19:36:20 2013 -0700 Add new DNS servers Add new DNS servers commit b3f4cb7 commit b3f4cb7 Author: Bob Author: Bob Date: Date: Mon Apr 8 11:27:12 2013 -0700 Mon Apr 8 11:27:12 2013 -0700 QoS policy change for new teleconferencing rig QoS policy change for new teleconferencing rig commit f83a30f commit f83a30f Author: Alice Author: Alice Date: Date: Fri Apr 5 09:36:20 2013 -0700 Fri Apr 5 09:36:20 2013 -0700

slide-10
SLIDE 10

4/24/13 Git as a Platform | by @kannonboy localhost:8000 10/30

Initial router config Initial router config

$ git rev-list --until="2 weeks ago" -1 master $ git rev-list --until="2 weeks ago" -1 master

b5ead008952785fb5a95cae2e3a2de0898fc96a7 b5ead008952785fb5a95cae2e3a2de0898fc96a7

$ git cat-file -p b5ead00:config.yml $ git cat-file -p b5ead00:config.yml

DNS: DNS:

  • 192.168.1.19
  • 192.168.1.19
  • 192.168.1.27
  • 192.168.1.27

Access control: Access control: bob: 28cfdb2== bob: 28cfdb2== alice: b3f4cb7== alice: b3f4cb7== eve: f83a30f== eve: f83a30f== ... ...

$ git bisect start $ git bisect start $ SHA="$(git rev-list -1 --until="2012-10-24" master)" $ SHA="$(git rev-list -1 --until="2012-10-24" master)" $ git bisect good $SHA $ git bisect good $SHA $ git bisect bad $ git bisect bad

Bisecting: 12 revisions left to test after this Bisecting: 12 revisions left to test after this [93bf9a4..] QoS policy change for teleconferencing [93bf9a4..] QoS policy change for teleconferencing $ git bisect good $ git bisect good Bisecting: 6 revisions left to test after this Bisecting: 6 revisions left to test after this [93bf9a4..] Add new DNS servers [93bf9a4..] Add new DNS servers $ git bisect bad $ git bisect bad ... ...

slide-11
SLIDE 11

4/24/13 Git as a Platform | by @kannonboy localhost:8000 11/30

$ git bisect run network_test.sh $ git bisect run network_test.sh

slide-12
SLIDE 12

4/24/13 Git as a Platform | by @kannonboy localhost:8000 12/30

SSH HTTP/S NFS

slide-13
SLIDE 13

4/24/13 Git as a Platform | by @kannonboy localhost:8000 13/30

Rewriting history Deleting history Impersonating authors

$ git log --oneline $ git log --oneline

slide-14
SLIDE 14

4/24/13 Git as a Platform | by @kannonboy localhost:8000 14/30

28cfdb2 28cfdb2 Add new DNS servers Add new DNS servers b3f4cb7 b3f4cb7 QoS policy change for teleconferencing QoS policy change for teleconferencing f83a30f f83a30f Initial router config Initial router config

slide-15
SLIDE 15

4/24/13 Git as a Platform | by @kannonboy localhost:8000 15/30

slide-16
SLIDE 16

4/24/13 Git as a Platform | by @kannonboy localhost:8000 16/30

fe13251... 61abedd... ee4198f... afe781a... edad288... cafebab... 472deff671ab8e7b3139

slide-17
SLIDE 17

4/24/13 Git as a Platform | by @kannonboy localhost:8000 17/30

Hash Collision "Unlikely"

slide-18
SLIDE 18

4/24/13 Git as a Platform | by @kannonboy localhost:8000 18/30

slide-19
SLIDE 19

4/24/13 Git as a Platform | by @kannonboy localhost:8000 19/30

$ cat .git/config $ cat .git/config [receive] [receive] # no rewriting history # no rewriting history denyNonFastForwards = true denyNonFastForwards = true # no deleting history # no deleting history denyDeletes = true denyDeletes = true # check object consistency # check object consistency fsckObjects = true fsckObjects = true

$ git commit -m "I'm Tim" $ git commit -m "I'm Tim" $ git commit --author "Elvis <elvis@graceland.net>" \ $ git commit --author "Elvis <elvis@graceland.net>" \

  • m "I'm elvis"
  • m "I'm elvis"

commit a9f0967cba236465d6cb68247.. commit a9f0967cba236465d6cb68247.. Author: Elvis <elvis@graceland.net> Author: Elvis <elvis@graceland.net> Date: Mon Apr 22 18:06:35 2013 -0500 Date: Mon Apr 22 18:06:35 2013 -0500 I'm Elvis I'm Elvis commit d6eb7572cbb4bdd8e2aaa5c90.. commit d6eb7572cbb4bdd8e2aaa5c90.. Author: Tim Pettersen <tim@atlassian.com> Author: Tim Pettersen <tim@atlassian.com> Date: Mon Apr 22 18:04:54 2013 -0500 Date: Mon Apr 22 18:04:54 2013 -0500 I'm Tim I'm Tim

slide-20
SLIDE 20

4/24/13 Git as a Platform | by @kannonboy localhost:8000 20/30

GPG

slide-21
SLIDE 21

4/24/13 Git as a Platform | by @kannonboy localhost:8000 21/30

# sign a tag # sign a tag $ git tag -s config-051020131357 -m \ $ git tag -s config-051020131357 -m \ 'Config (deployed) at 05-10-2013 13:57' 'Config (deployed) at 05-10-2013 13:57' # display tag details (and pgp signature) # display tag details (and pgp signature) $ git show config-051020131357 $ git show config-051020131357

slide-22
SLIDE 22

4/24/13 Git as a Platform | by @kannonboy localhost:8000 22/30

# verify a signed tag # verify a signed tag $ git tag -v config-051020131357 $ git tag -v config-051020131357

gpg: Signature made Wed Sep 13 02:08:25 2006 PDT gpg: Signature made Wed Sep 13 02:08:25 2006 PDT gpg: using DSA key ID F3119B9A gpg: using DSA key ID F3119B9A gpg: Can’t check signature: gpg: Can’t check signature: public key not found public key not found error: could not verify the tag ’config-051020131357’ error: could not verify the tag ’config-051020131357’

slide-23
SLIDE 23

4/24/13 Git as a Platform | by @kannonboy localhost:8000 23/30

slide-24
SLIDE 24

4/24/13 Git as a Platform | by @kannonboy localhost:8000 24/30

$ gpg -k $ gpg -k

pub 2048R/ pub 2048R/1D9F4D2E 1D9F4D2E 2013-04-17 2013-04-17 uid Tim Pettersen (Test Key) <test@example.com> uid Tim Pettersen (Test Key) <test@example.com>

$ gpg -a --export $ gpg -a --export 1D9F4D2E 1D9F4D2E

  • ----BEGIN PGP PUBLIC KEY BLOCK-----
  • ----BEGIN PGP PUBLIC KEY BLOCK-----

Version: GnuPG v1.4.13 (Darwin) Version: GnuPG v1.4.13 (Darwin) mQENBFFu6b0BCADp53qN... mQENBFFu6b0BCADp53qN...

  • ----END PGP PUBLIC KEY BLOCK-----
  • ----END PGP PUBLIC KEY BLOCK-----

$ gpg -a --export $ gpg -a --export 1D9F4D2E 1D9F4D2E | | git hash-object -w --stdin git hash-object -w --stdin

2f44577acd4c72f72cdea1685210df4fd0381f7f 2f44577acd4c72f72cdea1685210df4fd0381f7f

slide-25
SLIDE 25

4/24/13 Git as a Platform | by @kannonboy localhost:8000 25/30

$ git tag tims-key 2f44577 $ git tag tims-key 2f44577 $ git cat-file -p tims-key $ git cat-file -p tims-key

  • ----BEGIN PGP PUBLIC KEY BLOCK-----
  • ----BEGIN PGP PUBLIC KEY BLOCK-----

Version: GnuPG v1.4.13 (Darwin) Version: GnuPG v1.4.13 (Darwin) mQENBFFu6b0BCADp53qN... mQENBFFu6b0BCADp53qN...

  • ----END PGP PUBLIC KEY BLOCK-----
  • ----END PGP PUBLIC KEY BLOCK-----

# fetch tags from server # fetch tags from server $ git fetch $ git fetch # read key blob into gpg keychain # read key blob into gpg keychain $ git cat-file -p tims-key | $ git cat-file -p tims-key | gpg --import gpg --import # re-verify tag # re-verify tag $ git tag -v config-051020131357 $ git tag -v config-051020131357

gpg: Signature made using DSA key ID 1D9F4D2E gpg: Signature made using DSA key ID 1D9F4D2E gpg: gpg: Good signature Good signature from "Tim P from "Tim P " "

slide-26
SLIDE 26

4/24/13 Git as a Platform | by @kannonboy localhost:8000 26/30

Traceability Integrity Security But I heard that Git sucks at..

MASSIVE FILES

# add some normally tracked files # add some normally tracked files $ git add java/src $ git add java/src # annex some large files # annex some large files $ git annex add lib $ git annex add lib $ git annex add image $ git annex add image # resolve annex symlinks from remotes # resolve annex symlinks from remotes $ git annex get . $ git annex get .

But I heard that Git sucks at..

slide-27
SLIDE 27

4/24/13 Git as a Platform | by @kannonboy localhost:8000 27/30

BINARY FILES

$ git diff $ git diff

diff --git a/test.pdf b/test.pdf diff --git a/test.pdf b/test.pdf index 666c1a6..f6c23cd 100644 index 666c1a6..f6c23cd 100644 Binary files a/test.pdf and b/test.pdf differ Binary files a/test.pdf and b/test.pdf differ

# create a filter named 'pdf' for pdfs # create a filter named 'pdf' for pdfs $ cat .gitattributes $ cat .gitattributes

*.pdf pdf *.pdf pdf

# specify a pdf to text converter # specify a pdf to text converter $ cat .git/config $ cat .git/config

[diff "pdf"] [diff "pdf"] textconv = pdftohtml -stdout textconv = pdftohtml -stdout

slide-28
SLIDE 28

4/24/13 Git as a Platform | by @kannonboy localhost:8000 28/30

$ git diff $ git diff

diff --git a/test.pdf b/test.pdf diff --git a/test.pdf b/test.pdf index 666c1a6..f6c23cd 100644 index 666c1a6..f6c23cd 100644

  • -- a/test.pdf
  • -- a/test.pdf

+++ b/test.pdf +++ b/test.pdf

  • removed content..
  • removed content..
  • removed content..
  • removed content..
  • removed content..
  • removed content..

+ added content.. + added content.. + added content.. + added content.. + added content.. + added content..

Leveraging Git Use Git

slide-29
SLIDE 29

4/24/13 Git as a Platform | by @kannonboy localhost:8000 29/30

Use an alternative Use

slide-30
SLIDE 30

4/24/13 Git as a Platform | by @kannonboy localhost:8000 30/30 loading

Use a hybrid solution Can't git enough? atlassian.com/git atlassian.com/git Scott Chacon's Pro Git Pro Git & Git Git Peepcode Peepcode @kannonboy @kannonboy tpettersen.bitbucket.org/talk/git-as- tpettersen.bitbucket.org/talk/git-as- a-platform a-platform