Revision parsing

  • Repository.revparsesingle(_revision) → Object
  • Find an object, as specified by a revision string. Seeman gitrevisions, or the documentation for git rev-parse forinformation on the syntax accepted.

You can use any of the fancy <rev> forms supported by libgit2:

  1. >>> commit = repo.revparse_single('HEAD^')