<commit_before># SwiftGit2
Swift bindings to [libgit2](https://github.com/libgit2/libgit2).

```swift
let URL: NSURL = ...
let repo = Repository.atURL(URL)
if let repo = repo.value {
    let latestCommit: Result<Commit, NSError> = repo
        .HEAD()
        .flatMap { repo.commitWithOID($0.oid) }
    if let commit = latestCommit.value {
        println("Latest Commit: \(commit.message) by \(commit.author.name)")
    } else {
        println("Could not get commit: \(latestCommit.error)")
    }
} else {
    println("Could not open repository: \(repo.error)")
}
```

SwiftGit2 requires Xcode 6.3ß2 or later.

## Design
SwiftGit2 uses value objects wherever possible. That means using Swift’s `struct`s and `enum`s without holding references to libgit2 objects. This has a number of advantages:<commit_msg>We just say Xcode 6.3<commit_after># SwiftGit2
Swift bindings to [libgit2](https://github.com/libgit2/libgit2).

```swift
let URL: NSURL = ...
let repo = Repository.atURL(URL)
if let repo = repo.value {
    let latestCommit: Result<Commit, NSError> = repo
        .HEAD()
        .flatMap { repo.commitWithOID($0.oid) }
    if let commit = latestCommit.value {
        println("Latest Commit: \(commit.message) by \(commit.author.name)")
    } else {
        println("Could not get commit: \(latestCommit.error)")
    }
} else {
    println("Could not open repository: \(repo.error)")
}
```

SwiftGit2 requires Xcode 6.3 or later.

## Design
SwiftGit2 uses value objects wherever possible. That means using Swift’s `struct`s and `enum`s without holding references to libgit2 objects. This has a number of advantages:
{'fraction_non_alphanumeric': 0.12607626076260764, 'fraction_numerical': 0.014145141451414513, 'mean_word_length': 3.46978021978022, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2784213', 'n_tokens_mistral': 537, 'n_tokens_neox': 507, 'n_words': 159}