Pick up commits with keywords

Asked

Viewed 78 times

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.

1 answer

1


  • It doesn’t work like that. Documentation is from the command git grep, in case use the git log. I tried here and I made the mistake: fatal: ambiguous argument 'SEGUNDASTRING': Unknown Revision or path not in the Working Tree.

  • Try something like git log --grep='fix' -or --grep='SEGUNDASTRING' try with and without '@Leonardovilarinho

  • 1

    I got it this way: git log --all --grep='fix' --grep='commit' --follow Freak.php.

  • Coming on a PC I edit my answer

Browser other questions tagged

You are not signed in. Login or sign up in order to post.