Last active
August 29, 2015 14:15
-
-
Save craigrbruce/944c237603b48a2c5e7b to your computer and use it in GitHub Desktop.
Using LibGit2Sharp without the pain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#r "/Users/craig/Projects/gitsharp/LibGit2Sharp.0.21.0.176/lib/net40/LibGit2Sharp.dll" | |
open LibGit2Sharp | |
//plonk the native dll here | |
System.Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ | |
let printer (c: Commit) = | |
sprintf "User %s" c.Author.Email |> ignore | |
let filter = new CommitFilter(); | |
filter.Since <- "Tag1"; | |
filter.Until <- "Tag2"; | |
let repo = new Repository("/Users/craig/Projects/crazy-repo") | |
repo.Commits.QueryBy(filter) |> Seq.iter printer | |
//or some other filter | |
repo.Commits |> Seq.filter (fun x -> x.Committer.Email = "[email protected]") |> Seq.iter printer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment