summaryrefslogtreecommitdiff
path: root/include/git2/odb.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5765 from lhchavez/cgraph-revwalksEdward Thomson2021-07-261-0/+15
|\ | | | | commit-graph: Use the commit-graph in revwalks
| * commit-graph: Create `git_commit_graph` as an abstraction for the filelhchavez2021-03-101-0/+15
| | | | | | | | | | | | | | | | | | | | This change does a medium-size refactor of the git_commit_graph_file and the interaction with the ODB. Now instead of the ODB owning a direct reference to the git_commit_graph_file, there will be an intermediate git_commit_graph. The main advantage of that is that now end users can explicitly set a git_commit_graph that is eagerly checked for errors, while still being able to lazily use the commit-graph in a regular ODB, if the file is present.
* | Uniformise documentation return code separatorpunkymaniac2021-04-221-7/+7
| |
* | Fix documentation formattingpunkymaniac2021-04-221-13/+8
|/ | | | | | The return code description use '-' char as list of return value. But with the generation of the documentation the char '-' create an ambiguous return code value who seem an negative value.
* odb: use `git_object_size_t` for object sizeEdward Thomson2019-11-221-1/+1
| | | | | Instead of using a signed type (`off_t`) use a new `git_object_size_t` for the sizes of objects.
* indexer: correct missing includesEtienne Samson2019-06-151-0/+1
| | | | Docurium seems to choke on this header because it can't see both git_indexer_progress & git_indexer_progress_cb, let's add the include.
* indexer: use git_indexer_progress throughoutEdward Thomson2019-02-221-1/+1
| | | | | Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
* Introduce GIT_CALLBACK macro to enforce cdeclEdward Thomson2019-01-171-1/+1
| | | | | | | | | Since we now always build the library with cdecl calling conventions, our callbacks should be decorated as such so that users will not be able to provide callbacks defined with other calling conventions. The `GIT_CALLBACK` macro will inject the `__cdecl` attribute as appropriate.
* object_type: update public API to use git_object_tEdward Thomson2018-12-011-9/+9
| | | | | | git_object_t is the future; update the public API to use it. This will also ensure that we can build our tests which make use of the old API without modification (and without compiler warnings).
* odb: provide length and type with streaming readEdward Thomson2018-02-011-1/+8
| | | | | The streaming read functionality should provide the length and the type of the object, like the normal read functionality does.
* Correct typos that reference a non-existing fileRemy Suen2017-04-031-2/+2
| | | | | There are references to odb_backends.h when the file is actually named odb_backend.h and in the sys folder.
* git_odb_expand_ids: accept git_odb_expand_id arrayEdward Thomson2016-03-081-10/+25
| | | | Take (and write to) an array of a struct, `git_odb_expand_id`.
* git_odb_expand_ids: rename func, return the typeEdward Thomson2016-03-081-6/+7
|
* git_odb_exists_many_prefixes: query odb for multiple short idsEdward Thomson2016-03-071-1/+31
| | | | | Query the object database for multiple objects at a time, given their object ID (which may be abbreviated) and optional type.
* odb: make the writestream's size a git_off_tcmn/stream-sizeCarlos Martín Nieto2015-05-131-1/+1
| | | | | | | | | | Restricting files to size_t is a silly limitation. The loose backend writes to a file directly, so there is no issue in using 63 bits for the size. We still assume that the header is going to fit in 64 bytes, which does mean quite a bit smaller files due to the run-length encoding, but it's still a much larger size than you would want Git to handle.
* Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-211-1/+1
|
* Add exists_prefix to ODB backend and ODB APIRussell Belfer2014-03-041-0/+13
|
* Update docs for new callback return value behaviorRussell Belfer2013-12-111-1/+1
|
* Implement `git_odb_object_dup`Vicent Marti2013-10-221-0/+14
|
* Comment updatesRussell Belfer2013-09-091-3/+4
|
* odb: Error when streaming in too [few|many] bytesnulltoken2013-09-071-0/+6
|
* odb: wrap the stream reading and writing functionsCarlos Martín Nieto2013-08-151-10/+39
| | | | | | This is in preparation for moving the hashing to the frontend, which requires us to handle the incoming data before passing it to the backend's stream.
* More tests for ambiguous OIDs across packsRussell Belfer2013-08-051-1/+1
| | | | | | | The test coverage for ambiguous OIDs was pretty thin. This adds a bunch of new objects both in packs, across packs, and loose that match to 8 characters so that we can test various cases of ambiguous lookups.
* Move odb_backend implementors stuff into git2/sysRussell Belfer2013-04-211-38/+59
| | | | | | | | | | | | This moves some of the odb_backend stuff that is related to the internals of an odb_backend implementation into include/git2/sys. Some of the stuff related to streaming I left in include/git2 because it seemed like it would be reasonably needed by a normal user who wanted to stream objects into and out of the ODB. Also, I added APIs for traversing the list of backends so that some of the tests would not need to access ODB internals.
* Sane refresh logicVicent Marti2013-01-101-0/+20
| | | | | | | All the ODB backends have a specific refresh interface. When reading an object, first we attempt every single backend: if the read fails, then we refresh all the backends and retry the read one more time to see if the object has appeared.
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* odb: Add `git_odb_add_disk_alternate`Vicent Marti2012-11-281-0/+17
| | | | | Loads a disk alternate by path to the ODB. Mimics the `GIT_ALTERNATE_OBJECT_DIRECTORIES` shell var.
* Make git_odb_foreach_cb take const paramRussell Belfer2012-11-271-5/+0
| | | | | This makes the first OID param of the ODB callback a const pointer and also propogates that change all the way to the backends.
* API updates for odb.hBen Straub2012-11-271-18/+28
|
* create callback to handle packs from fetch, move the indexer to odb_packEdward Thomson2012-11-051-0/+21
|
* Make clear that git_odb_hashfile does not use filtersSven Strickroth2012-09-221-2/+4
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Merge remote-tracking branch 'arrbee/tree-walk-fixes' into developmentVicent Marti2012-08-061-3/+4
|\ | | | | | | | | | | | | | | | | Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
| * Update iterators for consistency across libraryRussell Belfer2012-08-031-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
* | portability: Improve x86/amd64 compatibilitynulltoken2012-07-241-1/+1
|/
* odb: add git_odb_foreach()Carlos Martín Nieto2012-07-031-0/+14
| | | | | Go through each backend and list every objects that exists in them. This allows fsck-like uses.
* Fix spelling errors.Bruce Mitchener2012-05-191-4/+4
|
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-4/+4
|
* errors: Rename the generic return codesVicent Martí2012-05-181-12/+12
|
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Rename all `_close` methodsVicent Marti2011-11-261-1/+1
| | | | | There's no difference between `_free` and `_close` semantics: keep everything with the same name to avoid confusions.
* repository: Change ownership semanticsVicent Marti2011-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ownership semantics have been changed all over the library to be consistent. There are no more "borrowed" or duplicated references. Main changes: - `git_repository_open2` and `3` have been dropped. - Added setters and getters to hotswap all the repository owned objects: `git_repository_index` `git_repository_set_index` `git_repository_odb` `git_repository_set_odb` `git_repository_config` `git_repository_set_config` `git_repository_workdir` `git_repository_set_workdir` Now working directories/index files/ODBs and so on can be hot-swapped after creating a repository and between operations. - All these objects now have proper ownership semantics with refcounting: they all require freeing after they are no longer needed (the repository always keeps its internal reference). - Repository open and initialization has been updated to keep in mind the configuration files. Bare repositories are now always detected, and a default config file is created on init. - All the tests affected by these changes have been dropped from the old test suite and ported to the new one.
* Tabify everythingVicent Marti2011-09-191-3/+3
| | | | | | There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
* Cleanup legal dataVicent Marti2011-09-191-22/+4
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* Standardized doxygen @return lines for int functions to say "GIT_SUCCESS or ↵David Boyce2011-09-131-7/+5
| | | | an error code".
* status: CleanupVicent Marti2011-07-091-0/+13
| | | | | | | | The `hashfile` function has been moved to ODB, next to `git_odb_hash`. Global state has been removed from the dirent call in `status.c`, because global state is killing the rainforest and causing global warming.
* cleanup: remove trailing spacesKirill A. Shutemov2011-07-011-4/+4
| | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* Update documentationVicent Marti2011-06-161-9/+14
| | | | Fix all the missmatched arguments in the docs
* short-oid: CleanupVicent Marti2011-06-011-1/+1
|
* Added a GIT_OID_MINPREFIXLEN constant to define the minimum length allowed ↵Marc Pegon2011-06-011-2/+3
| | | | for oid prefixes (set to 4, like in git). Consequently updated some object lookup methods and their documentation.
* Added git.git sha1 lookup method to replace simple binary search in pack ↵Marc Pegon2011-06-011-1/+31
| | | | | | | | | | | | | | | backend. Implemented find_unique_short_oid for pack backend, based on git sha1 lookup method; finding an object given its full oid is just a particular case of searching the unique object matching an oid prefix (short oid). Added git_odb_read_unique_short_oid, which iterates over all the backends to find and read the unique object matching the given oid prefix. Added a git_object_lookup_short_oid method to find the unique object in the repository matching a given oid prefix : it generalizes git_object_lookup which now does nothing but calls git_object_lookup_short_oid.