I want to programmatically determine whether a commit is in the git current checkout or not.
I just need a nonzero exit status, not other output.
I found this work around:
git log | grep -q 5bbfb3512b0ab900a66f70104bd0e052a66a699a
But this does not work 100% reliable. There could be a commit message which contains the string "5bbfb...".
Is there a solution without unix pipe and grep?