aboutsummaryrefslogtreecommitdiffstats
path: root/utils/merkletrie/difftree.go
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-101-1/+1
|
* Fix typos in comments, variables and function namesOleksandr Redko2019-10-241-5/+5
| | | | Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
* plumbing: add context to allow cancel on diff/patch computingMarc Barussaud2018-07-021-0/+21
| | | | Signed-off-by: Marc Barussaud <marc.barussaud@orange.com>
* examples,plumbing,utils: typo fixesferhat elmas2017-11-201-1/+1
|
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-071-1/+1
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* Fix issue 275 (edited) (#276)Alberto Cortés2017-02-221-2/+1
| | | | | | | | | 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.
* add difftree for noders (#262)Alberto Cortés2017-02-131-0/+404
difftree for noders