Finding commits in history
You already saw in the previous recipe how we can filter the output of git log
to only list commits with the string "Bug: "
in the commit message. In this example, we will use the same technique to find specific commits in the entire history.
Getting ready
Again, we will use the JGit repository, trying to find commits related to the keyword "Performance"
. In this recipe, we will look through the entire history, so we don't need the master branch to point to a specific commit.
How to do it...
As we tried earlier, we can use the --grep
option to find specific strings in commit messages. In this recipe, we look at the entire history and search every commit that has "Performance"
in its commit message:
$ git log --grep "Performance" --oneline --all 9613b04 Merge "Performance fixes in DateRevQueue" 84afea9 Performance fixes in DateRevQueue 7cad0ad DHT: Remove per-process ChunkCache d9b224a Delete DiffPerformanceTest e7a3e59 Reuse DiffPerformanceTest support code to...