aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * | git: clone --shared implementedenverbisevac2023-10-082-0/+5
| | |
* | | plumbing: commitgraph, fix types and handle commit-graph-chainsAndrew Thornton2023-10-0818-383/+1600
| |/ |/| | | | | | | | | | | | | | | 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>
* | Merge pull request #761 from liwenqiu/parse-commit-encoding-headerPaulo Gomes2023-10-042-4/+25
|\ \ | |/ |/| plumbing: parse the encoding header of the commit object
| * plumbing: parse the encoding header of the commit objectliwenqiu2023-10-042-4/+25
| | | | | | | | other part can re-code the commit message according to the encoding to this encoding info
* | Merge pull request #855 from 0x34d/fuzzingPaulo Gomes2023-10-036-0/+66
|\ \ | |/ |/| fuzzing : fuzz testing support for oss-fuzz integration
| * fuzzing : fuzz testing support for oss-fuzz integrationArjun Singh2023-10-026-0/+66
| | | | | | | | Signed-off-by: Arjun Singh <ajsinghyadav00@gmail.com>
* | 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>
* Merge pull request #836 from hezhizhen/typoPaulo Gomes2023-09-288-252/+252
|\ | | | | *: fix some typos
| * *: fix some typosZhizhen He2023-09-088-252/+252
| | | | | | | | Signed-off-by: Zhizhen He <hezhizhen.yi@gmail.com>
* | plumbing/object: Support mergetag in merge commitsAditya Sirish2023-09-272-0/+83
|/ | | | | | | | When a merge commit is created from merging a signed tag, the tag object is embedded in the commit object. This commit adds support for this tag data when encoding and decoding a commit object. Signed-off-by: Aditya Sirish <aditya@saky.in>
* plumbing: Do not swallow http message coming from VCS providers.matej.risek2023-09-054-4/+35
| | | | | | For diagnostics reasons we want to surface error messages coming from VCS providers. That's why we introduce the reason field to Err struct in http package. This field can be used by an end user of the library in order to better understand failures.
* plumbing: transport, handle IPv6 while parsing endpoint. Fixes #740merlin2023-07-262-1/+19
|
* *: Handle paths starting with ~usernameArieh Schneier2023-07-091-16/+2
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* plumbing: blame, Complete rewrite. Fixes #603Arieh Schneier2023-07-062-0/+81
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* plumbing: packp, A request is not empty if it contains shallows. Fixes #328Arieh Schneier2023-07-023-4/+11
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* plumbing: http, Fix empty repos on Git v2.41+Paulo Gomes2023-07-013-0/+22
| | | | | | | | | | | | Git v2.41.0 comes with [changes](https://github.com/git/git/commit/933e3a4ee205353d8f093d5dfcd226fa432c4e58) that breaks go-git's assumptions for when detecting empty repositories. Go-git expects a flush instead of the first hash line. Instead, a dummy capabilities^{} with zero-id is returned. The change aims to allow for identifying the object format even when cloning empty repositories. Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* plumbing: gitignore, Allow gitconfig to contain a gitignore relative to any ↵Arieh Schneier2023-06-052-11/+57
| | | | | | user home. Fixes #578 Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* plumbing: gitignore, fix incorrect parsing. Fixes #500Arieh Schneier2023-05-292-6/+40
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* plumbing: gitignore, TypoJleagle2023-05-251-1/+1
| | | Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
* plumbing: gitignore, Allow gitconfig to contain a gitignore relative to user ↵Jleagle2023-05-252-0/+47
| | | | home
* git: enable fetch with unqualified referencesArieh Schneier2023-05-251-3/+4
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* Merge pull request #764 from techknowlogick/init-optionsPaulo Gomes2023-05-231-0/+1
|\ | | | | git: Allow Initial Branch to be configurable
| * git: Allow Initial Branch to be configurabletechknowlogick2023-05-211-0/+1
| |
* | *: Add missing error checksPaulo Gomes2023-05-112-14/+24
| | | | | | | | | | | | | | | | 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>
* | *: Replace fmt.Sprintf with net.JoinHostPortPaulo Gomes2023-05-112-4/+5
| | | | | | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* | *: Remove use of deprecated io/utilPaulo Gomes2023-05-1132-93/+66
| | | | | | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>