Skip to content

Instantly share code, notes, and snippets.

@LeifW
Created January 24, 2016 06:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeifW/f973c0b7f123a5d94306 to your computer and use it in GitHub Desktop.
Save LeifW/f973c0b7f123a5d94306 to your computer and use it in GitHub Desktop.
What I've been able to figure out of the gitlib API so far.
{-# Language OverloadedStrings #-}
import Git
import Git.Libgit2 (lgFactory)
import Data.Tagged
gitStuff = do
Just ref <- resolveReference "HEAD"
commit <- lookupCommit $ Tagged ref
history <- lookupCommitParents commit
return commit
main = do
headCommit <- withRepository lgFactory "." gitStuff
print $ commitAuthor headCommit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment