aboutsummaryrefslogtreecommitdiffstats
path: root/storage
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* Merge pull request #700 from jfontan/improvement/support-non-rw-filesystemsMáximo Cuadros2018-01-026-33/+142
|\ | | | | Add a setRef and rewritePackedRefsWhileLocked versions that supports non rw fs
| * Add norwfs version of rewritePackedRefsWhileLockedJavi Fontan2017-12-224-4/+50
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Check reference also in norwfs SetRefJavi Fontan2017-12-221-2/+25
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Add comment to the norwfs version of SetRefJavi Fontan2017-12-211-0/+7
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
| * Add a setRef version that supports non rw fsJavi Fontan2017-12-213-29/+62
| | | | | | | | | | | | | | | | | | There are some filesystems that do not support opening the files in read and write modes at the same time. The method SetRef is split in files with an extra version that only writes the reference. It can be activated with -tags norwfs on building. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | Make DeltaBaseCache privateJavi Fontan2017-12-201-6/+6
| | | | | | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* | Enforce the use of cache in packfile decoderJavi Fontan2017-12-201-5/+2
|/ | | | | | | | | | | | | | | | | Decoder object can make use of an object cache to speed up processing. Previously the only way to specify it was changing manually the struct generated by NewDecodeForFile. This lead to some instances to be created without it and penalized performance. Now the cache should be explicitly passed to the constructor function. NewDecoder now creates objects with a cache using the default size. A new helper function was added to create cache objects with the default size as this becomes a common task now: cache.NewObjectLRUDefault() Signed-off-by: Javi Fontan <jfontan@gmail.com>
* *: simplicationferhat elmas2017-12-181-5/+1
| | | | | | - no unnecessary err/bool check, uses them directly Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
* storage: filesystem, add support for git alternates (#663)Sunny2017-12-063-1/+118
| | | | This change adds a new method Alternates() in DotGit to check and query alternate source.
* dotgit: use Equal method of time.Time for equalityferhat elmas2017-12-041-1/+1
|
* Merge pull request #672 from ferhatelmas/gofmt-sMáximo Cuadros2017-12-011-1/+1
|\ | | | | all: gofmt -s
| * all: gofmt -sferhat elmas2017-11-301-1/+1
| |
* | dotgit: rewrite packed-refs while holding lockJeremy Stribling2017-11-303-60/+103
| | | | | | | | | | | | Windows file system doesn't let us rename over a file while holding that file's lock, so use rewrite as a last resort. It could result in a partially-written file, if there's a failure at the wrong time.
* | dotgit: open+lock packed-refs file until it doesn't changeJeremy Stribling2017-11-291-18/+46
| | | | | | | | Windows doesn't like it when we re-open a file we already have locked.
* | storage: some minor code cleanupJeremy Stribling2017-11-292-8/+4
| | | | | | | | | | | | Suggested by mcuadros. Issue: #669
* | plumbing: add `HasEncodedObject` method to StorerJeremy Stribling2017-11-292-0/+34
| | | | | | | | | | | | | | This allows the user to check whether an object exists, without reading all the object data from storage. Issue: KBFS-2445
* | Make object repacking more configurableTaru Karttunen2017-11-293-6/+18
| |
* | Support for repacking objectsTaru Karttunen2017-11-293-13/+36
| |
* | First pass of prune designTaru Karttunen2017-11-293-10/+85
| |
* | dotgit: use bufio for PackRefsJeremy Stribling2017-11-291-10/+8
| | | | | | | | | | | | Suggested by taruti. Issue: #13
* | dotgit: during rewriting, re-open packed-refs after lockingJeremy Stribling2017-11-291-9/+21
| | | | | | | | | | | | The file could have been completely replaced while waiting for the lock, so we need to re-open, otherwise we might be reading a stale file that has already been deleted/overwritten.
* | filesystem: todo comment about "all" paramJeremy Stribling2017-11-291-0/+4
| | | | | | | | Issue: KBFS-2517
* | dotgit: fix up PackRefs comment for upstreamingJeremy Stribling2017-11-291-26/+8
| |
* | filesystem: implement PackRefs()Jeremy Stribling2017-11-294-0/+203
|/ | | | | | | | | | Currently this implementation is only valid for kbfsgit, since it assumes some things about the filesystem not being updated during the packing, and about conflict resolution rules. In the future, it would be nice to replace this with a more general one, and move this kbfsgit-optimized implementation into kbfsgit. Issue: KBFS-2517
* all: simplificationferhat elmas2017-11-293-16/+12
| | | | | | | | | | - no length for map initialization - don't check for boolean/error return - don't format string - use string method of bytes buffer instead of converting bytes to string - use `strings.Contains` instead of `strings.Index` - use `bytes.Equal` instead of `bytes.Compare`
* dotgit: add CheckAndSetReference testsJeremy Stribling2017-11-282-11/+27
|
* Merge remote-tracking branch 'src-d/master' into gh-fast-forward-fetchJeremy Stribling2017-11-282-6/+76
|\
| * dotgit: don't list references twiceJeremy Stribling2017-11-272-4/+20
| | | | | | | | Restore the `seen` map that avoided listing packed-refs twice.
| * dotgit: add a test for removing a ref from a file and packed-refsJeremy Stribling2017-11-271-0/+29
| |
| * dotgit: remove loose ref AND packed ref, if both existJeremy Stribling2017-11-271-3/+28
| | | | | | | | Issue: KBFS-2509
* | Document Lock+Close usageTaru Karttunen2017-11-271-0/+4
| |
* | Use optionally locking when updating refsTaru Karttunen2017-11-274-13/+76
|/