I have tried gitk $(git log -S" extreemly rare " --pretty=format:%h), as this answer suggests but gitk shows all commits in addition to the search results (if I can add anything to a universal set)
Initially, this came from this answer, that recommended gitk --all $(git log -S" rare text" --pretty=format:%h). I was advised to remove --all but this does not have any effect.
gitk typically can accept all the arguments you might give to git log. So for your case,
gitk -S" extremely rare "should show just the commits (plus their immediate parent) that match.It is equivalent to using the edit view dialog and entering your query into the "Search string" entry field.