¿Hay alguna manera de mostrar el git-diff filtrado por un patrón determinado?¿Cómo grep el git diff?
Algo así como
git grepdiff pattern
changed file
+++ some sentence with pattern
changed file 2
--- some other pattern
Por desgracia, la solución más simple no es lo suficientemente bueno
git diff | grep pattern
+++ some sentence with pattern
--- some other pattern
# not an option as doesn't put the filename close to the match
Vine con una solución usando awk
git diff | awk "/\+\+\+/{f = \$2}; /PATTERN/ {print f \$0} "
Pero encantaría descubrir que hay es un comando para esto.
Al parecer, el proyecto github llamado git-diff-grep hace algo completamente diferente. – Kuba