aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: gitignore, Fix loading of ignored .gitignore files.Wouter Horlings2024-06-172-1/+19
| | | | | | | 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
* Merge pull request #1056 from pjbgf/fix-symlinkPaulo Gomes2024-06-071-1/+10
|\ | | | | Bumps Go versions and go-billy
| * plumbing: format, Handle case where fs.Join breaks with C: in WindowsPaulo Gomes2024-05-201-1/+10
| | | | | | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* | plumbing: transport/http, Wrap http errors to return reason. Fixes #1097Gianni Gambetti2024-05-274-9/+11
|/
* plumbing: fix sideband demux on flushAyman Bagabas2024-04-262-3/+28
| | | | | | | | Canonical Git implementation terminates the sideband stream with a flush. If the demux scanner is not terminated, it can hang the connection. Returns io.EOF when encountering a flush pkt. https://github.com/git/git/blob/master/upload-pack.c#L460
* plumbing: protocol/packp, client-side filter capability support (#1000)Nikolay Edigaryev2024-04-115-0/+160
| | | * plumbing: protocol/packp, client-side filter capability support
* git: Refine some codes in test and non-test.onee-only2024-04-111-0/+1
|
* plumbing: Add link to index-format docsAlexander Block2024-04-091-0/+2
|
* plumbing: Add tests for unknown extensions, truncated extensions and invalid ↵Alexander Block2024-04-061-0/+102
| | | | hashes
* plumbing: Implement encodeRawExtension that can be used by testsAlexander Block2024-04-061-1/+33
|
* plumbing: Properly support skipping of non-mandatory extensionsAlexander Block2024-04-061-8/+30
| | | | | | | | | 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.
* plumbing: Properly detect EOF when reading index extensionsAlexander Block2024-04-051-34/+36
| | | | | | | | | 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.
* Merge pull request #937 from matejrisek/feature/rename-short-fieldsPaulo Gomes2024-03-163-17/+17
|\ | | | | Replace short field names with more descriptive ones.
| * plumbing: Replace short field names with more descriptive ones.Matej Risek2023-11-193-17/+17
| | | | | | | | | | The decision to change the name of these fields came from reading the code further down in the scope and not being clear what `c.c` means.
* | Merge pull request #1047 from avoidalone/masterPaulo Gomes2024-03-121-2/+2
|\ \ | | | | | | chore: fix some comments
| * | *: fix some commentsavoidalone2024-03-121-2/+2
| | | | | | | | | | | | Signed-off-by: avoidalone <wuguangdong@outlook.com>
* | | Merge pull request #971 from nodivbyzero/fix-177-diff-print-file-statsPaulo Gomes2024-03-113-55/+152
|\ \ \ | |/ / |/| | plumbing: no panic in printStats function. Fixes #177
| * | plumbing: no panic in printStat function. Fixes #177nodivbyzero2024-03-113-55/+152
| | |
* | | plumbing: object, Apply memoization in (*treeNoder).Children.onee-only2024-03-101-1/+3
| | |
* | | plumbing: object, Optimize getNextFileCommit to reuse parent tree.onee-only2024-03-101-5/+11
| | |
* | | plumbing: object, check entry order in (*Tree).Encode, export TreeEntrySorteryiteng.nyt2024-03-082-0/+55
| | |
* | | plumbing: object, check filename in (*Tree).Encodeyiteng.nyt2024-03-081-0/+3
| | |
* | | plumbing: object, Make first commit visible on logs filtered with filename. ↵onee-only2024-03-052-1/+28
| | | | | | | | | | | | Fixes #191
* | | plumbing: format/gitattributes, close file in ReadAttributesFilePeter Kurfer2024-02-052-6/+11
| | | | | | | | | | | | Fixes #1017
* | | plumbing: fix variable defaultUtf8CommitMessageEncoding name spell errorJerry-yz2024-01-152-6/+6
|/ /
* | plumbing: check setAuth error. Fixes #185nodivbyzero2023-12-132-1/+26
| |
* | Merge pull request #941 from djmoch/filestats-renamePaulo Gomes2023-12-012-2/+56
|\ \ | | | | | | plumbing: object, enable renames in getFileStatsFromFilePatches
| * | plumbing: object, enable renames in getFileStatsFromFilePatchesDaniel Moch2023-11-272-2/+56
| |/ | | | | | | | | Diff has handled renames by default since 2020. This change sets Name for the renamed file in a manner similar to diffstat.
* | git: validate reference namesAyman Bagabas2023-11-302-0/+148
| | | | | | | | | | | | | | | | | | | | Check reference names format before creating branches/tags/remotes. This should probably be in a lower level somewhere in `plumbing`. Validating the names under `plumbing.NewReference*` is not possible since these functions don't return errors. Fixes: https://github.com/go-git/go-git/issues/929
* | plumbing: transport: use git-proto-request and decode error-line errorsAyman Bagabas2023-11-235-114/+157
| |
* | plumbing: handle pktline erro-line as errorsAyman Bagabas2023-11-233-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | plumbing: add git-proto-request typeAyman Bagabas2023-11-232-0/+120
|/ | | | | | This the request used for the git transport protocol feat: nil writer
* plumbing: transport/git, Improve tests error messagePaulo Gomes2023-11-171-5/+15
| | | | | | | | | When running the tests in an install in which git daemon is not installed (e.g. openSUSE), all the git transport tests will fail with a connection refused error. This was due the git server not being running in the first place. The tests will now fail with 'git daemon cannot be found'. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* Merge pull request #932 from aymanbagabas/fix-emptyPaulo Gomes2023-11-171-0/+6
|\ | | | | plumbing: fix empty uploadpack request error
| * plumbing: fix empty uploadpack request errorAyman Bagabas2023-11-161-0/+6
| | | | | | | | | | | | | | | | | | | | If we have all what we asked for, finish the session and handle error. This is equivalent of git "Already up to date." message. Fixes: https://github.com/go-git/go-git/issues/328 Fixes: https://github.com/go-git/go-git/issues/638 Fixes: https://github.com/go-git/go-git/issues/157
* | utils: move trace to utilsAyman Bagabas2023-11-162-2/+2
|/ | | | | | | 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
* plumbing: format/pktline: trace packetsAyman Bagabas2023-11-152-0/+7
|
* utils: remove ioutil.Pipe and use std library io.PipeAyman Bagabas2023-11-132-3/+2
| | | | ioutil.Pipe literally calls io.Pipe.
* build: fix go-git binary buildAyman Bagabas2023-11-071-2/+2
|
* plumbing: format/packfile, Refactor patch deltaPaulo Gomes2023-11-062-113/+79
| | | | | | The changes aim to simplify the code and reduce duplication. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* Merge pull request #799 from pjbgf/perf2Paulo Gomes2023-11-062-50/+247
|\ | | | | plumbing: Optimise memory consumption for filesystem storage
| * plumbing: Optimise memory consumption for filesystem storagePaulo Gomes2023-10-282-50/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | git: implement upload-server-info. Fixes #731Ayman Bagabas2023-11-032-0/+279
| | | | | | | | | | | | | | | | | | This adds UpdateServerInfo along with a new go-git command to generate info files to help git dumb http serve refs and their objects. This also updates the docs to reflect this. Docs: https://git-scm.com/docs/git-update-server-info Fixes: https://github.com/go-git/go-git/issues/731
* | plumbing: transport/ssh, Fix nil pointer dereference caused when an ↵Anand Francis Joseph2023-11-022-5/+27
|/ | | | | | unreachable proxy server is set. Fixes #900 Signed-off-by: Anand Francis Joseph <anjoseph@redhat.com>
* plumbing: commitgraph, Add generation v2 supportAndrew Thornton2023-10-1215-55/+889
| | | | | | | | 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>
* Merge pull request #866 from makkes/better-error-handlingPaulo Gomes2023-10-123-4/+124
|\ | | | | Improve handling of remote errors
| * plumbing: transport/common, Improve handling of remote errorsMax Jonas Werner2023-10-123-4/+124
| | | | | | | | | | | | | | | | | | | | | | Instead of simply returning the first line that the remote returned, go-git now actively searches all of stderr for lines that may contain a more actionable error message and returns that. In addition, this change adds a case to map the GitLab-specific error message to an ErrRepositoryNotFound error. Signed-off-by: Max Jonas Werner <mail@makk.es>
* | Merge pull request #868 from pjbgf/fix-fuzzPaulo Gomes2023-10-092-5/+34
|\ \ | | | | | | plumbing: protocol/packp, Add validation for decodeLine
| * | plumbing: protocol/packp, Add validation for decodeLinePaulo Gomes2023-10-072-5/+34
| |/ | | | | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* | Merge pull request #860 from enverbisevac/masterPaulo Gomes2023-10-082-0/+5
|\ \ | | | | | | add clone --shared feature