Skip to content

Commit 6b6629e

Browse files
committed
Adopting this project
I think the copyright changes are appropriate. Since it's MIT, We don't have to worry too much. Added a little story in the README to explain all that
1 parent 2ced14c commit 6b6629e

35 files changed

+103
-79
lines changed

.swiftformat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--binarygrouping none
22
--decimalgrouping none
33
--exclude Pods
4-
--header "Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details."
4+
--header "Copyright © 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details."
55
--hexgrouping none
66
--indent 2
77
--octalgrouping none
@@ -10,4 +10,4 @@
1010
--wraparguments beforefirst
1111
--wrapcollections beforefirst
1212
--self init-only
13-
--swiftversion 5.6
13+
--swiftversion 5.10

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [0.6.0] • 2024-05
4+
5+
Adopted by Ky as a starting point to make a Git package of their own
6+
7+
8+
39
## [0.5.0]
410

511
* **Breaking change** Fix strict Swift concurrency warnings. This required removing the `async` methods
@@ -26,4 +32,4 @@ from `Repository` and making them be extensions on `AsyncThrowingStream` and `Fe
2632

2733
## [0.1.0]
2834

29-
- First tagged version, used in two internal apps (Swift Ledger and Scriptorium)
35+
- First tagged version, used in two internal apps (Swift Ledger and Scriptorium)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Brian Dewey
3+
Copyright (c) 2024 Ky Leggiero
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Package.resolved

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,45 @@
1-
// swift-tools-version: 5.6
1+
// swift-tools-version: 5.10
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
7-
name: "AsyncSwiftGit",
8-
platforms: [.iOS(.v14), .macOS(.v11)],
9-
products: [
10-
// Products define the executables and libraries a package produces, and make them visible to other packages.
11-
.library(
12-
name: "AsyncSwiftGit",
13-
targets: ["AsyncSwiftGit", "Initializer"]
14-
),
15-
],
16-
dependencies: [
17-
.package(url: "https://github.com/bdewey/static-libgit2", from: "0.5.0"),
18-
.package(url: "https://github.com/apple/swift-log.git", from: "1.1.0"),
19-
],
20-
targets: [
21-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
22-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
23-
.target(
24-
name: "AsyncSwiftGit",
25-
dependencies: [
26-
"static-libgit2",
27-
"Initializer",
28-
.product(name: "Logging", package: "swift-log"),
29-
],
30-
swiftSettings: [
31-
// .unsafeFlags(["-warnings-as-errors"]),
32-
]
33-
),
34-
.target(name: "Initializer", dependencies: ["static-libgit2"]),
35-
.testTarget(
36-
name: "AsyncSwiftGitTests",
37-
dependencies: ["AsyncSwiftGit"],
38-
swiftSettings: [
39-
// .unsafeFlags(["-warnings-as-errors"]),
40-
]
41-
),
42-
]
7+
name: "SwiftLibgit2",
8+
platforms: [
9+
.iOS(.v14),
10+
.macOS(.v11)
11+
],
12+
products: [
13+
// Products define the executables and libraries a package produces, making them visible to other packages.
14+
.library(
15+
name: "SwiftLibgit2",
16+
targets: ["SwiftLibgit2", "Initializer"]),
17+
],
18+
dependencies: [
19+
.package(url: "https://github.com/bdewey/static-libgit2", from: "0.5.0"),
20+
.package(url: "https://github.com/apple/swift-log.git", from: "1.1.0"),
21+
],
22+
targets: [
23+
// Targets are the basic building blocks of a package, defining a module or a test suite.
24+
// Targets can depend on other targets in this package and products from dependencies.
25+
.target(
26+
name: "SwiftLibgit2",
27+
dependencies: [
28+
"static-libgit2",
29+
"Initializer",
30+
.product(name: "Logging", package: "swift-log"),
31+
],
32+
swiftSettings: [
33+
.unsafeFlags(["-warnings-as-errors"]),
34+
]
35+
),
36+
.target(name: "Initializer", dependencies: ["static-libgit2"]),
37+
.testTarget(
38+
name: "SwiftLibgit2Tests",
39+
dependencies: ["SwiftLibgit2"],
40+
swiftSettings: [
41+
// .unsafeFlags(["-warnings-as-errors"]),
42+
]
43+
),
44+
]
4345
)

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
# AsyncSwiftGit
2-
Provides Swift bindings to libgit2 that use the Swift 5.5 concurrency model
1+
# SwiftLibgit2
2+
3+
A modern, Swifty approach to interacting with Git
4+
5+
6+
7+
## Credit
8+
9+
This is based on [AsyncSwiftGit](https://github.com/bdewey/AsyncSwiftGit) by [Brian Dewey](https://bdewey.com).
10+
11+
When We went looking for a Git library to use in Swift, We were appalled to find only three:
12+
13+
- [Git](https://github.com/SwiftDocOrg/Git) by [Mattt](https://github.com/mattt) / [SwiftDoc.org](https://swiftdoc.org) – While a good example of how to do this, it's incomplete and has been archived/discouraged since 2021.
14+
- [static-libgit2](https://github.com/bdewey/static-libgit2), also by Brian Dewey, written to power AsyncSwiftGit. It's just a way to expose the raw libgit2 C library to Swift.
15+
- **AsyncSwiftGit**, which is genuinely a good Swift package for using Git
16+
17+
There's just a few things about AsyncSwiftGit which We would have done differently, so this is Us doing those differently!

Sources/AsyncSwiftGit/BranchType.swift renamed to Sources/SwiftLibgit2/BranchType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/CheckoutOptions.swift renamed to Sources/SwiftLibgit2/CheckoutOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/CloneOptions.swift renamed to Sources/SwiftLibgit2/CloneOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/Commit.swift renamed to Sources/SwiftLibgit2/Commit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/ConflictError.swift renamed to Sources/SwiftLibgit2/ConflictError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Foundation
44

Sources/AsyncSwiftGit/Credentials.swift renamed to Sources/SwiftLibgit2/Credentials.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44

Sources/AsyncSwiftGit/Diff.swift renamed to Sources/SwiftLibgit2/Diff.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/FetchOptions.swift renamed to Sources/SwiftLibgit2/FetchOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/GitConnectionSettings.swift renamed to Sources/SwiftLibgit2/GitConnectionSettings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Foundation
44

Sources/AsyncSwiftGit/GitConnectionSettingsDocument.swift renamed to Sources/SwiftLibgit2/GitConnectionSettingsDocument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Foundation
44
import SwiftUI

Sources/AsyncSwiftGit/GitError.swift renamed to Sources/SwiftLibgit2/GitError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/Index+Entry.swift renamed to Sources/SwiftLibgit2/Index+Entry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/Index.swift renamed to Sources/SwiftLibgit2/Index.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/MergeOptions.swift renamed to Sources/SwiftLibgit2/MergeOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/ObjectID.swift renamed to Sources/SwiftLibgit2/ObjectID.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation
55

66
/// Make a `git_oid` more Swifty
77
public struct ObjectID: CustomStringConvertible, Hashable, Sendable {
8-
init(_ oid: git_oid) {
8+
public init(_ oid: git_oid) {
99
self.oid = oid
1010
}
1111

12-
init?(_ oidPointer: UnsafePointer<git_oid>?) {
12+
public init?(_ oidPointer: UnsafePointer<git_oid>?) {
1313
guard let oid = oidPointer?.pointee else {
1414
return nil
1515
}

Sources/AsyncSwiftGit/ObjectType.swift renamed to Sources/SwiftLibgit2/ObjectType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/PushOptions.swift renamed to Sources/SwiftLibgit2/PushOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/Reference.swift renamed to Sources/SwiftLibgit2/Reference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/Repository.swift renamed to Sources/SwiftLibgit2/Repository.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation
@@ -396,9 +396,9 @@ public final class Repository {
396396
/// - Returns: The object ID for the reference.
397397
public func lookupReferenceID(referenceLongName: String) throws -> ObjectID? {
398398
do {
399-
return try GitError.checkAndReturnOID(apiName: "git_reference_name_to_id", closure: { oid in
399+
return try GitError.checkAndReturnOID(apiName: "git_reference_name_to_id") { oid in
400400
git_reference_name_to_id(&oid, repositoryPointer, referenceLongName)
401-
})
401+
}
402402
} catch let error as GitError {
403403
if error.errorCode == GIT_ENOTFOUND.rawValue {
404404
return nil

Sources/AsyncSwiftGit/SerializedGitConnectionSettings.swift renamed to Sources/SwiftLibgit2/SerializedGitConnectionSettings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import CryptoKit
44
import Foundation

Sources/AsyncSwiftGit/Signature.swift renamed to Sources/SwiftLibgit2/Signature.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/StatusEntry.swift renamed to Sources/SwiftLibgit2/StatusEntry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/SyncSettingsForm.swift renamed to Sources/SwiftLibgit2/SyncSettingsForm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import SwiftUI
44

Sources/AsyncSwiftGit/Tree.swift renamed to Sources/SwiftLibgit2/Tree.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Sources/AsyncSwiftGit/TreeEntry.swift renamed to Sources/SwiftLibgit2/TreeEntry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

33
import Clibgit2
44
import Foundation

Tests/AsyncSwiftGitTests/RepositoryTests.swift renamed to Tests/SwiftLibgit2Tests/RepositoryTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

3-
import AsyncSwiftGit
3+
import SwiftLibgit2
44
import XCTest
55

66
final class RepositoryTests: XCTestCase {

Tests/AsyncSwiftGitTests/SerializedGitConectionSettingsTests.swift renamed to Tests/SwiftLibgit2Tests/SerializedGitConectionSettingsTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright © 2022 Brian Dewey. Available under the MIT License, see LICENSE for details.
1+
// Copyright © 2022 Brian Dewey, 2024 Ky Leggiero. Available under the MIT License, see LICENSE for details.
22

3-
import AsyncSwiftGit
3+
import SwiftLibgit2
44
import XCTest
55

66
final class SerializedGitConectionSettingsTests: XCTestCase {

0 commit comments

Comments
 (0)