You can use the command git log --grep=<message>. part of the message will work. After the match, you will see the details of the commit.
Example:
git log --grep='pull/122/commits'
Executing this row of this repository does not return results, which means that this pull request is not yet merged.
You can check the command, for example, to see the results:
git log --oneline --grep='version'