2
I’m trying to mine some Git data, I need to know how many commits the X file is in and if in those commits I have a keyword for a list. I’m using the following command:
git log --all --grep fix --follow Freak.php
Currently it only searches for the keyword fix
, need to make it possible to search for more than one keyword in the command, for example, for fix
OR error
. How can I do that?
PS¹: I’ve seen about the command git grep
, it does not help me because it returns a very messy result, I need something cleaner to capture with Symfony Process.
PS²: as I am using the Symfony Process, I have already tried to put one foreach
to execute the X command by changing the keyword each time I run, but the process slows down.
It doesn’t work like that. Documentation is from the command
git grep
, in case use thegit log
. I tried here and I made the mistake: fatal: ambiguous argument 'SEGUNDASTRING': Unknown Revision or path not in the Working Tree.– Leonardo
Try something like git log --grep='fix' -or --grep='SEGUNDASTRING' try with and without '@Leonardovilarinho
– Luiz Santos
I got it this way:
git log --all --grep='fix' --grep='commit' --follow Freak.php
.– Leonardo
Coming on a PC I edit my answer
– Luiz Santos