aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commit.go
Commit message (Collapse)AuthorAgeFilesLines
* Optimize zlib reader and consolidate sync.poolsPaulo Gomes2022-11-071-4/+3
| | | | | | | | | | | | | | | | | | | 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>
* *: replace golang.org/x/crypto/openpgp by ↵Johan Fleury2021-04-061-2/+2
| | | | github.com/ProtonMail/go-crypto/openpgp (#283)
* Use only one name for receiverOleg Kovalov2020-07-061-12/+12
|
* plumbing: object, Commit.Patch support to as nilMáximo Cuadros2020-05-131-3/+6
|
* plumbing: object, make renames diff defaultMáximo Cuadros2020-04-251-0/+6
|
* *: migration from gopkg to go modulesMáximo Cuadros2020-03-101-3/+3
|
* plumbing/object: avoid O(N^2) string building when decoding commit messageDavid Symonds2020-03-101-2/+5
| | | | | | | | | | | Most commits have relatively small messages, so this was never noticeable. However, there are some repositories that have semi-automated messages that can get very large (e.g. github.com/riscv/riscv-clang and its riscv-trunk branch), on the order of 109k lines. Changing from string += to using a bytes.Buffer reduces the time for Commit.Decode for that specific case from 35s to 74ms. Signed-off-by: David Symonds <dsymonds@golang.org>
* plumbing: object/{commit,tag} add EncodeWithoutSignature, Implement #1116Antoine GIRARD2019-04-241-1/+6
| | | | Signed-off-by: Antoine GIRARD <sapk@sapk.fr>
* plumbing: TreeWalker performance improvement, bufio pool for objectsArran Walker2019-04-221-1/+3
| | | | | | | | | Removes path.Clean and path.Join, as they're expensive in comparison to basic string manipulation that can be used here. Adds bufio.Buffer pool to be used by tag, tree and commit object decoding. Signed-off-by: Arran Walker <arran.walker@fiveturns.org>
* plumbing: commit.StatsContext and fix for orphan commit (#1115)v4.11.0Máximo Cuadros2019-04-181-15/+23
| | | plumbing: commit.StatsContext and fix for root commit
* object: fix panic when reading object headerJavi Fontan2018-08-171-5/+11
| | | | | | | | When the first line of the pgp signature is an empty line or some header is malformed it crashes as there's no data for the header element. For example, if author name is "\n". Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing: object, Don't add new line at end of commit signatureChris Marchesi2018-08-161-7/+7
| | | | | | | | | | The way that commit signatures were being written out was causing an extra newline to be written at the end of the commit when the message encoding was already taking care of this. Ultimately, this results in a corrupt object, rendering the object unverifiable with the signature in the commit. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* plumbing/object: fix pgp signature encoder/decoderJavi Fontan2018-07-181-18/+13
| | | | | | | | | | | | | | | | | | The way of reading pgp signatures was searching for pgp begin line in the header. This caused problems when this string appeared and was not part of the signature. For example if it appears in the message as an example or is part of the author name the decoder starts treating it as a signature. In this state the code was not able to notice then the header ended so it entered in an infinite loop searching for pgp end string. Now it uses the same method as original git. Searches for gpgsig section in header and starts getting all lines until the next part. In encoder the string used to add signatures was incorrect. It is now changed to the proper "gpgsig" string instead of "pgpsig". Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing: add context to allow cancel on diff/patch computingMarc Barussaud2018-07-021-2/+9
| | | | Signed-off-by: Marc Barussaud <marc.barussaud@orange.com>
* *: Use CheckClose with named returnsJavi Fontan2018-03-271-1/+1
| | | | | | | | Previously some close errors were losts. This is specially problematic in go-git as lots of work is done here like generating indexes and moving packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing: object/{commit,tag}, encode method with sig optionalSunny2017-11-241-6/+7
| | | | | Adds Commit.encode() and Tag.encode() with optional `includeSig` parameter to include or exclude signature from the encoded object.
* plumbing: object, add Commit.Verify methodSunny2017-11-231-0/+30
| | | | | Commit.Verify() performs PGP verification of a signed commit given an armored keyring.
* Merge pull request #534 from josharian/firstparentMáximo Cuadros2017-11-201-0/+12
|\ | | | | plumbing: object, commit.Parent() method
| * plumbing: object, commit.Parent() methodMáximo Cuadros2017-11-201-6/+7
| | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
| * plumbing/object: add Commit.FirstParentJosh Bleecher Snyder2017-08-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | First parents are somewhat special in git. There's even a --first-parent flag to 'git log'. Add a helper method to look them up. This avoids boilerplate and spares the client from having to arrange for a handle to the Storer, which is stored in the unexported field Commit.s.
* | Merge pull request #613 from darkowlzz/482-commit-statsMáximo Cuadros2017-11-081-0/+26
|\ \ | | | | | | Add Stats() to Commit
| * | Add Stats() to Patch and fix diffstat outputSunny2017-11-021-52/+12
| | |
| * | Add Stats() to CommitSunny2017-11-021-0/+66
| | | | | | | | | | | | Stats() is similar to `git show --stat <hash>`.
* | | Updating reference to the git object modelAntonio Troina2017-11-071-1/+1
|/ /
* | Add support for signed commits (#616)Sunny2017-10-291-0/+43
| | | | | | | | | | | | | | | | | | * Add support for signed commits This change adds `GPGSignature` field to `Commit` object. This is used to store the signature of the commit, if any. * Rename gpg to pgp
* | grammar correctionZach Gershman2017-08-241-1/+1
|/ | | *stopped instead of stop
* format/diff: unified diff encoder and public APIAntonio Jesus Navarro Perez2017-05-231-0/+15
| | | | | | | | | - Added Patch interface - Added a Unified Diff encoder from Patches - Added Change method to generate Patches - Added Changes method to generate Patches - Added Tree method to generate Patches - Added Commit method to generate Patches
* worktree: Commit, tests improvementsMáximo Cuadros2017-05-041-2/+2
|
* plumbing: MemoryObject.Writer tracks his own sizeMáximo Cuadros2017-05-041-0/+9
|
* plumbing: object.Tree making public `tree` and `parents`Máximo Cuadros2017-05-011-10/+12
|
* Add Repository.Log() method (fix #298)Antonio Jesus Navarro Perez2017-04-111-48/+17
| | | | | | | | | | - CommitIter is now an interface - The old CommitIter implementation is now called StorerCommitIter - CommitWalker and CommitWalkerPost are now iterators (CommitPreIterator and CommitPostIterator). - Remove Commit.History() method. There are so many ways to iterate a commit history, depending of the use case. Now, instead of use the History() method, you must use CommitPreIterator or CommitPostIterator. - Move commitSorterer to references.go because is the only place that it is used, and it must not be used into another place. - Make References method private, it must only be used into blame logic. - Added a TODO into references method, where the sortCommits is used to remove it in a near future.
* plumbing: Use ReadBytes() rather than ReadSlice()Nick Thomas2017-03-271-1/+1
|
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-071-3/+3
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* doc: add object fields godocSantiago M. Mola2017-02-071-3/+8
|
* doc: improve object iterators godoc.Santiago M. Mola2017-02-071-8/+10
|
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-301-3/+3
|
* Fix some typos in plumbing docs (#244)Sergio Arbeo2017-01-301-3/+3
|
* move plumbing from top level package to plumbing (#183)Santiago M. Mola2016-12-141-0/+293
* plumbing: rename Object -> EncodedObject. * plumbing/storer: rename ObjectStorer -> EncodedObjectStorer. * move difftree to plumbing/difftree. * move diff -> utils/diff * make Object/Tag/Blob/Tree/Commit/File depend on storer. * Object and its implementations now depend only on storer.EncodedObjectStorer, not git.Repository. * Tests are decoupled accordingly. * move Object/Commit/File/Tag/Tree to plumbing/object. * move Object/Commit/File/Tag/Tree to plumbing/object. * move checkClose to utils/ioutil. * move RevListObjects to plumbing/revlist.Objects. * move DiffTree to plumbing/difftree package. * rename files with plural nouns to singular * plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.