Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Created February 10, 2015 04:00
Show Gist options
  • Save PuercoPop/a4b43da1fb9e28f001e1 to your computer and use it in GitHub Desktop.
Save PuercoPop/a4b43da1fb9e28f001e1 to your computer and use it in GitHub Desktop.

Preambulo

Show me your code and conceal your data structures, and I shall continue to be
mystified. Show me your data structures, and I won't need your code.

TL;DR.

  • Base de datos llave-valor donde la llave es el SHA1 del objeto.
  • 4 tipos de objetos blob, tree, commit y tag
  • Las referencias estan en el directorio .git/refs/
  • Por ejemplo .git/refs/heads/ o .git/refs/remotes/origin

La Carne

Blob

git cat-file -p a6443f6374e2f3d01428b34f5fe5995aad821ad4

#+RESULTS

Tree

git cat-file -p c128c4eb610f237215632ca152e13dfe3b555963

Commit

git cat-file -p cf0bb96e8dd3c93a113d13edb170a1e793b4f46e

Tag

The tag object is very much like a commit object – it contains a tagger, a date, a message, and a pointer. The main difference is that a tag object generally points to a commit rather than a tree
git cat-file -p c92ab76574cb7ed2b1db4d4778f38deda9cbd752

Caveat

Para evitar llegar al limite de 31998 subdirectorios por directorio de ext3, las dos primeras letras del hash en base64 son un directorio.

Advantages

  • No content duplication

Disadvantages

  • Oblivious to Rename

Irmin

“Irmin is a library for persistent stores with built-in snapshot, branching and reverting mechanisms. It is designed to use a large variety of backends.”

ELI5

Una interfaz de Git db.

Varios backends

  • In-memory Database
  • Git-repo filesystem
  • filesystem
  • REST API

Ventajas

  • Persistencia
  • Historial del estado del ‘objeto’
  • Transacciones con operaciones ‘merge’ a medida
  • Visualizar el historial con herramientas hechas para git (e.j. gitk)

Enlaces de intereses

Fin

¿Preguntas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment