aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 15614629e1706b97e8e35ccb0184bf7fb13877f9 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Furgit

[![builds.sr.ht status](https://builds.sr.ht/~runxiyu/furgit.svg)](https://builds.sr.ht/~runxiyu/furgit?)
[![Go Reference](https://pkg.go.dev/badge/git.sr.ht/~runxiyu/furgit.svg)](https://pkg.go.dev/git.sr.ht/~runxiyu/furgit)

Furgit is a fast Git library in pure Go
(and a little bit of optional Go Assembly).

## Project status

* Initial development
* No tagged releases
* API *will* break frequently
* Do not use in production
* Will likely follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) in the future

## Current features

* SHA-256 and SHA-1
* Reading loose objects
* Writing loose objects
* Reading packfiles
* General support for blobs, trees, commits, and tags

## Future features

* Multi pack indexes
* Repack
* [commit-graph](https://git-scm.com/docs/commit-graph)
* Network protocols
* And much more

## General goals

Furgit intends to be a general-purpose Git library.

For now, Furgit primarily prioritize APIs and optimizations that are
likely to be used by software development forges and other
server-side usages; in particular, Furgit follows the needs of
[Villosa](https://villosa.lindenii.org/villosa//repos/villosa/) and
to some extent [tangled](https://tangled.org/@tangled.org/core).

## Performance optimizations

* Aggressive pooling of byte buffers
* Aggressive pooling of custom zlib readers
* Minor SIMD optimizations for Adler-32
* Memory-mapping packfiles and their indexes

## Performance

See [gitbench](https://git.sr.ht/~runxiyu/gitbench) for details on methods.

All tests below were run on `linux.git` with `HEAD` at `6da43bbeb6918164`
on a `Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz`.

**Note:** go-git is expected to perform much better after
[storage: filesystem/mmap, Add PackScanner to handle large repos](https://github.com/go-git/go-git/pull/1776).

### Traversing all trees

* Git: 0.1 seconds
* Furgit: 9 seconds
* libgit2: 19 seconds
* go-git: 122 seconds

### Traversing the root tree only


* Furgit: 1ms
* Git: 4ms
* libgit2: 11ms
* go-git: 1800ms

## Dependencies

* The standard library
* Some things from `golang.org/x`

* It is unlikely that other dependencies will be introduced.
* In some cases, external code is introduced but maintained in-tree.

## Environment requirements

We currently do not intend to support flexible storage backends such as
[storers in go-git](https://pkg.go.dev/github.com/go-git/go-git/v5/plumbing/storer);
a standard UNIX-like filesystem with
[syscall.Mmap](https://pkg.go.dev/syscall#Mmap) is expected.

## Repos and community resources

* [Codeberg](https://codeberg.org/lindenii/furgit)
* [SourceHut mirror](https://git.sr.ht/~runxiyu/furgit)
* [tangled mirror](https://tangled.org/@runxiyu.tngl.sh/furgit)
* [GitHub mirror](https://github.com/runxiyu/furgit)

We discuss in `#chat` on [irc.runxiyu.org](https://irc.runxiyu.org)
([web chat](https://webirc.runxiyu.org/kiwiirc/#chat))

The maintainer is working through college applications and IBDP coursework and
may not necessarily respond in time.

## History and lineage

* I wrote [Lindenii Forge](https://forge.lindenii.org/forge/-/repos/server/)
* I wrote [hare-git](https://forge.lindenii.org/hare/-/repos/hare-git/)
* I wanted a faster Git library for
  [Lindenii Villosa](https://villosa.lindenii.org/villosa//repos/villosa/),
  the next generation of Lindenii Forge
* I translated hare-git and put it into `internal/common/git` in Villosa
* I extracted it out into a general-purpose library, which is what we
  have now
* I was thinking of names and I accidentally typed "git" as "fur" (i.e., left
  shifted one key on my QWERTY keyboard), so, "Furgit"

## License

This project is licensed under the GNU Affero General Public License,
Version 3.0 only.

Pursuant to Section 14 of the GNU Affero General Public License, Version 3.0,
[Runxi Yu](https://runxiyu.org) is hereby designated as the proxy who is
authorized to issue a public statement accepting any future version of the
GNU Affero General Public License for use with this Program.

Therefore, notwithstanding the specification that this Program is licensed
under the GNU Affero General Public License, Version 3.0 only, a public
acceptance by the Designated Proxy of any subsequent version of the GNU Affero
General Public License shall permanently authorize the use of that accepted
version for this Program.

For the purposes of the Developer Certificate of Origin, the "open source
license" refers to the GNU Affero General Public License, Version 3.0, with the
above proxy designation pursuant to Section 14.

All contributors are required to "sign-off" their commits (using `git commit
-s`) to indicate that they have agreed to the [Developer Certificate of
Origin](https://developercertificate.org), reproduced below.

```
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
```