aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: signature, support the same x509 signature formats as gitYoav Amit2024-08-202-1/+15
| | | | | Commits and tags signed with x509 certificates may be encoded with the `SIGNED MESSAGE` PEM label. This behavior is consistent in [git](https://github.com/git/git/blob/master/gpg-interface.c\#L63) and [gpgsm](https://github.com/gpg/gnupg/blob/master/sm/sign.c\#L650) which is commonly used to produce these types of signatures.
* 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: fix variable defaultUtf8CommitMessageEncoding name spell errorJerry-yz2024-01-152-6/+6
|/
* 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.
* plumbing: commitgraph, Add generation v2 supportAndrew Thornton2023-10-129-1/+634
| | | | | | | | 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-084-328/+335
| | | | | | | | | 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
* | fuzzing : fuzz testing support for oss-fuzz integrationArjun Singh2023-10-022-0/+24
|/ | | | Signed-off-by: Arjun Singh <ajsinghyadav00@gmail.com>
* Merge pull request #836 from hezhizhen/typoPaulo Gomes2023-09-282-246/+246
|\ | | | | *: fix some typos
| * *: fix some typosZhizhen He2023-09-082-246/+246
| | | | | | | | 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: blame, Complete rewrite. Fixes #603Arieh Schneier2023-07-062-0/+81
| | | | Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
* *: Remove use of deprecated io/utilPaulo Gomes2023-05-114-11/+7
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* *: Remove redudant err nil checksPaulo Gomes2023-05-111-4/+1
| | | | Signed-off-by: Paulo Gomes <pjbgf@linux.com>
* plumbing: support SSH/X509 signed tagsHidde Beydals2023-02-274-32/+307
| | | | | | | | | | | | | | | | | | | | | | | | This commit enables support for extracting the SSH and X509 signatures from (annotated) Git tags, as an initial step to support the verification of more signatures than just PGP in go-git. The ported logic from Git further ensures that we look for a signature at the tail of an annotation, instead of the first signature we find in the annotation, as this could theoretically result in a faulty signature getting detected if part of a an annotation itself (e.g. by being placed in the middle as part of an inherited message). For commits, no further change is required as the current extraction of any signature (format) from `gpgsig` in the commit header is sufficient for manual verification. In a future iteration, we could add `signature/ssh` and `signature/x509` packages to further enable people to deal with verifying other signatures than PGP. As well as adding additional methods to `Commit` and `Tag` to provide glue between the packages and the most prominent user-facing APIs. Signed-off-by: Hidde Beydals <hidde@hhh.computer>
* Merge pull request #503 from jfontan/fix/similarity-matrix-too-bigMáximo Cuadros2022-11-171-1/+7
|\ | | | | plumbing: object, rename calculation uses too much memory
| * plumbing: object, rename calculation uses too much memoryJavi Fontan2022-03-301-1/+7
| | | | | | | | | | | | | | The size of the similarity matrix is not limited and can be quite big when lots of files are deleted and added in a commit. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | Optimize zlib reader and consolidate sync.poolsPaulo Gomes2022-11-074-24/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | minor grammatical fixesJon Eskin2022-09-221-1/+1
|/
* Merge pull request #425 from abhinav/error-stringsMáximo Cuadros2021-12-111-2/+2
|\ | | | | error strings: Don't capitalize, use periods, or newlines
| * error strings: Don't capitalize, use periods, or newlinesAbhinav Gupta2021-12-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-101-4/+0
|\ \ | | | | | | Remove unused vars/types/funcs/fields
| * | Remove unused variables/types/functionsAbhinav Gupta2021-11-271-4/+0
| |/ | | | | | | | | | | | | | | [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.
* / simplified sparse checkoutJohn Cai2021-11-091-0/+4
|/ | | | | | | | | 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.
* plumbing: object/patch, printStat strings.Repeat cause panic (#310) cookeem2021-05-121-2/+10
|
* 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)
* Merge pull request #125 from cristaloleg/minor-linter-fixesMáximo Cuadros2020-07-161-1/+1
|\ | | | | *: minor linter fixes
| * Minor linter fixesOleg Kovalov2020-07-061-1/+1
| |
* | Use only one name for receiverOleg Kovalov2020-07-062-20/+20
|/
* fix nilOleg Kovalov2020-07-011-1/+1
|
* fix goreportcard warningsOleg Kovalov2020-07-017-13/+14
|
* plumbing: object, Commit.Patch support to as nilMáximo Cuadros2020-05-133-4/+27
|
* performed explicit conversions(needed)vashish12020-05-081-4/+4
|
* plumbing: exact renames detection could leave gaps in the changesMiguel Molina2020-05-042-8/+30
| | | | | | | | | This fixes an issue where exact renames detection could leave gaps with nil changes in the added and deleted change slices. That could lead to panics in the content rename detection and others if the user had set OnlyExact to true. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* Merge pull request #49 from gopye/fix_patch_commentMáximo Cuadros2020-04-301-1/+1
|\ | | | | Remove unnecessary text from comment
| * Remove unnecessary text from commentgopye2020-04-291-1/+1
| |
* | Merge pull request #44 from tzneal/mine/fix-32-bit-buildMáximo Cuadros2020-04-301-1/+1
|\ \ | | | | | | fix 32 bit build
| * | fix 32 bit buildTodd Neal2020-04-271-1/+1
| |/ | | | | | | Discovered while building on a Raspberry Pi
* / Fix typo in comment of func TestCancelgopye2020-04-271-1/+1
|/
* plumbing: object, make renames diff defaultMáximo Cuadros2020-04-253-16/+55
|
* plumbing: detect renames by hash and similar content in diff treeMiguel Molina2020-04-234-4/+1374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements the rename detection algorithms used in the JGit implementation. Given a list of changes, additions and deletions are extracted and matched in two ways: - By exact hash content: all additions and deletions are grouped by the content hash and paired with the best match based on the file mode and file path. All the files that cannot be paired are kept as regular deletions and additions. - By similar content: a matrix of addition and deletion pairs with all possible combinations is created and scored by how similar the content is between both files as well as how similar the file path is. The pairs with the best score and whose score is equal or greater than a threshold are paired and turned into a rename. All the files that cannot be paired are kept as regular deletions and additions. DiffTree and DiffTreeContext will not return the changes with renames detected for compatibility reasons, although this will change in v6 so that detecting renames is the default behaviour. A new function DiffTreeWithOptions has been added to configure the parameters for the rename detection to control the score threshold, the limit of renames and whether to use similar content detection in the detection. More information: - https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java - https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java - https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* *: migration from go-git-fixtures/v4 and go-git/gcfgMáximo Cuadros2020-03-1014-34/+28
|