| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Stop loading .gitignore files from ignored directories, as this can
cause files to be included that should not be.
See https://git-scm.com/docs/gitignore#_pattern_format
|
|
|
|
| |
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
| |
|
|
|
|
| |
hashes
|
| |
|
|
|
|
|
|
|
|
|
| |
Before this, go-git would prematurely bail out of extensions processing
when an unknown extension was encountered. This had two issues:
1. It did not account for mandatory (lower case header) extensions
2. It did not properly update the calculated hash, leading to an
"invalid checksum" error.
|
|
|
|
|
|
|
|
|
| |
Before this, go-git was relying on the peeked header to not include a valid
4 char string header. While doing this, it did not differentiate between
the errournously read final hash and an unknown extension.
This made it impossible to properly skip unknown optional extensions while
detecting EOF early enough.
|
|
|
|
| |
Signed-off-by: avoidalone <wuguangdong@outlook.com>
|
|
|
|
| |
Fixes #1017
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Error when encountering an error-line
See https://git-scm.com/docs/pack-protocol
Update plumbing/format/pktline/error.go
Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
Update plumbing/format/pktline/error.go
Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
feat: format newline
|
|
|
|
|
|
|
| |
Without exposing `trace`, we can't set a target to enable tracing from
out of go-git.
Fixes: https://github.com/go-git/go-git/pull/916
|
| |
|
|
|
|
|
|
| |
The changes aim to simplify the code and reduce duplication.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, as part of building the index representation, the resolveObject
func would create an interim plumbing.MemoryObject, which would then be
saved into storage via storage.SetEncodedObject. This meant that objects
would be unnecessarily loaded into memory, to then be saved into disk.
The changes streamlines this process by:
- Introducing the LazyObjectWriter interface which enables the write
operation to take places directly against the filesystem-based storage.
- Leverage multi-writers to process the input data once, while targeting
multiple writers (e.g. hasher and storage).
An additional change relates to the caching of object info children within
Parser.get. The cache is now skipped when a seekable filesystem is being
used.
The impact of the changes can be observed when using seekable filesystem
storages, especially when cloning large repositories.
The stats below were captured by adapting the BenchmarkPlainClone test
to clone https://github.com/torvalds/linux.git:
pkg: github.com/go-git/go-git/v5
cpu: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
│ /tmp/old │ /tmp/new │
│ sec/op │ sec/op vs base │
PlainClone-16 41.68 ± 17% 48.04 ± 9% +15.27% (p=0.015 n=6)
│ /tmp/old │ /tmp/new │
│ B/op │ B/op vs base │
PlainClone-16 1127.8Mi ± 7% 256.7Mi ± 50% -77.23% (p=0.002 n=6)
│ /tmp/old │ /tmp/new │
│ allocs/op │ allocs/op vs base │
PlainClone-16 3.125M ± 0% 3.800M ± 0% +21.60% (p=0.002 n=6)
Notice that on average the memory consumption per operation is over 75%
smaller. The time per operation increased by 15%, which may actual be less
on long running applications, due to the decreased GC pressure and the
garbage collection costs.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| | |
fuzzing : fuzz testing support for oss-fuzz integration
|
| |
| |
| |
| | |
Signed-off-by: Arjun Singh <ajsinghyadav00@gmail.com>
|
|/
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
|
|
|
|
|
|
| |
user home. Fixes #578
Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
|
|
|
|
| |
Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
|
|
|
| |
Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
|
|
|
|
| |
home
|
|
|
|
|
|
|
|
| |
Some areas of the code base were missing error checks,
without them it may be harder to troubleshoot unexpected
behaviours.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
| |
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
| |
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|\
| |
| | |
*: Add support for initializing SHA256 repositories
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| | |
Relates to the SHA256 implementation, defined in #706.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|/
|
|
|
|
|
|
|
|
|
| |
In a self-contained pack file delta references might point to base
objects stored later in the file.
In this case we need to replace placeholders for external refs with the
actual base object and update the children references.
Fixes: #484
Co-authored-by: Markus Wolf <mail@markus-wolf.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| | |
plumbing: config, Branch name with hash can be cloned. Fixes #309
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Fixed some little typos
|
| | | |
|
|\ \ \
| | | |
| | | | |
plumbing: gitattributes, Avoid index out of range
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When a path is deeper than the single asterisk pattern the code would
crash with a "index out of range".
This change checks the length of the remaining pattern before it
references an element of that slice.
With a single trailing asterisk paths deeper than the pattern should not
get the attributes.
For example with the following `.gitattributes` file:
thirdparty/* linguist-vendored
This is how git handles it:
$ git check-attr --all thirdparty/README.md
thirdparty/README.md: diff: markdown
thirdparty/README.md: linguist-vendored: set
$ git check-attr --all thirdparty/package/README.md
thirdparty/package/README.md: diff: markdown
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Expands on the optimisations from https://github.com/fluxcd/go-git/pull/5
and ensures that zlib reader does not need to recreate a deflate
dictionary at every use.
The use of sync pools was consolidated into a new sync utils package.
name old time/op new time/op delta
Parser-16 7.51ms ± 3% 7.71ms ± 6% ~ (p=0.222 n=5+5)
name old alloc/op new alloc/op delta
Parser-16 4.65MB ± 3% 1.90MB ± 3% -59.06% (p=0.008 n=5+5)
name old allocs/op new allocs/op delta
Parser-16 3.48k ± 0% 3.32k ± 0% -4.57% (p=0.016 n=5+4)
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|/ /
| |
| |
| | |
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
| | |
|
| | |
|
| | |
|
|\ \ |
|
| |\ \ |
|
| | |\ \
| | | | |
| | | | | |
error strings: Don't capitalize, use periods, or newlines
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|