aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object
Commit message (Collapse)AuthorAgeFilesLines
* Improve error handling logicAntonio Jesus Navarro Perez2019-02-131-4/+4
| | | | Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* Ignore missing references on log --allAntonio Jesus Navarro Perez2019-02-121-11/+23
| | | | | | To mimic the actual standard git behavior, we must ignore references that are pointing to wrong/unexistent objects. Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* Refine Log.kuba--2019-01-102-92/+109
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* First lookup if hash exists, then GetCommit.kuba--2019-01-081-6/+6
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* Implement git log --allkuba--2019-01-072-3/+148
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* tree: add a Size() method for getting plaintext sizeJeremy Stribling2018-10-112-0/+17
| | | | | | Without reading the entire object into memory. Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* Plumbing: object, Add support for Log with filenames. Fixes #826 (#979)Nithin Gangadharan2018-10-111-0/+115
| | | plumbing: object, Add support for Log with filenames. Fixes #826
* Merge branch 'master' of github.com:src-d/go-git into f-add-tagging-supportMáximo Cuadros2018-09-1011-37/+75
|\
| * Expose Storage cache.kuba--2018-09-079-30/+24
| | | | | | | | Signed-off-by: kuba-- <kuba@sourced.tech>
| * Merge pull request #939 from ↵Máximo Cuadros2018-09-042-2/+6
| |\ | | | | | | | | | | | | keybase/taruti/cherrypick-for-upstream-clamp-object-timestamp Clamp object timestamps before unix epoch to unix epoch
| | * plumbing: object: Clamp object timestamps before unix epoch to unix epochTaru Karttunen2018-08-292-2/+6
| | | | | | | | | | | | Signed-off-by: Taru Karttunen <taruti@taruti.net>
| * | object: fix panic when reading object headerJavi Fontan2018-08-172-5/+45
| |/ | | | | | | | | | | | | | | 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 extra newline on PGP signatureChris Marchesi2018-08-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tag encoding/decoding seems to be a lot more sensitive to requiring the exact expected format in the object, which generally includes messages canonicalized so that they have a newline on the end (even if they didn't before). As such, the message should be written with the newline (no need for an extra), and the PGP signature right after that, which will be newline split already, so there's no need to split it again. All of this means it's very important for the caller to send the message in the correct format - which I'm correcting in the next commit. Signed-off-by: Chris Marchesi <chrism@vancluevertech.com>
* | plumbing: object, correct tag PGP encodingChris Marchesi2018-08-211-7/+3
|/ | | | | | | | As with the update in ec3d2a8, tag encoding needed to be corrected to ensure extra newlines were not being added in during tag object encoding, so that it did not corrupt the object for verification. Signed-off-by: Chris Marchesi <chrism@vancluevertech.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>
* Merge pull request #906 from src-d/perf/packfile-readsMáximo Cuadros2018-08-143-16/+28
|\ | | | | Improve packfile reading performance
| * plumbing: packfile, open and close packfile on FSObject readsMiguel Molina2018-08-091-7/+0
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
| * storage: filesystem, close Packfile after iterating objectsMiguel Molina2018-08-091-0/+7
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
| * *: use parser to populate non writable storages and bug fixesMiguel Molina2018-08-073-16/+28
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | plumbing/object: fix pgp signature encoder/decoderJavi Fontan2018-07-182-18/+45
|/ | | | | | | | | | | | | | | | | | 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>
* Merge pull request #885 from jsravn/findentry-return-file-not-foundMáximo Cuadros2018-07-162-3/+8
|\ | | | | plumbing: object, return ErrFileNotFound in FindEntry. Fixes #883
| * plumbing: object, expose ErrEntryNotFound in FindEntry. Fixes #883James Ravn2018-07-102-3/+8
| | | | | | | | | | | | | | | | | | FindEntry will return ErrDirNotFound if the directory doesn't exist. But it doesn't return a public error if the entry itself is missing. This exposes the internal error ErrEntryNotFound, so users can programmatically check for this condition. Signed-off-by: James Ravn <james@r-vn.org>
* | plumbing: add context to allow cancel on diff/patch computingMarc Barussaud2018-07-027-9/+215
|/ | | | Signed-off-by: Marc Barussaud <marc.barussaud@orange.com>
* plumbing: object, adds tree path cache to trees. Fixes #793Javi Fontan2018-06-061-1/+26
| | | | | | The cache is used in Tree.FindEntry for faster path search. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* *: Use CheckClose with named returnsJavi Fontan2018-03-275-7/+8
| | | | | | | | 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>
* add tests for NewCommitIterCTime and NewCommitIterBSFSaeed Rasooli2018-03-061-0/+96
| | | | Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* add LogOrder, LogOptions.Order, implement Order=LogOrderCommitterTime and ↵Saeed Rasooli2018-03-052-0/+203
| | | | | | Order=LogOrderBSF Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
* object: patch, test patch on submodulesMáximo Cuadros2017-12-071-0/+44
|
* Ignore empty patches when calculating stats (fixes #654)Alexandr Krylovskiy2017-12-041-0/+5
|
* all: gofmt -sferhat elmas2017-11-304-4/+4
|
* all: fixes for ineffective assignferhat elmas2017-11-261-0/+1
|
* plumbing: object/{commit,tag}, encode method with sig optionalSunny2017-11-242-11/+14
| | | | | Adds Commit.encode() and Tag.encode() with optional `includeSig` parameter to include or exclude signature from the encoded object.
* plumbing: object/tag, add signature verificationSunny2017-11-242-0/+94
|
* plumbing: object/tag, add PGPSignature supportSunny2017-11-242-1/+69
|
* test: plumbing/object fix Commit.Verify testSunny2017-11-241-2/+3
| | | | | Test was failing because of the relative time zone attached to the commit. Adding a fixed location to the time fixes the issue.
* Merge pull request #653 from darkowlzz/verify-commitMáximo Cuadros2017-11-242-0/+95
|\ | | | | plumbing: object, new Commit.Verify method
| * test: plumbing.object, add test for Commit.VerifySunny2017-11-231-0/+65
| |
| * plumbing: object, add Commit.Verify methodSunny2017-11-231-0/+30
| | | | | | | | | | Commit.Verify() performs PGP verification of a signed commit given an armored keyring.
* | update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-238-8/+8
| | | | | | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* | plumbing/object: add test for finding tree entryferhat elmas2017-11-221-0/+37
| |
* | plumbing/object: do not eat error on tree decodeferhat elmas2017-11-211-2/+2
|/
* examples,plumbing,utils: typo fixesferhat elmas2017-11-202-2/+2
|
* Merge pull request #534 from josharian/firstparentMáximo Cuadros2017-11-202-0/+24
|\ | | | | plumbing: object, commit.Parent() method
| * plumbing: object, commit.Parent() methodMáximo Cuadros2017-11-202-6/+19
| | | | | | | | 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-083-0/+167
|\ \ | | | | | | Add Stats() to Commit
| * | Add Stats() to Patch and fix diffstat outputSunny2017-11-023-53/+130
| | |
| * | Add Stats() to CommitSunny2017-11-022-0/+90
| | | | | | | | | | | | 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-292-0/+69
| | | | | | | | | | | | | | | | | | * 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