aboutsummaryrefslogtreecommitdiffstats
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
* plumbing: detect renames by hash and similar content in diff treeMiguel Molina2020-04-231-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 gopkg to go modulesMáximo Cuadros2020-03-1022-40/+40
|
* Fix typos in comments, variables and function namesOleksandr Redko2019-10-246-12/+12
| | | | Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
* format: diff, Handle no newline at end of file. Fixes #936Stuart Jansen2019-10-131-0/+31
| | | | Signed-off-by: Stuart Jansen <sjansen@buscaluz.org>
* *: avoid unnecessary conversionsChristian Muehlhaeuser2019-07-292-3/+3
| | | | | | | No need to convert these values, they're already of the right type. Signed-off-by: Christian Muehlhaeuser <muesli@gmail.com> (cherry picked from commit a1d8a7ac8bd0e4aff0f27dbb8bb37b8bd13a1346)
* utils: binary reader, add ReadUntilFromBufioReader()Arran Walker2019-04-222-6/+22
| | | | Signed-off-by: Arran Walker <arran.walker@fiveturns.org>
* plumbing: format/index perf, buffered reads, reflection removalArran Walker2019-04-211-0/+9
| | | | | | | | | | Large performance increase by buffering reads. There were a few instances where binary.Read() would end up using reflection on &plumbing.Hash, rather than treating it as a byte slice. This has now been resolved. Signed-off-by: Arran Walker <arran.walker@fiveturns.org>
* Add diff.DoWithTimeout()Vadim Markovtsev2019-03-131-2/+16
| | | | Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
* Increase diffmatchcpatch timeoutVadim Markovtsev2019-03-101-0/+2
| | | | | | Fixes https://github.com/src-d/go-git/issues/1083 Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
* Remove Unicode normalization in difftreeVadim Markovtsev2019-02-113-10/+31
| | | | | | Fixes #1057 Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
* Merge pull request #874 from smola/patchcontextv4.5.0Máximo Cuadros2018-07-102-0/+82
|\ | | | | plumbing: add context to allow cancel on diff/patch computing
| * plumbing: add context to allow cancel on diff/patch computingMarc Barussaud2018-07-022-0/+82
| | | | | | | | Signed-off-by: Marc Barussaud <marc.barussaud@orange.com>
* | utils: diff, skip useless rune->string conversionMarc Barussaud2018-06-261-2/+2
|/ | | | | | | According to library documentation : https://github.com/sergi/go-diff/blob/master/diffmatchpatch/diff.go#L391 Signed-off-by: Marc Barussaud <marc.barussaud@orange.com>
* update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-232-3/+4
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* examples,plumbing,utils: typo fixesferhat elmas2017-11-204-7/+7
|
* utils: merkletrie, filesystem fix symlinks to dirMáximo Cuadros2017-11-201-0/+36
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Fix support for dir symlinksDmitry Frank2017-11-101-0/+4
|
* worktree: normalized string comparison testsMáximo Cuadros2017-08-021-1/+11
|
* Normalize filenames before comparing.Josh Betz2017-07-311-1/+7
| | | | | | | | | Some multibyte characters can have multiple representations. Before comparing strings, we need to normalize them. In this case we're normalizing to normalized form C, but it shouldn't matter as long as both strings are normalized to the same form. Fixes https://github.com/src-d/go-git/issues/495
* format: idxfile, support for >2Gb packfilesMáximo Cuadros2017-07-272-1/+17
|
* ioutil: Context and OnError helpersMáximo Cuadros2017-07-252-1/+197
|
* utils: merkletrie filesystem based on path, and not in filepathMáximo Cuadros2017-07-193-14/+14
|
* utils: merkletrie fix test on windowsMáximo Cuadros2017-07-182-16/+23
|
* remote: fix Worktree.Status on empty repositoryMáximo Cuadros2017-07-132-2/+13
|
* utils: merkletrie support for symlinksMáximo Cuadros2017-06-182-6/+54
|
* *: upgrade to go-billy.v3, mergeMáximo Cuadros2017-06-182-5/+5
|
* format/diff: unified diff encoder and public APIAntonio Jesus Navarro Perez2017-05-232-0/+55
| | | | | | | | | - 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
* *: applying new index.Index changesMáximo Cuadros2017-04-262-9/+13
|
* fix format string issues as found by go vetSantiago M. Mola2017-04-263-5/+5
|
* worktree: reset and checkout support for submodulesMáximo Cuadros2017-04-152-12/+81
|
* merkletrie: filesystem and index speedup and documentationMáximo Cuadros2017-04-114-211/+179
|
* merkletrie: node support for billy filesystemsMáximo Cuadros2017-04-112-0/+255
|
* merkletrie: node support for index fileMáximo Cuadros2017-04-112-0/+229
|
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-0718-25/+25
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* Return values of Read not checked (fix #65)Antonio Jesus Navarro Perez2017-03-021-1/+1
|
* Fix issue 275 (edited) (#276)Alberto Cortés2017-02-228-81/+302
| | | | | | | | | Fix #275 . It was not possible to write a test for this issue as the original fsnoder didn't support filenames with length > 1. Therefore this patch has 3 commits: add support for long filenames in fsnoder. add a test case for the issue using the new long filenames from step 1. fix the issue by comparing paths level by level instead of lexigographically over the whole path.
* merkletrie: fix const action type fuck up (#268)Alberto Cortés2017-02-142-1/+12
| | | | Action constants (Insert, Delete, Modify) have type int instead of Action. This patch make them Actions.
* simplify noder mocks in test (#265)Alberto Cortés2017-02-132-18/+4
|
* add difftree for noders (#262)Alberto Cortés2017-02-137-13/+1246
| | | | | difftree for noders
* Merge pull request #259 from smola/docsMáximo Cuadros2017-02-082-14/+27
|\ | | | | Improve documentation
| * doc: improve ioutil.CheckClose doc and example, fix #246.Santiago M. Mola2017-02-062-14/+26
| | | | | | | | | | | | * Use a proper executable example, instead of one in the comment. * Improve wording of CheckClose godoc.
| * doc: add package documentation for utils/ioutil, fix #246.Santiago M. Mola2017-02-061-0/+1
| |
* | add merkletrie iterator and its helper frame type (#252)Alberto Cortés2017-02-064-0/+873
|/ | | | | | | | * add merkletrie iterator and its helper frame type * requested changes by mcuadros * reuqested changes: smola
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-309-9/+9
|
* delete old noder, create a new one in utils (#241)Alberto Cortés2017-01-3011-0/+1466
|
* Extract billy (#173)Sergio Arbeo2016-12-196-1148/+0
| | | | | | | | | | | | | | | * Extract billy Billy is a new library directly extracted from go-git. It abstract several storages systems in a filesystem interface. More in github.com/src-d/billy * Fix grouping in imports block * Update billy to v1 * Re-remove fs_implementation example
* move plumbing from top level package to plumbing (#183)Santiago M. Mola2016-12-144-0/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* format/packfile: implement delta encoding (#172)Antonio Navarro Perez2016-12-142-0/+30
| | | | | | | | | | | | * format/packfile: implement delta encoding - Added all the logic to the encoder to be able to encode ref-delta and offset-delta objects - Created plumbing.ObjectToPack to handle deltas and standard objects when we are writting them into a packfile - Added specific encoder delta tests, one standard object and one delta, and one standard object and two deltas * Requested changes. * Requested changes
* transport: new git protocol (#175)Máximo Cuadros2016-12-121-0/+12
|
* revision based on goreportcard.comMáximo Cuadros2016-12-061-1/+1
|