Achilleas Koutsou há 5 anos atrás
pai
commit
f8ff89826b
2 ficheiros alterados com 53 adições e 0 exclusões
  1. 20 0
      demoscript
  2. 33 0
      slides.md

+ 20 - 0
demoscript

@@ -258,6 +258,26 @@ replace "::gitcatsrdmb::" "${gitcatsrdmb}"
 gitcatprdmb=$(mdprint git cat-file -p HEAD~1:README.md)
 replace "::gitcatprdmb::" "${gitcatprdmb}"
 
+ospregc=$(mdprint find .git/objects -type f)
+replace "::ospregc::" "${ospregc}"
+
+osdupre=$(mdprint du -s .git/objects)
+replace "::osdupre::" "${osdupre}"
+
+gitgc=$(mdprint git gc)
+replace "::gitgc::" "${gitgc}"
+
+ospostgc=$(mdprint find .git/objects -type f)
+replace "::ospostgc::" "${ospostgc}"
+
+osdupost=$(mdprint du -s .git/objects)
+replace "::osdupost::" "${osdupost}"
+
+apack=$(find .git/objects -type f -iname "*.pack" | head -n1)
+verifypack=$(mdprint git verify-pack -v ${apack})
+
+replace "::verifypack::" "${verifypack}"
+
 exit
 
 # ---------------

+ 33 - 0
slides.md

@@ -1041,4 +1041,37 @@ We've seen so far that git keeps snapshots of the tree every time we commit. If
 ::gitcatsrdmb::
 ::gitcatprdmb::
 
+Note:
+The two versions of README are the full file. We can even see it from the size. This can become wasteful when projects grow to thousands lines of code. It probably wont create a storage problem, but it's certainly inefficient.
+
+---
+
+`git gc`
+
+- Cleanup unnecessary files and optimize the local repository
+
 ---
+
+::ospregc::
+
+::osdupre::
+
+Note:
+Let's have a look at the object store as it is now
+
+---
+
+::gitgc::
+::ospostgc::
+::osdupost::
+
+Note:
+Run the gc command (garbage collector) to optimise the storage and check the store again
+
+---
+
+::verifypack::
+
+---
+
+This is done automatically on occasion, so you don't need to worry about running `gc` manually.