aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
Commit message (Collapse)AuthorAgeFilesLines
* Optimise Reference.String()Paulo Gomes2022-11-072-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decreases allocations and bytes per operation by using string builder with a predefined size. One additional allocation has been removed by using its own implementation of Strings(). The reason behind this was due to the fact the calls to .String() are more recurrent than .Strings() and the performance impact was worth the code duplication. Benchmark results: cpu: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz name old time/op new time/op delta ReferenceStringSymbolic-16 140ns ± 4% 40ns ± 9% -71.19% (p=0.008 n=5+5) ReferenceStringHash-16 174ns ±14% 85ns ± 4% -51.13% (p=0.008 n=5+5) ReferenceStringInvalid-16 48.9ns ± 2% 1.5ns ± 3% -96.96% (p=0.008 n=5+5) name old alloc/op new alloc/op delta ReferenceStringSymbolic-16 88.0B ± 0% 32.0B ± 0% -63.64% (p=0.008 n=5+5) ReferenceStringHash-16 176B ± 0% 144B ± 0% -18.18% (p=0.008 n=5+5) ReferenceStringInvalid-16 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta ReferenceStringSymbolic-16 4.00 ± 0% 1.00 ± 0% -75.00% (p=0.008 n=5+5) ReferenceStringHash-16 5.00 ± 0% 3.00 ± 0% -40.00% (p=0.008 n=5+5) ReferenceStringInvalid-16 0.00 0.00 ~ (all equal) Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* Use Sync.Pool pointers to optimise memory usagePaulo Gomes2022-11-074-9/+53
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* *: fix some typos (#567)cui fliter2022-09-221-1/+1
| | | | | Signed-off-by: cui fliter <imcusg@gmail.com> Signed-off-by: cui fliter <imcusg@gmail.com>
* Fix typos (#532)Quanyi Ma2022-09-221-2/+2
|
* plumbing: packp and server, Include the contents of ↵🚀 Steven Ewing 🌌2022-09-225-5/+40
| | | | `GO_GIT_USER_AGENT_EXTRA` as the git user agent. Fixes #529
* plumbing: transport/ssh, auto-populate ClientConfig.HostKeyAlgorithms. Fixes ↵Evan Elias2022-09-222-17/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | #411 This commit adjusts the transport/ssh logic in command.connect(), so that it now auto-populates ssh.ClientConfig.HostKeyAlgorithms. The algorithms are chosen based on the known host keys for the target host, as obtained from the known_hosts file. In order to look-up the algorithms from the known_hosts file, external module github.com/skeema/knownhosts is used. This package is just a thin wrapper around golang.org/x/crypto/ssh/knownhosts, adding an extra mechanism to query the known_hosts keys, implemented in a way which avoids duplication of any golang.org/x/crypto/ssh/knownhosts logic. Because HostKeyAlgorithms vary by target host, some related logic for setting HostKeyCallback has been moved out of the various AuthMethod implementations. This was necessary because the old HostKeyCallbackHelper is not host-specific. Since known_hosts handling isn't really tied to AuthMethod anyway, it seems reasonable to separate these. Previously-exported types/methods remain in place for backwards compat, but some of them are now unused. For testing approach, see pull request. Issue #411 can only be reproduced via end-to-end / integration testing, since it requires actually launching an SSH connection, in order to see the key mismatch error triggered from https://github.com/golang/go/issues/29286 as the root cause.
* minor grammatical fixesJon Eskin2022-09-225-10/+10
|
* all: replace go-homedir with os.UserHomeDirDaniel Martí2022-05-291-5/+6
| | | | Added in Go 1.12, this means we need one less dependency.
* plumbing: packp, Avoid duplicate encoding when overriding a Capability ↵Tyler Christensen2022-05-012-1/+14
| | | | | | | | | value. (#521) Previously, calling `Set($CAPABILITY, ...)` on a `capability.List` where `$CAPABILITY` was already present would correctly replace the existing value of that capability, but would also result in that capability being listed twice in the internal `l.sort` slice. This manifested publicly when the `List` was encoded as the same capability appearing twice with the same value in the encoded output.
* plumbing: protocol/pakp, update agent Carlos Alexandro Becker2022-01-194-5/+5
| | | Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
* remove packfile and align to test fixturespaul.t2022-01-052-3/+2
|
* Merge branch 'master' into codecommit-ref-deltapaul.t2021-12-1521-86/+99
|\
| * Merge branch 'go-git:master' into masterPaul T2021-12-1523-99/+182
| |\
| | * Merge pull request #425 from abhinav/error-stringsMáximo Cuadros2021-12-114-8/+8
| | |\ | | | | | | | | error strings: Don't capitalize, use periods, or newlines
| | | * error strings: Don't capitalize, use periods, or newlinesAbhinav Gupta2021-12-044-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | Merge pull request #418 from abhinav/unusedMáximo Cuadros2021-12-1011-61/+1
| | |\ \ | | | | | | | | | | Remove unused vars/types/funcs/fields
| | | * | Remove unused variables/types/functionsAbhinav Gupta2021-11-2711-61/+1
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | [staticcheck](https://staticcheck.io/) reported a number of unused fields, functions, types, and variables across the code. Where possible, use them (assert unchecked errors in tests, for example) and otherwise remove them.
| | * | Merge branch 'master' into jc-push-atomicMáximo Cuadros2021-12-105-17/+71
| | |\ \
| | | * \ Merge pull request #410 from john-cai/jc-sparseMáximo Cuadros2021-12-102-0/+22
| | | |\ \ | | | | | | | | | | | | Worktree: Checkout, simplified sparse checkout
| | | | * | simplified sparse checkoutJohn Cai2021-11-092-0/+22
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial logic to support a simple sparse checkout where directories to be included can be specified in CheckoutOptions. This change doesn't fully support the sparse patterns, nor does this change include the optimization to collapse flie entries in ithe index that are excluded via the sparse checkout directory patterns included under the parent directory.
| | | * / packp: Actions should have type ActionAbhinav Gupta2021-11-271-3/+3
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Per the [Go Spec](https://go.dev/ref/spec#Constant_declarations), the following yields the type `Action` for `Bar` and `Baz` only if there is no `=`. const ( Foo Action = ... Bar Baz ) The following has the type `Action` for the first item, but not the rest. Those are untyped constants of the corresponding type. const ( Foo Action = ... Bar = ... Baz = ... ) This means that `packp.{Update, Delete, Invalid}` are currently untyped string constants, and not `Action` constants as was intended here. This change fixes these.
| | | * Support v3 indexJohn Cai2021-11-052-14/+46
| | | | | | | | | | | | | | | | | | | | | | | | Currently the index encoder does not support the v3 index format. This change adds support to the encoder. This helps to unlock sparse checkout.
| | * | Add Atomic to push optionsJohn Cai2021-11-031-0/+19
| | |/ | | | | | | | | | | | | | | | push --atomic allows a push to succeed or fail atomically. If one ref fails, the whole push fails. This commit allows the user to set Atomic as an option for a push.
| * | resolve external reference deltaspaul.t2021-10-111-0/+11
| | |
* | | include example codecommit pack filepaul.t2021-11-091-0/+0
| | |
* | | add codecommit packfile for testing external ref resolutionpaul.t2021-11-091-0/+14
| | |
* | | Merge branch 'go-git:master' into codecommit-ref-deltaPaul T2021-11-025-13/+83
|\ \ \ | | |/ | |/|
| * | Merge pull request #399 from S-Bohn/add-push-optionsMáximo Cuadros2021-11-013-1/+53
| |\ \ | | | | | | | | Remote: PushOptions add push-options
| | * | plumbing: packp, Add encoding for push-options. Fixes #268.Sören Bohn2021-10-263-1/+53
| | |/ | | | | | | | | | go-git: Add field `Options` to `PushOptions`, wire functionality.
| * | better testsenisdenjo2021-10-271-39/+9
| | |
| * | plumbing: gitignore, Read .git/info/exclude file too.enisdenjo2021-10-272-10/+58
| |/
* / resolve external reference deltapaul.t2021-10-111-0/+11
|/
* plumbing/storer/object: improve grammar Go Doc (#350)Christopher Hunter2021-07-241-4/+4
|
* plumbing: format/packfile, prevent large objects from being read into memory ↵zeripath2021-06-308-33/+405
| | | | | | | | | | | | | | | completely (#330) This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem. Objects greater than 1Mb are now no longer directly stored in the cache or read completely into memory. This PR differs and improves the previous broken #323 by fixing several bugs in the reader and transparently wrapping ReaderAt as a Reader. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Revert "plumbing: format/packfile, prevent large objects from being read ↵v5.4.2zeripath2021-06-024-313/+0
| | | | | into memory completely (#303)" (#329) This reverts commit 720c192831a890d0a36b4c6720b60411fa4a0159.
* plumbing: format/packfile, prevent large objects from being read into memory ↵v5.4.0zeripath2021-05-124-0/+313
| | | | | | | | | | | completely (#303) This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem. Objects greater than 1Mb are now no longer directly stored in the cache or read completely into memory. Signed-off-by: Andrew Thornton <art27@cantab.net>
* plumbing: object/patch, printStat strings.Repeat cause panic (#310) cookeem2021-05-121-2/+10
|
* git: Add support for deepening shallow clones (#311)Marcus Watkins2021-05-121-1/+1
|
* plumbing: transport/http, skip flaky testMáximo Cuadros2021-05-031-0/+4
|
* *: use go-billy instead of os callsMáximo Cuadros2021-05-026-153/+31
|
* utils: ioutil, Pipe implementatioMáximo Cuadros2021-05-022-2/+3
|
* plumbing: format, use os.UserHomeDir()Máximo Cuadros2021-05-029-155/+72
|
* plumbing: transport/file, replace os/exec with golang.org/x/sys/execabs to ↵Máximo Cuadros2021-04-171-9/+9
| | | | improve path security
* plumbing: transport/ssh, support more formats in `NewPublicKeys` SSH helper ↵Hidde Beydals2021-04-172-18/+11
| | | | | | | | | | | | | | | (#298) * Add failing ED25519 encrypted PEM test Signed-off-by: Hidde Beydals <hello@hidde.co> * Support more formats in `NewPublicKeys` SSH helper By switching to `ParsePrivateKey` and `ParsePrivateKeyWithPassphrase` from `crypto/ssh`, which has support for RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. Signed-off-by: Hidde Beydals <hello@hidde.co>
* plumbing: object, fix TestDecodeAndVerify testMáximo Cuadros2021-04-161-44/+53
|
* *: replace golang.org/x/crypto/openpgp by ↵Johan Fleury2021-04-064-89/+47
| | | | github.com/ProtonMail/go-crypto/openpgp (#283)
* plumbing: transport/ssh, fix no agent test on windowsv5.3.0Máximo Cuadros2021-03-291-1/+1
|
* *: fix flaky testMáximo Cuadros2021-03-261-0/+4
|
* plumbing: wire up contexts for Transport.AdvertisedReferences (#246)Andrew Suffield2021-03-267-7/+64
| | | | | * plumbing: wire up contexts for Transport.AdvertisedReferences * add more tests for context wiring
* transport: ssh, fix cloning large repositories (#272)David Cuadrado2021-03-262-1/+29
| | | | | | | | | | | | | | | | | * Fix cloning large repositories Ignore the error on close when the connection is already closed Fixes #70 * Compatibility for go 1.13 Because it's required by the pipeline * Add test for allowing to close a command when the client is already closed This test is for issue #70 * Add debug information for broken test