Skip to content

Instantly share code, notes, and snippets.

@andresmoschini
Last active September 6, 2019 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresmoschini/e4fd65ae093ce2fcd56a to your computer and use it in GitHub Desktop.
Save andresmoschini/e4fd65ae093ce2fcd56a to your computer and use it in GitHub Desktop.
Aplicando Git Bisect

Aplicando Git Bisect

Desde hace tiempo, cuando recién estaba investigando qué era Git, me llamo la atención el comando git bisect, pero siempre imaginé que sería dificil de aplicar y nunca se me ocurrió probarlo, hasta ahora.

El escenario

Trabajé en un feature branch, hice el Pull Request y recién luego (mal por mi) ejecuté los tests, que lamentablemente fallaron.

Los tests los corro con el siguiente comando:

$ dnx Doppler.HypermediaAPI.Tests test

Background

Como se usa Git Bisec

No entiendo como no lo hice antes, es bastante simple. La ayuda general puede encontrarse en http://git-scm.com/docs/git-bisect.

Lo que yo hice puntualmente fue:

$ git bisect start HEAD hypermedia-api
$ git bisect run dnx Doppler.HypermediaAPI.Tests test

Git se encargó de hacer una búsqueda binaria ejecutando mis tests e identificando el commit con problemas.

Results

@AlphaGit
Copy link

AlphaGit commented Jul 3, 2015

Es git el que ejecuta el comando cada vez? Y que espera exactamente, un código de salida distinto de cero?

@andresmoschini
Copy link
Author

Si, git ejecuta el comando y espera un resultado que no sea un error

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