aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/revlist
Commit message (Collapse)AuthorAgeFilesLines
* revlist: add `ObjectsWithStorageForIgnores` methodJeremy Stribling2019-02-112-2/+40
| | | | | | | | | | | `ObjectsWithStorageForIgnores` is the same as `Objects`, but a secondary storage layer can be provided, to be used to finding the full set of objects to be ignored while finding the reachable objects. This is useful when the main `s` storage layer is slow and/or remote, while the ignore list is available somewhere local. Issue: #909 Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* Expose Storage cache.kuba--2018-09-071-7/+5
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* all: gofmt -sferhat elmas2017-11-301-1/+1
|
* update to go-billy.v4 and go-git-fixtures.v3Máximo Cuadros2017-11-231-1/+1
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* revlist: do not revisit ancestors as long as all branches are visitedMiguel Molina2017-09-122-3/+84
| | | | | | | | | | This change is the fixed version of the previous performance improvement that was reverted due to some bogus logic. Now it's fixed and only stops the iteration if and only if all of the branches we've come across have been visited, being a branch a parent commit of a commit we've visited. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* plumbing: the commit walker can skip externally-seen commitsJeremy Stribling2017-09-091-1/+1
| | | | | | | | | | When the revlist is computing the set of hashes needed to transfer, it doesn't need to walk over commits it has already processed. So, it can instruct the commit walker not to walk those commits by passing in its own `seen` map. For a 36K object repo, this brought the time for `revlist.Objects` down from 50s to 30s.
* revert: revlist: do not revisit already visited ancestorsMiguel Molina2017-09-081-17/+3
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* revlist: do not visit again already visited parentsMiguel Molina2017-09-051-11/+38
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* plumbing: use `seen` map in tree walkerJeremy Stribling2017-08-271-1/+1
| | | | | | | This helps avoids iterating down the same trees for every commit. For a big-ish repo with 35K objects (17K commits), this reduced the time for calling `revlist.Objects` during a push (with 0 hashes to ignore) from more than ten minutes to less than a minute.
* revlist: ignore all objects reachable from ignored objectsSantiago M. Mola2017-07-271-1/+28
| | | | | | | Usually we call revlist.Objects ignoring a set of commits. This is not enough to ignore everything reachable from such set, so we first get all objects reachable from the ignored set and then walk the tree again ignoring that new set.
* repository: allow push from shallow repositoriesMáximo Cuadros2017-07-191-20/+19
|
* revlist: ignore treeEntries that are submodules.Antonio Jesus Navarro Perez2017-06-192-1/+24
| | | | - If we don't ignore submodules in trees, when we tried to perform a push, revlist.Objects returned hashes that was from submodules, causing an "object not found" error in packfile generation.
* fix naming of NewCommit{Pre,Post}IteratorSantiago M. Mola2017-06-131-1/+1
| | | | | Use Iter suffix, just as all other iterators in the project. Use Preorder and Postorder to be more clear.
* Add Repository.Log() method (fix #298)Antonio Jesus Navarro Perez2017-04-111-11/+12
| | | | | | | | | | - 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.
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-072-7/+7
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* plumbing/revlist: input as a slice of hashes instead of commitsAntonio Jesus Navarro Perez2017-02-272-64/+136
| | | | | | | - Now the input of the method Objects inside revlist package is a slice of hashes instead of commits. Hashes can be from Blobs, Trees and Commits objects. - ObjectStorer now is used to obtain the object content using hashes slice. - This PR fix #222. Now a test into upload_pack_test.go file is not skipped anymore. - Remove code from remote.go and server.go that is not necessary.
* package plumbing documentation improvements (#248)Máximo Cuadros2017-02-071-2/+2
|
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-302-7/+7
|
* new git fixture pathMáximo Cuadros2017-01-301-1/+1
|
* move plumbing from top level package to plumbing (#183)Santiago M. Mola2016-12-142-0/+278
* 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.