Pass chunks rather than full text to _parse_commit_or_tag.
Simplify handling of message-like objects.
Move commit parsing into a separate function.