aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/commitgraph
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: commitgraph, Add generation v2 supportAndrew Thornton2023-10-126-54/+255
| | | | | | | | This PR adds in support for generation v2 support and a couple of new walkers to match --date-order etc options on log. This PR also fixes a bug in the chain code and adds more tests. Signed-off-by: Andrew Thornton <art27@cantab.net>
* plumbing: commitgraph, fix types and handle commit-graph-chainsAndrew Thornton2023-10-0814-55/+1265
| | | | | | | | | Unfortunately the original variant makes some incorrect typing assumptions about commit-graphs which make handling graph chains difficult to do correctly. This creates a new subpackage and deprecates the old one. It then adds support commit graph chains. Signed-off-by: Andrew Thornton <art27@cantab.net>
* plumbing: commitgraph, allow SHA256 commit-graphsAndrew Thornton2023-09-302-13/+31
| | | | | | | | Since the build-tag sha256 was introduced the commit graph code should be switched to use hash.Size and only use a graph if it has the correct hash version for the version of go-git that is built. Signed-off-by: Andrew Thornton <art27@cantab.net>
* *: Support variable length plumbing.HashPaulo Gomes2023-03-081-4/+3
| | | | | | | | | | | | The variable length for plumbing.Hash is defined at build time, blocked by tag sha256. This approach was a trade-off between keeping backwards compatibility while making progress towards supporting SHA256 with a small amount of changes. Relates to the SHA256 implementation, defined in #706. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* sha1: Add collision resistent implementationPaulo Gomes2022-11-251-3/+3
| | | | | | | | | | | | | | | | | | | Implement the same SHA1 collision resistent algorithm used by both the Git CLI and libgit2. Only commits with input that match the unavoidable bit conditions will be further processed, which will result in different hashes. Which is the same behaviour experienced in the Git CLI and Libgit2. Users can override the hash algorithm used with: hash.RegisterHash(crypto.SHA1, sha1.New) xref links: https://github.com/libgit2/libgit2/pull/4136/commits/2dfd1294f7a694bfa9e864a9489ae3cb318a5ed0 https://github.com/git/git/commit/28dc98e343ca4eb370a29ceec4c19beac9b5c01e Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* error strings: Don't capitalize, use periods, or newlinesAbhinav Gupta2021-12-041-3/+3
| | | | | | | | | | | | | | | | | | | | | Per [Go Code Review Comments][1], > Error strings should not be capitalized (unless beginning with proper > nouns or acronyms) or end with punctuation staticcheck's [ST1005][2] also complains about these. For example, ``` object_walker.go:63:10: error strings should not be capitalized (ST1005) object_walker.go:101:10: error strings should not be capitalized (ST1005) object_walker.go:101:10: error strings should not end with punctuation or a newline (ST1005) plumbing/format/commitgraph/file.go:17:26: error strings should not be capitalized (ST1005) ``` This fixes all instances of this issue reported by staticcheck. [1]: https://github.com/golang/go/wiki/CodeReviewComments#error-strings [2]: https://staticcheck.io/docs/checks/#ST1005
* plumbing: format, use os.UserHomeDir()Máximo Cuadros2021-05-021-11/+13
|
* fix goreportcard warningsOleg Kovalov2020-07-011-2/+3
|
* *: migration from go-git-fixtures/v4 and go-git/gcfgMáximo Cuadros2020-03-101-1/+1
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-105-8/+8
|
* *: avoid unnecessary conversionsChristian Muehlhaeuser2019-07-292-2/+2
| | | | | | | No need to convert these values, they're already of the right type. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
* *: fixed tautological error conditionsautological error conditionsChristian Muehlhaeuser2019-07-291-8/+6
| | | | | | | | | | - Added missing error handling around encodeCommitData and prevented shadowing err. - Removed tautological error checks. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit 7d76176416551fc21d98bc17768d158a82281406)
* Remove unnecessary mmap usage from testsFilip Navara2019-05-071-6/+4
| | | | Signed-off-by: Filip Navara <filip.navara@gmail.com>
* Add doc.go for commitgraph packagesFilip Navara2019-05-073-0/+106
| | | | Signed-off-by: Filip Navara <filip.navara@gmail.com>
* plumbing: format/commitgraph, rename structs/fields to follow the terms used ↵Filip Navara2019-04-255-59/+59
| | | | | | by git more closely Signed-off-by: Filip Navara <navara@emclient.com>
* plumbing: format/commitgraph, clean up error handlingFilip Navara2019-04-253-6/+4
| | | | Signed-off-by: Filip Navara <navara@emclient.com>
* Remove debug print, fix large edge count calculation to make the reencoded ↵Filip Navara2019-04-242-3/+1
| | | | | | file binary identical Signed-off-by: Filip Navara <filip.navara@gmail.com>
* Split OpenFileIndex into smaller functionsFilip Navara2019-04-242-32/+51
| | | | Signed-off-by: Filip Navara <filip.navara@gmail.com>
* Split Encoder into smaller functionsFilip Navara2019-04-242-55/+95
| | | | Signed-off-by: Filip Navara <filip.navara@gmail.com>
* Rename fixture tag to commit-graphFilip Navara2019-04-241-3/+3
| | | | Signed-off-by: Filip Navara <filip.navara@gmail.com>
* plumbing: format/commitgraph, add APIs for reading and writing commit-graph ↵Filip Navara2019-04-245-0/+632
files Signed-off-by: Filip Navara <filip.navara@gmail.com>