summaryrefslogtreecommitdiff
path: root/include/git2/sys
Commit message (Collapse)AuthorAgeFilesLines
* Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-211-1/+1
|
* Add public diff print helpersRussell Belfer2014-04-171-0/+63
| | | | | | | The usefulness of these helpers came up for me while debugging some of the iterator changes that I was making, so since they have also been requested (albeit indirectly) I thought I'd include them.
* In-memory packing backendvmg/mempackVicent Marti2014-03-261-0/+85
|
* Added function-based initializers for every options struct.Matthew Bowen2014-03-053-0/+39
| | | | The basic structure of each function is courtesy of arrbee.
* Add exists_prefix to ODB backend and ODB APIRussell Belfer2014-03-041-5/+5
|
* Add git_commit_amend APIRussell Belfer2014-02-071-3/+37
| | | | | | | | | This adds an API to amend an existing commit, basically a shorthand for creating a new commit filling in missing parameters from the values of an existing commit. As part of this, I also added a new "sys" API to create a commit using a callback to get the parents. This allowed me to rewrite all the other commit creation APIs so that temporary allocations are no longer needed.
* refs: placeholder conditional deleteCarlos Martín Nieto2014-02-051-1/+1
| | | | We don't actually pass the old value yet.
* refdb: add conditional symbolic updatesCarlos Martín Nieto2014-02-051-1/+1
| | | | | Add a parameter to the backend to allow checking for the old symbolic target.
* refs: conditional ref updatesCarlos Martín Nieto2014-02-051-1/+2
| | | | Allow updating references if the old value matches the given one.
* commit: remvoe legacy 'oid' namingCarlos Martín Nieto2014-01-251-1/+1
|
* Merge pull request #1920 from libgit2/cmn/ref-with-logVicent Marti2013-12-181-2/+15
|\ | | | | Reference operations with log
| * refs: expose has_log() on the backendCarlos Martín Nieto2013-12-091-0/+5
| | | | | | | | | | | | The frontend used to look at the file directly, but that's obviously not the right thing to do. Expose it on the backend and use that function instead.
| * refs: expose a way to ensure a ref has a logCarlos Martín Nieto2013-12-091-0/+6
| | | | | | | | | | | | Sometimes (e.g. stash) we want to make sure that a log will be written, even if it's not in one of the standard locations. Let's make that easier.
| * reflog: integrate into the ref writingCarlos Martín Nieto2013-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Whenever a reference is created or updated, we need to write to the reflog regardless of whether the user gave us a message, so we shouldn't leave that to the ref frontend, but integrate it into the backend. This also eliminates the race between ref update and writing to the reflog, as we protect the reflog with the ref lock. As an additional benefit, this reflog append on the backend happens by appending to the file instead of parsing and rewriting it.
| * refdb: add a `message` parameter for appending to the logCarlos Martín Nieto2013-11-231-2/+4
| | | | | | | | This is as yet unused.
* | Cleanups, renames, and leak fixesRussell Belfer2013-12-121-0/+1
|/ | | | | | | | | This renames git_vector_free_all to the better git_vector_free_deep and also contains a couple of memory leak fixes based on valgrind checks. The fixes are specifically: failure to free global dir path variables when not compiled with threading on and failure to free filters from the filter registry that had not be initialized fully.
* Fix saving remotes with several fetch/push ref specs.Daniel Rodríguez Troitiño2013-11-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | At some moment git_config_delete_entry lost the ability to delete one entry of a multivar configuration. The moment you had more than one fetch or push ref spec for a remote you will not be able to save that remote anymore. The changes in network::remote::remotes::save show that problem. I needed to create a new git_config_delete_multivar because I was not able to remove one or several entries of a multivar config with the current API. Several tries modifying how git_config_set_multivar(..., NULL) behaved were not successful. git_config_delete_multivar is very similar to git_config_set_multivar, and delegates into config_delete_multivar of config_file. This function search for the cvar_t that will be deleted, storing them in a temporal array, and rebuilding the linked list. After calling config_write to delete the entries, the cvar_t stored in the temporal array are freed. There is a little fix in config_write, it avoids an infinite loop when using a regular expression (case for the multivars). This error was found by the test network::remote::remotes::tagopt.
* Merge pull request #1891 from libgit2/cmn/fix-thin-packsVicent Martí2013-10-281-1/+1
|\ | | | | Add support for thin packs
| * indexer: fix thin packsCarlos Martín Nieto2013-10-041-1/+1
| | | | | | | | | | | | When given an ODB from which to read objects, the indexer will attempt to inject the missing bases at the end of the pack and update the header and trailer to reflect the new contents.
* | Merge pull request #1802 from libgit2/cmn/reflog-backendBen Straub2013-10-282-0/+41
|\ \ | | | | | | Make reflog part of refdb
| * | reflog: bring _append and _drop back to the frontendCarlos Martín Nieto2013-10-021-12/+0
| | | | | | | | | | | | These functions act purely on the reflog data structure.
| * | reflog: move the reflog implementation into refdb_fsCarlos Martín Nieto2013-10-022-0/+53
| |/ | | | | | | | | | | | | | | | | | | References and their logs are logically coupled, let's make it so in the code by moving the fs-based reflog implementation to live next to the fs-based refs one. As part of the change, make the function take names rather than references, as only the names are relevant when looking up and handling reflogs.
* | Rename new fn to git_repository_reinit_filesystemRussell Belfer2013-10-081-2/+2
| |
* | Make reference lookups apply precomposeunicodeRussell Belfer2013-10-081-1/+19
|/ | | | | | | | | | | | | | | | | | | | | Before these changes, looking up a reference would return the same precomposed or decomposed form of the reference name that was used to look it up, so on MacOS which ignores the difference between the two, a single reference could be looked up either way and git_reference_name would return the form of the name that was used to look it up! This change makes lookup always return the precomposed name if core.precomposeunicode is set regardless of which version was used to look it up. The reference iterator was already returning the precomposed form from earlier work. This also updates the CMakeLists.txt rules for enabling iconv usage because the clar tests for this code were actually not being activated properly with the old version. Finally, this moves git_repository_reset_filesystem from include/ git2/repository.h to include/git2/sys/repository.h since it is not really a function that normal library users should have to think about very often.
* That's the refdb, it's not the odb...Edward Thomson2013-09-251-2/+2
|
* 'del' instead of 'delete' for the poor C++ usersEdward Thomson2013-09-241-1/+1
|
* Bug fixes and cleanupsRussell Belfer2013-09-171-33/+68
| | | | | | | | | | | | | This contains a few bug fixes and some header and API cleanups. The main API change is that filters should now use GIT_PASSTHROUGH to indicate that they wish to skip processing a file instead of GIT_ENOTFOUND. The bug fixes include a possible out-of-range buffer access in the ident filter, a filter ordering problem I introduced into the custom filter tests on Windows, and a filter buf NUL termination issue that was coming up on Linux.
* More filtering tests including orderRussell Belfer2013-09-171-0/+14
| | | | | | | | | | | This adds more tests of filters, including the ident filter when mixed with custom filters. I was able to combine with the reverse filter and demonstrate that the order of filter application with the default priority constants matches the order of core Git. Also, this fixes two issues in the ident filter: preventing ident expansion on binary files and avoiding a NULL dereference when dollar sign characters are found without Id.
* Port tests from PR 1683Russell Belfer2013-09-171-0/+13
| | | | | | This ports over some of the tests from https://github.com/libgit2/libgit2/pull/1683 by @yorah and @ethomson
* Merge git_buf and git_bufferRussell Belfer2013-09-171-9/+9
| | | | | | | | | | | This makes the git_buf struct that was used internally into an externally available structure and eliminates the git_buffer. As part of that, some of the special cases that arose with the externally used git_buffer were blended into the git_buf, such as being careful about git_buf objects that may have a NULL ptr and allowing for bufs with a valid ptr and size but zero asize as a way of referring to externally owned data.
* Add ident filterRussell Belfer2013-09-171-3/+8
| | | | | | | This adds the ident filter (that knows how to replace $Id$) and tweaks the filter APIs and code so that git_filter_source objects actually have the updated OID of the object being filtered when it is a known value.
* Add functions to manipulate filter listsRussell Belfer2013-09-171-0/+37
| | | | | | | | Extend the git2/sys/filter API with functions to look up a filter and add it manually to a filter list. This requires some trickery because the regular attribute lookups and checks are bypassed when this happens, but in the right hands, it will allow a user to have granular control over applying filters.
* Hook up filter initialize callbackRussell Belfer2013-09-171-0/+2
| | | | I knew I forgot something
* Extend public filter api with filter listsRussell Belfer2013-09-171-10/+10
| | | | | | | | | | | This moves the git_filter_list into the public API so that users can create, apply, and dispose of filter lists. This allows more granular application of filters to user data outside of libgit2 internals. This also converts all the internal usage of filters to the public APIs along with a few small tweaks to make it easier to use the public git_buffer stuff alongside the internal git_buf.
* Add attributes to filters and fix registryRussell Belfer2013-09-171-18/+83
| | | | | | | | | | | | | | | | | | The filter registry as implemented was too primitive to actually work once multiple filters were coming into play. This expands the implementation of the registry to handle multiple prioritized filters correctly. Additionally, this adds an "attributes" field to a filter that makes it really really easy to implement filters that are based on one or more attribute values. The lookup and even simple value checking can all happen automatically without custom filter code. Lastly, with the registry improvements, this fills out the filter lifecycle callbacks, with initialize and shutdown callbacks that will be called before the filter is first used and after it is last invoked. This allows for system-wide initialization and cleanup by the filter.
* Make git_filter_source opaqueRussell Belfer2013-09-171-6/+23
|
* Create public filter object and use itRussell Belfer2013-09-171-0/+104
| | | | | | | This creates include/sys/filter.h with a basic definition of a git_filter and then converts the internal code to use it. There are related internal objects (git_filter_list) that we will want to publish at some point, but this is a first step.
* odb: Move the auto refresh logic to the pack backendnulltoken2013-09-041-0/+10
| | | | | | | | | | | | Previously, `git_object_read()`, `git_object_read_prefix()` and `git_object_exists()` were implementing an auto refresh logic. When the expected object couldn't be found in any backend, a call to `git_odb_refresh()` was triggered and the lookup was once again performed against all backends. This commit removes this auto-refresh logic from the odb layer and pushes it down into the pack-backend (as it's the only one currently exposing a `refresh()` endpoint).
* Merge pull request #1772 from libgit2/config-iterVicent Martí2013-08-281-2/+28
|\ | | | | Configuration iterators redux
| * config: don't special-case the multivar iteratorCarlos Martín Nieto2013-08-141-2/+0
| | | | | | | | | | Build it on top of the normal iterator instead, which lets use re-use a lot of code.
| * config: working multivar iteratorCarlos Martín Nieto2013-08-081-1/+1
| | | | | | | | Implement the foreach version as a wrapper around the iterator.
| * config: hopefully get the iterator to work on multivarsCarlos Martín Nieto2013-08-081-1/+1
| |
| * config: initial multivar iteratorCarlos Martín Nieto2013-08-081-2/+4
| |
| * config: move next() and free() into the iteratorCarlos Martín Nieto2013-08-081-3/+27
| | | | | | | | | | Like we have in the references iterator, next and free belong in the iterator itself.
| * config: get_multivar -> get_multivar_foreachCarlos Martín Nieto2013-08-081-1/+1
| | | | | | | | | | The plain function will return an iterator, so move this one out of the way.
| * Don't typedef a pointerCarlos Martín Nieto2013-08-081-1/+1
| | | | | | | | Make the iterator structure opaque and make sure it compiles.
| * replaced foreach() with non callback based iterations in git_config_backendNico von Geyso2013-08-081-1/+3
| | | | | | | | | | | | | | | | | | new functions in struct git_config_backend: * iterator_new(...) * iterator_free(...) * next(...) The old callback based foreach style can still be used with `git_config_backend_foreach_match`
* | odb: document git_odb_streamCarlos Martín Nieto2013-08-171-0/+4
| | | | | | | | | | | | Clarify the role of each function and in particular mention that there is no need for the backend or stream to worry about the object's id, as it will be given when `finalize_write` is called.
* | odb: make it clearer that the id is calculated in the frontendCarlos Martín Nieto2013-08-171-5/+1
|/ | | | | | | | | | The frontend is in charge of calculating the id of the objects. Thus the backends should treat it as a read-only value. The positioning in the function signature made it seem as though it was an output parameter. Make the id const and move it from the front to behind the subject (backend or stream).
* Clean up some documentationCarlos Martín Nieto2013-07-232-4/+2
| | | | clang's docparser highlighted these.