| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The variable length for plumbing.Hash is defined at build time, blocked by
tag sha256.
This approach was a trade-off between keeping backwards compatibility while
making progress towards supporting SHA256 with a small amount of changes.
Relates to the SHA256 implementation, defined in #706.
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
completely (#330)
This PR adds code to prevent large objects from being read into memory
from packfiles or the filesystem.
Objects greater than 1Mb are now no longer directly stored in the cache
or read completely into memory.
This PR differs and improves the previous broken #323 by fixing several
bugs in the reader and transparently wrapping ReaderAt as a Reader.
Signed-off-by: Andrew Thornton <art27@cantab.net>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
|
|
|
|
| |
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
|
|
|
|
| |
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases the original data is not saved before it is cleaned
and forces a panic when it's needed.
The change adds ObjectToPack.CleanOriginal to be used to clean original
object instead of:
object.Original = nil
Now when the Original data is freed because it's no longer in the pack
window a SetOriginal call is done to make sure that Size, Hash and Size
data is not lost.
Signed-off-by: Javi Fontan <jfontan@gmail.com>
|
|
|
|
|
|
|
| |
SetOriginal now skips setting resolved values if the provided
object is nil. BackToOriginal also skips nil Original objects.
Signed-off-by: Javi Fontan <jfontan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resolving cycles relied on ObjectToPack objects having Original. This
is no longer true with the changes from #720. This commit changes:
* Save original type, hash and size in ObjectToPack
* Use SetObject to set both Original and resolved type, hash and size
* Restore original object before using BackToOriginal (cycle resolution)
* Update encoder test to check this case
Signed-off-by: Javi Fontan <jfontan@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove wrong 'if' on delta selector that causes poor delta reutilizations
- packfile.Encoder now can write deltas and objects in a non specific order
- ObjectToPack now saves the Offset on the packfile to be able to obtain base
offset in a recursive manner and write them before the delta itself
- Added encoder test to check cyclic delta chains
- Check the output packfile hash in all encoder tests
Signed-off-by: Antonio Jesus Navarro Perez <antnavper@gmail.com>
|
|
|
|
| |
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One use of go-git is to transfer git data from a non-standard git repo
(not stored in a file system, for example) to a "remote" backed by a
standard, local .git repo.
In this scenario, delta compression is not needed to reduce transfer
time over the "network", because there is no network. The underlying
storage layer has already taken care of the data tranfer, and sending
the objects to local .git storage doesn't require compression. So this
PR gives the user the option to turn off compression when it isn't
needed.
Of course, this results in a larger, uncompressed local .git repo, but
the user can then run git gc or git repack on that repo if they care
about the storage costs.
Turning the pack window to 0 on reduces total push time of a 36K repo
by 50 seconds (out of a pre-PR total of 3m26s).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* plumbing: add DeltaObject interface for EncodedObjects that
are deltas and hold additional information about them, such
as the hash of the base object.
* plumbing/storer: add DeltaObjectStorer interface for object
storers that can return DeltaObject. Note that calls to
EncodedObject will never return instances of DeltaObject.
That requires explicit calls to DeltaObject.
* storage/filesystem: implement DeltaObjectStorer interface.
* plumbing/packfile: packfile encoder now supports reusing
deltas that are already computed (e.g. from an existing
packfile) if the storage implements DeltaObjectStorer.
Reusing deltas boosts performance of packfile generation
(e.g. on push).
|
|
|
|
|
|
|
| |
* Improve checks for encode/decode.
* Make it easier to extend this test with more
storage backends.
|
|
|
|
| |
To be able to fix #261 we will move again to gopkg.in before v4 stable release.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* packfile: delta selection logic
- Implemented logic to assign deltas to objects
* Requested changes
* Improved tests and fix errors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
- 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
|
|
* plumbing/packfile: PACK encoder
- Added simple PACK encoder, deltas not supported by now
* Requested changes
* Requested changes
* Requested changes
|