commit: add "lookup_commit_reference()" helper function