summaryrefslogtreecommitdiff
path: root/include/git2/object.h
Commit message (Collapse)AuthorAgeFilesLines
* peel: reject bad queries with EINVALIDSPECcmn/peeling-errorsCarlos Martín Nieto2014-11-221-8/+15
| | | | | | | | | | There are some combination of objects and target types which we know cannot be fulfilled. Return EINVALIDSPEC for those to signify that there is a mismatch in the user-provided data and what the object model is capable of satisfying. If we start at a tag and in the course of peeling find out that we cannot reach a particular type, we return EPEEL.
* Doc fixesRussell Belfer2014-05-021-0/+5
|
* Merge pull request #2153 from mekishizufu/tag_exampleRussell Belfer2014-03-071-1/+1
|\ | | | | Add a tag example
| * Fix typoJiri Pospisil2014-03-051-1/+1
| |
* | Add git_object_short_id API to get short id stringRussell Belfer2014-03-041-0/+10
|/ | | | | | This finds a short id string that will unambiguously select the given object, starting with the core.abbrev length (usually 7) and growing until it is no longer ambiguous.
* Blame: minor cleanupBen Straub2013-09-251-1/+1
|
* Port blame from git.gitBen Straub2013-09-161-1/+18
|
* Fixes return type documentationAndy Lindeman2013-07-141-1/+1
|
* object: Export git_object_dupVicent Marti2013-04-101-0/+9
|
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* object: refine git_object_peel() error reportnulltoken2012-12-011-2/+3
|
* API updates for tag.hRussell Belfer2012-11-271-3/+3
|
* More external API cleanupVicent Marti2012-11-271-1/+1
| | | | | | Conflicts: src/branch.c tests-clar/refs/branches/create.c
* Make git_object_peel a bit smarterRussell Belfer2012-08-271-4/+7
| | | | | | | | | | | This expands the types of peeling that `git_object_peel` knows how to do to include TAG -> BLOB peeling, and makes the errors slightly more consistent depending on the situation. It also adds a new special behavior where peeling to ANY will peel until the object type changes (e.g. chases TAGs to a non-TAG). Using this expanded peeling, this replaces peeling code that was embedded in `git_tag_peel` and `git_reset`.
* portability: Improve x86/amd64 compatibilitynulltoken2012-07-241-1/+1
|
* object: introduce git_object_peel()nulltoken2012-07-171-0/+17
| | | | Partially fix #530
* Fix spelling errors.Bruce Mitchener2012-05-191-3/+3
|
* errors: Rename the generic return codesVicent Martí2012-05-181-1/+1
|
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Rename all `_close` methodsVicent Marti2011-11-261-3/+3
| | | | | There's no difference between `_free` and `_close` semantics: keep everything with the same name to avoid confusions.
* 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-1/+1
| | | | an error code".
* Update documentationVicent Marti2011-06-161-2/+2
| | | | Fix all the missmatched arguments in the docs
* short-oid: CleanupVicent Marti2011-06-011-3/+11
|
* Added a GIT_OID_MINPREFIXLEN constant to define the minimum length allowed ↵Marc Pegon2011-06-011-3/+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-0/+30
| | | | | | | | | | | | | | | 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.
* object: Update documentationVicent Marti2011-06-011-0/+6
|
* I broke your bindingsVicent Marti2011-03-201-55/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hey. Apologies in advance -- I broke your bindings. This is a major commit that includes a long-overdue redesign of the whole object-database structure. This is expected to be the last major external API redesign of the library until the first non-alpha release. Please get your bindings up to date with these changes. They will be included in the next minor release. Sorry again! Major features include: - Real caching and refcounting on parsed objects - Real caching and refcounting on objects read from the ODB - Streaming writes & reads from the ODB - Single-method writes for all object types - The external API is now partially thread-safe The speed increases are significant in all aspects, specially when reading an object several times from the ODB (revwalking) and when writing big objects to the ODB. Here's a full changelog for the external API: blob.h ------ - Remove `git_blob_new` - Remove `git_blob_set_rawcontent` - Remove `git_blob_set_rawcontent_fromfile` - Rename `git_blob_writefile` -> `git_blob_create_fromfile` - Change `git_blob_create_fromfile`: The `path` argument is now relative to the repository's working dir - Add `git_blob_create_frombuffer` commit.h -------- - Remove `git_commit_new` - Remove `git_commit_add_parent` - Remove `git_commit_set_message` - Remove `git_commit_set_committer` - Remove `git_commit_set_author` - Remove `git_commit_set_tree` - Add `git_commit_create` - Add `git_commit_create_v` - Add `git_commit_create_o` - Add `git_commit_create_ov` tag.h ----- - Remove `git_tag_new` - Remove `git_tag_set_target` - Remove `git_tag_set_name` - Remove `git_tag_set_tagger` - Remove `git_tag_set_message` - Add `git_tag_create` - Add `git_tag_create_o` tree.h ------ - Change `git_tree_entry_2object`: New signature is `(git_object **object_out, git_repository *repo, git_tree_entry *entry)` - Remove `git_tree_new` - Remove `git_tree_add_entry` - Remove `git_tree_remove_entry_byindex` - Remove `git_tree_remove_entry_byname` - Remove `git_tree_clearentries` - Remove `git_tree_entry_set_id` - Remove `git_tree_entry_set_name` - Remove `git_tree_entry_set_attributes` object.h ------------ - Remove `git_object_new - Remove `git_object_write` - Change `git_object_close`: This method is now *mandatory*. Not closing an object causes a memory leak. odb.h ----- - Remove type `git_rawobj` - Remove `git_rawobj_close` - Rename `git_rawobj_hash` -> `git_odb_hash` - Change `git_odb_hash`: New signature is `(git_oid *id, const void *data, size_t len, git_otype type)` - Add type `git_odb_object` - Add `git_odb_object_close` - Change `git_odb_read`: New signature is `(git_odb_object **out, git_odb *db, const git_oid *id)` - Change `git_odb_read_header`: New signature is `(size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id)` - Remove `git_odb_write` - Add `git_odb_open_wstream` - Add `git_odb_open_rstream` odb_backend.h ------------- - Change type `git_odb_backend`: New internal signatures are as follows int (* read)(void **, size_t *, git_otype *, struct git_odb_backend *, const git_oid *) int (* read_header)(size_t *, git_otype *, struct git_odb_backend *, const git_oid *) int (* writestream)(struct git_odb_stream **, struct git_odb_backend *, size_t, git_otype) int (* readstream)( struct git_odb_stream **, struct git_odb_backend *, const git_oid *) - Add type `git_odb_stream` - Add enum `git_odb_streammode` Signed-off-by: Vicent Marti <tanoku@gmail.com>
* Fix the retarded object interdependency systemVicent Marti2011-03-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's no longer retarded. All object interdependencies are stored as OIDs instead of actual objects. This should be hundreds of times faster, specially on big repositories. Heck, who knows, maye it doesn't even segfault -- wouldn't that be awesome? What has changed on the API? `git_commit_parent`, `git_commit_tree`, `git_tag_target` now return their values through a pointer-to-pointer, and have an error code. `git_commit_set_tree` and `git_tag_set_target` now return an error code and may fail. `git_repository_free__no_gc` has been deprecated because it's stupid. Since there are no longer any interdependencies between objects, we don't need internal reference counting, and GC never fails or double-free's pointers. `git_object_close` now does a very sane thing: marks an object as unused. Closed objects will be eventually free'd from the object cache based on LRU. Please use `git_object_close` from the garbage collector `destroy` method on your bindings. It's 100% safe. `git_repository_gc` is a new method that forces a garbage collector pass through the repo, to free as many LRU objects as possible. This is useful if we are running out of memory.
* Move the external includes folder from `src` to `include`Vicent Marti2011-03-031-0/+198
Signed-off-by: Vicent Marti <tanoku@gmail.com>