The most recent commit whose commit message contains "foo" is spelled :/foo
, as in:
git show :/foo
How does one refer to the parent of that commit? :/foo^
is incorrect; that results in:
fatal: ambiguous argument ':/foo^': unknown revision or path not in the working tree.
The only thing I've been able to come up with so far is using the output of git rev-parse
:
git show $(git rev-parse :/foo)^
...which works, but seems needlessly complex.