Fast implementation of Git in pure Go codeberg.org/lindenii/furgit
git go
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

README: Remove guidance

Runxi Yu 5040f4b6 161d2fab

+11 -84
+11 -84
README.md
··· 19 19 * Then aim for high performance 20 20 * Expect familiarity with Git internals 21 21 22 - ## Finding your way around 23 - 24 - If you are working with a normal on-disk repository, start with 25 - `repository.Open(...)`. It opens the repository and wires together the refs 26 - storage, object storage, fetcher, (optional) commit-graph, commit queries, and 27 - reachability helpers. Note that it requires either a bare repository or a 28 - `.git` directory. Then, 29 - 30 - * `repo.Refs()` is for branch names, tags, `HEAD`, and ref updates. 31 - * Use it when you are starting from names rather than object IDs. 32 - * A common pattern is to resolve a ref first, then pass the resulting object 33 - ID to the fetcher. 34 - 35 - * `repo.Fetcher()` is the main object-facing API for most callers. 36 - * Use it when you want commits, trees, blobs, or tags as typed values. 37 - * It also handles peeling through annotated tags, resolving objects to the 38 - type you actually want, and walking paths inside trees. 39 - * It even allows you to access a tree as an `io/fs.FS`. 40 - * If your goal is "show me this commit", "read this tree", "follow this tag", 41 - or "get me the file at this path", this is usually the right layer. 42 - 43 - * `repo.Objects()` is the storage layer underneath `Fetcher`. 44 - * Use it when you need to read object headers, read raw object contents, 45 - stream object data, or otherwise look up objects directly by ID. 46 - * Most callers who want to work with Git objects as commits, trees, blobs, or 47 - tags should prefer the fetcher instead. 48 - * However, checking an object ID's size and type are somewhat common 49 - operations that should be done here. 50 - 51 - * `repo.CommitQueries()` is the main graph-query API. 52 - * Use it when you need ancestor checks or merge-base computation. 53 - 54 - * `repo.Reachability()` is the graph-traversal API. 55 - * Use it when you need to walk reachable commits or objects, or to perform 56 - connectivity checks. 57 - 58 - * `repo.CommitGraph()` exposes the low-level commit-graph reader. 59 - * Not all repositories have commit graphs, so it may be nil. 60 - * Most callers should prefer `repo.CommitQueries()` or `repo.Reachability()` 61 - unless they specifically need direct commit-graph access. 62 - 63 - Note that: 64 - 65 - * `object` contains parsed Git object values such as blobs, trees, commits, and 66 - tags. These are the decoded contents of Git objects and do not tell you 67 - anything about the object's identity. 68 - 69 - * `object/stored` wraps a parsed object together with the object ID it was 70 - loaded from. This is used when you need both the parsed value and the 71 - identity it was loaded under. 72 - 73 - As a rule of thumb: 74 - 75 - * If you have a ref name, start with `repo.Refs()`. 76 - * If you want typed objects or path-based access, use `repo.Fetcher()`. 77 - * If you need raw object lookup by ID, object headers, or object streams, use 78 - `repo.Objects()`. 79 - * If you need ancestor checks or merge bases, use `repo.CommitQueries()`. 80 - * If you need commit or object graph traversal, use `repo.Reachability()`. 81 - 82 - Some operations remain available if you want to work below those accessors: 83 - 84 - * To accept pushes on the server side, construct `network/receivepack` or 85 - `network/receivepack/service` with the repository's ref store, object store, 86 - commit-graph reader, and object ID algorithm. 87 - * Push handling also needs the repository's object storage root so incoming 88 - objects can be quarantined and later promoted. 89 - * `Repository` does not currently expose that root directly (we'll consider 90 - possible solutions sometime later), so a push server usually keeps the 91 - repository path or object root handle alongside the `Repository` value. 92 - * Hook-based checks are just Go functions; for example, a fast-forward check 93 - can use `commitquery.Queries` over the existing and quarantined object 94 - stores. Some hooks are provided. 95 - 96 - ## Alternatives 97 - 98 - Not endorsements. 99 - 100 - * [github.com/go-git/go-git](https://github.com/go-git/go-git) (by far the most mature) 101 - * [github.com/driusan/dgit](https://github.com/driusan/dgit) 102 - * [github.com/Nivl/git-go](https://github.com/Nivl/git-go) 103 - * [github.com/unkn0wn-root/git-go.git](https://github.com/unkn0wn-root/git-go.git) 104 - * [github.com/speedata/gogit](https://github.com/speedata/gogit) 105 - 106 22 ## Community 107 23 108 24 * [#lindenii](https://webirc.runxiyu.org/kiwiirc/#lindenii) ··· 133 49 acceptance by the Designated Proxy of any subsequent version of the GNU Affero 134 50 General Public License shall permanently authorize the use of that accepted 135 51 version for this Program. 52 + 53 + ## Alternatives 54 + 55 + Not endorsements. 56 + 57 + * [github.com/go-git/go-git](https://github.com/go-git/go-git) (by far the most mature) 58 + * [github.com/driusan/dgit](https://github.com/driusan/dgit) 59 + * [github.com/Nivl/git-go](https://github.com/Nivl/git-go) 60 + * [github.com/unkn0wn-root/git-go.git](https://github.com/unkn0wn-root/git-go.git) 61 + * [github.com/speedata/gogit](https://github.com/speedata/gogit) 62 +