Your SlideShare is downloading. ×
Leveraging the Git object store
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Leveraging the Git object store

1,145
views

Published on

Published in: Technology

2 Comments
1 Like
Statistics
Notes
No Downloads
Views
Total Views
1,145
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
2
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Leveraging the Git object store Ramkumar Ramachandra FOSS.IN/2010 16th December 2010Ramkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 1 / 11
  • 2. Outline 1 Part I: The background noise 2 Part II: A fast-import crash course 3 Part III: ConclusionRamkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 2 / 11
  • 3. Part I: The background noise Why is everyone obsessed with Git? bup gitFS TicGit gimd gollumRamkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 3 / 11
  • 4. Part I: The background noise The guts of Git git-pull.sh, git-rebase.sh Porcelain git-stash.sh, git-am.sh ls-tree.c, read-tree.c, Plumbing update-index.c, fsck.c UI layer rev-parse.c transport.c, transport-helper.c, Transport send-pack.c, receive-pack.c walker.c, tree-walk.c, Walkers diffcore-*.c pack-*.c, unpack-*.c Packing (.git/objects/pack/*) object.c, commit.c, tree.c, Object API blob.c, tag.c, refs.c Object store .git/objects/*Ramkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 4 / 11
  • 5. Part I: The background noise . . . and the guts of the object store tree blob commit sha1 d93bf sha1 ee53b sha1 1c88a #include "cache.h" size 144 #include "cache-tree.h" parents [] #include "tree.h" references to other trees, tree d93bf blobs ... #include "blob.h" #include "commit.h" date 100532.. (...) commit message, author, committer, encoding ... blob sha1 fe3da #!/bin/sh { commit cat <<EOF sayIt: sha1 be78a (...) parents [1c88a, ] tree tree 2d1fa sha1 2d1fa blob date 100547.. size 213 sha1 54a52 commit message, author, references to other trees, #!/bin/sh committer, encoding ... blobs ... # # Copyright (c) 2005 Junio # (...)Ramkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 5 / 11
  • 6. Part II: A fast-import crash course What does the protocol look like? commit refs/heads/remote-helper mark :30 author Ramkumar Ramachandra <artagnon@gmail.com> 1170314617 +0530 committer Junio C Hamano <gitster@pobox.com> 1170325891 +0100 data 111 vcs-svn: Fix delete operation in the treap from :28 M 100644 :29 vcs-svn/trp.h blob mark :31 data 4941 /* * C macro implementation of treaps. * * Usage: [...]Ramkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 6 / 11
  • 7. Part II: A fast-import crash course The concept of a remote helper Object store fast-import fast-export fetch import push Remote Network API Remote helper server transport-helper.c connect_helper get_importer get_exporter Git CoreRamkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 7 / 11
  • 8. Part II: A fast-import crash course The import-export machinery / trunk branches tags Node-path: commons/STATUS Node-kind: (file|dir) Node-action: (change|add|delete|replace) moo svn:log svn:author svn:date svn:executable svn:specialRamkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 8 / 11
  • 9. Part II: A fast-import crash course Bi-directional how? 1 Keep track of written blobs using marks 2 Fetch a previously written blob 3 Apply the delta 4 Write back the new blobRamkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 9 / 11
  • 10. Part III: Conclusion What you should hack on when you go home git-based fast-import things import-export gitcore machineryRamkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 10 / 11
  • 11. Part III: Conclusion Can I have these slides? Ramkumar Ramachandra artagnon@gmail.com http://artagnon.com Source: http://github.com/artagnon/foss.inRamkumar Ramachandra (FOSS.IN/2010) Leveraging the Git object store 16th December 2010 11 / 11