
.. include:: <s5defs.txt>


===========
Todo cambia
===========

Usando git como sistema de control de versiones
-----------------------------------------------

:Autor: Alberto Bertogli <albertito@gmail.com>
:Fecha: Viernes 26/Octubre/2007

.. |bullet| unicode:: U+02022
.. footer:: Facultad de Ingenería - UBA |bullet| 26/Octubre/2007


Introducción
============

- Charlas irregulares del LUGFI + Herramientas Open Source
- Preguntas y comentarios *inline*
- No es un curso ni un tutorial
- Comandos distribuidos entre slides
- | Otras charlas: Linus Torvalds y Randal Schwartz
  | :small:`(cualquier parecido es pura coincidencia)`


Historia
========

- Creado por Linus Torvalds en Abril/2005
- Junio Hamano maintainer desde Julio/2005
- 1.0.0 en Diciembre/2005
- 1.5.0 en Febrero/2007


Características generales
=========================

- Distribuido
- Comunidad muy activa
- Alta performance
- Robusto
- Flexible
- Muchas herramientas
- Interoperabilidad con otros SCMs


VCSs distribuidos
=================

- No hay un único repositorio central
- Cada copia del repositorio es un repositorio independiente
- No hay necesidad de "commit access"
- Trabajo en paralelo
- Merges muy frecuentes
- Peer review
- La historia del repositorio importa
- Prolijidad => mantenibilidad


Comunidad
=========

- http://git.or.cz / http://git-scm.org
- http://wiki.git-scm.org
- Git mailing list git@vger.kernel.org
- #git en irc.freenode.org


Performance
===========

- | Orientado a proyectos grandes con altas tasas de cambio.
  | :small:`Linux kernel 23..24-rc1: 14 dias, 754 personas, 7132 patches, 183
    merges`
- | Todas las operaciones comunes < 2s (log, status, diff, commit, merge)
  | :small:`log: 0.0s; status: 0.5s; diff vacio: 0.1s, 227 f: 0.4s`
- | Eficiente en espacio: checkout < .git
  | :small:`checkout 303Mb, .git 214Mb; 72464 cambios, 920 dias (72/dia)`


Interoperabilidad
=================

- Patches!
- Dos vias:
   - git svn
   - git cvsserver
- Una via:
   - Internos: svnimport, cvsimport, archimport, quiltimport, p4import
   - Externos: hg-to-git, darcs2git, tailor (bzr, monotone)


Object store I
==============

- Filesystem direccionable por contenido (SHA1)
- Tipos de objetos:
   - Blobs
   - Trees
   - Commits
   - Tags
- DAGs == dibujitos lindos!


Object store II: Commits y refs
================================

:big:`¡A dibujar!`

- branches
- tags
- ¿Y los renames?
- reflog
- | rev-parse
  | :small:`master~2, master\@{yesterday}, b1..master, ...`


Object store III: Propiedades
=============================

- Integridad en cadena
- Practicamente "append only"
- Historia criptograficamente segura en 40 bytes
- GC (75.31!)
- Eficiencia en tiempo y espacio
- Manipulacion simple
- Easy branching


Index
=====

- Transparente en la mayoria de las operaciónes
- Etapa intermedia entre el working directory y el object store
- "Lo que vamos a commitear"
- diff, diff --cached, diff HEAD


Pre-comandos
============

- Todos documentados:
   - git help comando
   - git comando --help
- Bajo nivel (plumbing) vs. alto nivel (porcelain)
- ¡Ojo con no reescribir la historia de repos publicos!
- git config


Comandos básicos I
==================

- git init
- ed zaraza
- git commit -a || git add .; git commit || git gui
- git log || gitk

----------------

- git status
- git diff
- git checkout
- git reset [--hard]
- git blame [-M -C]
- git revert


Comandos básicos II
===================

- git clone
- git pull
- git remote

----------------

- git clone --bare + git push

----------------

- git gc


Branching y merging
===================

- git checkout -b feature-x master
- git branch -a
- git checkout master
- gitk feature-x..
- git merge feature-x
   - gitk --merge
   - git mergetool


Comandos copados I
==================

- git log -S"add_bug('muejejejeje')" /src/backend
- git show branch1:README
- git checkout 934fa32
- git grep -e "filtro" master\@{2.hours.ago}


Comandos copados II
===================

- git bisect
- git merge --squash
- git cherry-pick
- git stash
- git rebase
- git rebase -i
- git filter-branch


Otras herramientas
==================

- http://git.or.cz/gitwiki/InterfacesFrontendsAndTools
- gitweb/cgit
- stgit/guilt
- tig/qgit/gitview/giggle
- vim/emacs/eclipse/...
- http://repo.or.cz


Gracias
=======

Preguntas, y a cenar!

