aboutsummaryrefslogtreecommitdiffstats
path: root/storage
Commit message (Collapse)AuthorAgeFilesLines
...
* | storage/filesystem: Added reindex method to reindex packfilesJavier Peletier2018-11-122-0/+61
|/ | | | Signed-off-by: Javier Peletier <jm@epiclabs.io>
* filesystem: add a new test for EncodedObjectSizeJeremy Stribling2018-10-122-3/+15
| | | | | | Suggested by taruti. Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* object: get object size without reading whole objectJeremy Stribling2018-10-113-0/+109
| | | | Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* storage/filesystem: add more doc to NewPackfileIterJavi Fontan2018-09-211-4/+7
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/filesystem: keep packs open in PackfileIterJavi Fontan2018-09-202-14/+63
| | | | | | | | PackfileIter was not taking into account the option KeepDescriptors and was always closing the file. This caused "file already closed" errors when iterating packfiles in with KeepDescriptors active. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Expose Storage cache.kuba--2018-09-076-60/+41
| | | | Signed-off-by: kuba-- <kuba@sourced.tech>
* storage/filesystem: compare files using offset in testJavi Fontan2018-09-062-3/+20
| | | | | | | | Using equals to compare files it uses diff to do so. This can potentially consume lots of ram. Changed the comparison to use file offsets. If the descriptor is reused the offset is maintained. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/filesystem: add KeepDescriptors testJavi Fontan2018-09-052-3/+31
| | | | | | Also delete Close from MockObjectStorage and memory storer. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/dotgit: add KeepDescriptors optionJavi Fontan2018-09-045-2/+86
| | | | | | | | | | This option maintains packfile file descriptors opened after reading objects from them. It improves performance as it does not have to be opening packfiles each time an object is needed. Also adds Close to EncodedObjectStorer to close all the files manualy. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/dotgit: add ExclusiveAccess tests in dotgitJavi Fontan2018-09-041-0/+24
| | | | | | | | This functionality was already tested in storage/filesystem. The coverage tool only takes into account files from the same package of the test. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/filesystem: move Options to filesytem and dotgitJavi Fontan2018-09-034-25/+50
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/filesystem: make Storage options privateJavi Fontan2018-09-031-2/+2
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing/storer: rename Static option to ExclusiveAccessJavi Fontan2018-08-312-6/+6
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* dotgit: fix typo in commentJavi Fontan2018-08-301-1/+1
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* git, storer: use a common storer.Options for storer and PlainOpenJavi Fontan2018-08-303-29/+17
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* git: add Static option to PlainOpenJavi Fontan2018-08-303-6/+221
| | | | | | | | | | | | | | | | Also adds Static configuration to Storage and DotGit. This option means that the git repository is not expected to be modified while open and enables some optimizations. Each time a file is accessed the storer tries to open an object file for the requested hash. When this is done for a lot of objects it is expensive. With Static option a list of object files is generated the first time an object is accessed and used to check if exists instead of using system calls. A similar optimization is done for packfiles. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/dotgit: use HasPrefix instead of SplitJavi Fontan2018-08-271-6/+9
| | | | | | Also reformatted function comment and fixed some typos. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage/dotgit: search for incoming dir only onceJavi Fontan2018-08-251-13/+28
| | | | | | | | | Search for incoming object directory was done once each time objects were accessed. This means a ReadDir of the objects path that is expensive. Now incoming directory is searched the first time an object is accessed and its name kept in DotGit to be reused. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing, storage: add bases to the common cacheJavi Fontan2018-08-221-2/+16
| | | | | | | | | | | | After clone only resolved deltas were added to the cache. This caused slowdowns in small repositories where most objects can be held in cache. It also makes packfiles reuse delta cache from the store. Previously it created a new delta cache each time a packfile object was created. This also slowed down a bit accessing objects and had an impact on memory consumption when bases are added to the cache. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Merge pull request #887 from noxora/hook-supportMáximo Cuadros2018-08-212-3/+101
|\ | | | | added support for quarantine directory
| * dotgit: fix object delete testSantiago M. Mola2018-08-171-14/+18
| | | | | | | | Signed-off-by: Santiago M. Mola <santi@mola.io>
| * added hook supportnoxora2018-08-162-4/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: noxora <ldecker@indeed.com> trying a possible fix to the delete test Signed-off-by: noxora <ldecker@indeed.com> still trying to fix this test Signed-off-by: noxora <ldecker@indeed.com> fixes did not work, seems to be a windows env problem Signed-off-by: noxora <ldecker@indeed.com>
* | plumbing: packfile, open and close packfile on FSObject readsMiguel Molina2018-08-093-12/+48
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | storage: filesystem, add PackfileIter benchmark reading object contentMiguel Molina2018-08-091-0/+67
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | storage: filesystem, close Packfile after iterating objectsMiguel Molina2018-08-091-1/+10
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | storage: filesystem, benchmark PackfileIterMiguel Molina2018-08-092-15/+94
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | plumbing: packfile, allow non-seekable sources on ParserMiguel Molina2018-08-081-1/+6
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | *: use parser to populate non writable storages and bug fixesMiguel Molina2018-08-072-48/+35
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | plumbing: packfile, fix package testsMiguel Molina2018-07-301-10/+0
| | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | storage/filesystem: remove duplicated IndexStorageJavi Fontan2018-07-271-15/+0
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | Merge pull request #899 from erizocosmico/feature/new-packfileMiguel Molina2018-07-272-0/+25
|\ \ | | | | | | plumbing: packfile, new Packfile representation
| * | plumbing: packfile, lazy object reads with DiskObjectsMiguel Molina2018-07-271-0/+10
| | | | | | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
| * | plumbing: packfile, new Packfile representationMiguel Molina2018-07-261-0/+15
| | | | | | | | | | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* | | storage/filesystem: add back IndexStorageJavi Fontan2018-07-271-0/+47
|/ / | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | plumbing, storage: integrate new indexJavi Fontan2018-07-263-36/+46
| | | | | | | | | | | | Now dotgit.PackWriter uses the new packfile.Parser and index. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | plumbing/format/idxfile: add new Index and MemoryIndexMiguel Molina2018-07-192-48/+1
|/ | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* storage/filesystem: avoid norwfs build flagSantiago M. Mola2018-06-215-94/+82
| | | | | | | | | | | | | | | | | norwfs build flag was used to work on filesystems that do not support neither opening a file in read/write mode or renaming a file (e.f. sivafs). This had two problems: - go-git could not be compiled to work properly both with regular filesystems and limited filesystems at the same time. - the norwfs trick was not available on Windows. This PR removes the norwfs build flag, as well as the windows conditional flag on the dotgit package. For the file open mode, we use the new billy capabilities, to check at runtime if the filesystem supports opening a file in read/write mode or not. For the renaming, we just try and fallback to alternative methods if billy.ErrNotSupported is returned. Signed-off-by: Santiago M. Mola <santi@mola.io>
* storage: filesystem, make ObjectStorage constructor publicMiguel Molina2018-06-083-8/+9
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* dotgit: Move package outside internal.Antonio Jesus Navarro Perez2018-06-0518-9/+9
| | | | Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
* storage: filesystem, close shallow file when readMáximo Cuadros2018-04-171-0/+2
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* Merge pull request #807 from keybase/strib/src-d-ignore-non-hash-filesMáximo Cuadros2018-04-172-3/+23
|\ | | | | dotgit: ignore filenames that don't match a hash
| * dotgit: add test for bad file in pack directoryJeremy Stribling2018-04-161-1/+13
| | | | | | | | | | | | | | Suggested by mcuadros. Issue: src-d/go-git#807 Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
| * dotgit: ignore filenames that don't match a hashJeremy Stribling2018-04-131-2/+10
| | | | | | | | | | | | | | For both packfiles and object files. Issue: keybase/client#11366 Signed-off-by: Jeremy Stribling <strib@alum.mit.edu>
* | storage: dotgit, init fixtures in benchmark. Fixes #770Javi Fontan2018-04-161-0/+1
|/ | | | | | | fixtures is not initialized in BenchmarkRefMultipleTimes and caused panic. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* storage: filesystem/dotgit, fix typo in return paramJavi Fontan2018-03-281-1/+1
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* *: Use CheckClose with named returnsJavi Fontan2018-03-275-15/+15
| | | | | | | | 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>
* storage/filesystem: optimize packfile iteratorDenys Smirnov2018-03-031-22/+61
| | | | | | | | * do not store extra bool values in the seen map * open packfile iterators lazily Signed-off-by: Denys Smirnov <denys@sourced.tech>
* all: remove some unused codeDaniel Martí2018-03-011-2/+0
| | | | Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
* storage/filesystem/shallow: fix error checkingferhat elmas2018-02-011-1/+1
| | | | Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
* gofmt -sMáximo Cuadros2018-01-251-1/+1
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>