summaryrefslogtreecommitdiff
path: root/include/git2/sys
Commit message (Collapse)AuthorAgeFilesLines
* path: export the dotgit-checking functionscmn/expose-gitfile-checkCarlos Martín Nieto2018-10-151-0/+64
| | | | | | | | These checks are preformed by libgit2 on checkout, but they're also useful for performing checks in applications which do not involve checkout. Expose them under `sys/` as it's still fairly in the weeds even for this library.
* settings: allow swapping out memory allocatorPatrick Steinhardt2018-06-071-0/+24
| | | | | | | Tie in the newly created infrastructure for swapping out memory allocators into our settings code. A user can now simply use the new option "GIT_OPT_SET_ALLOCATOR" with `git_libgit2_opts`, passing in an already initialized allocator structure as vararg.
* alloc: make memory allocators use function pointersPatrick Steinhardt2018-06-071-0/+77
| | | | | | | | | | | | | | | | | Currently, our memory allocators are being redirected to the correct implementation at compile time by simply using macros. In order to make them swappable at runtime, this commit reshuffles that by instead making use of a global "git_allocator" structure, whose pointers are set up to reference the allocator functions. Like this, it becomes easy to swap out allocators by simply setting these function pointers. In order to initialize a "git_allocator", our provided allocators "stdalloc" and "crtdbg" both provide an init function. This is being called to initialize a passed in allocator struct and set up its members correctly. No support is yet included to enable users of libgit2 to switch out the memory allocator at a global level.
* docs: correct defgroupEtienne Samson2018-05-071-1/+1
|
* docs: fix incorrect codeblock on outputEtienne Samson2018-05-071-35/+35
|
* docs: fix more missing includesEtienne Samson2018-05-072-0/+8
|
* odb: provide length and type with streaming readEdward Thomson2018-02-011-1/+2
| | | | | The streaming read functionality should provide the length and the type of the object, like the normal read functionality does.
* odb: export mempack backendAdrián Medraño Calvo2018-01-221-4/+5
| | | | Fixes #4492, #4496.
* config: pass repository when opening config filesPatrick Steinhardt2017-10-091-1/+4
| | | | | | | | | | | | | | | | | Our current configuration logic is completely oblivious of any repository, but only cares for actual file paths. Unfortunately, we are forced to break this assumption by the introduction of conditional includes, which are evaluated in the context of a repository. Right now, only one conditional exists with "gitdir:" -- it will only include the configuration if the current repository's git directory matches the value passed to "gitdir:". To support these conditionals, we have to break our API and make the repository available when opening a configuration file. This commit extends the `open` call of configuration backends to include another repository and adjusts existing code to have it available. This includes the user-visible functions `git_config_add_file_ondisk` and `git_config_add_backend`.
* Remove unused 'sys/remote.h' headerethomson/remove_sys_remote_hEdward Thomson2017-07-311-16/+0
|
* Adding git_filter_init for initializing `git_filter` struct + unit test Mohseen Mukaddam2017-06-131-0/+11
|
* adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of conventionMohseen Mukaddam2017-06-131-1/+1
|
* transport: provide a getter for the proxy optionscmn/transport-get-proxyCarlos Martín Nieto2017-04-171-0/+10
| | | | | | | | As with the callbacks, third-party implementations of smart subtransports cannot reach into the opaque struct and thus cannot know what options the user set. Add a getter for these options to copy the proxy options into something external implementors can use.
* merge_driver: fix const-correctness for source gettersPatrick Steinhardt2017-03-151-5/+5
|
* Allow for caching of submodules.Brock Peabody2017-01-201-0/+29
| | | | | | | | | | | | | | Added `git_repository_submodule_cache_all` to initialze a cache of submodules on the repository so that operations looking up N submodules are O(N) and not O(N^2). Added a `git_repository_submodule_cache_clear` function to remove the cache. Also optimized the function that loads all submodules as it was itself O(N^2) w.r.t the number of submodules, having to loop through the `.gitmodules` file once per submodule. I changed it to process the `.gitmodules` file once, into a map. Signed-off-by: David Turner <dturner@twosigma.com>
* time: Export `git_time_monotonic`vmg/timeVicent Marti2016-09-131-0/+31
|
* odb: freshen existing objects when writingEdward Thomson2016-08-041-0/+11
| | | | | | When writing an object, we calculate its OID and see if it exists in the object database. If it does, we need to freshen the file that contains it.
* proxy: add a payload field for the proxy optionsCarlos Martín Nieto2016-04-191-0/+16
| | | | | I don't quite recall what we do in the other places where we use this, but we should pass this payload to the callbacks.
* net: use proxy options struct in the stream configCarlos Martín Nieto2016-04-191-1/+2
|
* proxy: ask the user for credentials if necessaryCarlos Martín Nieto2016-04-191-1/+3
|
* merge driver: remove `check` callbackEdward Thomson2016-03-171-62/+6
| | | | | | Since the `apply` callback can defer, the `check` callback is not necessary. Removing the `check` callback further makes the `payload` unnecessary along with the `cleanup` callback.
* merge driver: improve inline documentationEdward Thomson2016-03-171-18/+21
|
* merge driver: introduce custom merge driversEdward Thomson2016-03-171-0/+230
| | | | | | | | Consumers can now register custom merged drivers with `git_merge_driver_register`. This allows consumers to support the merge drivers, as configured in `.gitattributes`. Consumers will be asked to perform the file-level merge when a custom driver is configured.
* index: fix contradicting comparisonPatrick Steinhardt2016-02-231-1/+1
| | | | | | | | | | | | | | | | | | The overflow check in `read_reuc` tries to verify if the `git__strtol32` parses an integer bigger than UINT_MAX. The `tmp` variable is casted to an unsigned int for this and then checked for being greater than UINT_MAX, which obviously can never be true. Fix this by instead fixing the `mode` field's size in `struct git_index_reuc_entry` to `uint32_t`. We can now parse the int with `git__strtol64`, which can never return a value bigger than `UINT32_MAX`, and additionally checking if the returned value is smaller than zero. We do not need to handle overflows explicitly here, as `git__strtol64` returns an error when the returned value would overflow.
* filter: clean up documentation around custom filtersEdward Thomson2016-02-091-25/+34
|
* stream: allow registering a user-provided TLS constructorcmn/tls-registerCarlos Martín Nieto2015-11-031-0/+13
| | | | | This allows the application to use their own TLS stream, regardless of the capabilities of libgit2 itself.
* Fix build for custom transport usersLeo Yang2015-10-301-0/+1
| | | | | We should explicitly include the declaration of git_strarray from "include/git2/sys/transport.h"
* refdb and odb backends must provide `free` functionArthur Schreiber2015-10-012-2/+6
| | | | | | | | | As refdb and odb backends can be allocated by client code, libgit2 can’t know whether an alternative memory allocator was used, and thus should not try to call `git__free` on those objects. Instead, odb and refdb backend implementations must always provide their own `free` functions to ensure memory gets freed correctly.
* Tell the git_transport about the custom_headersMatt Burke2015-09-081-0/+5
|
* transport: provide a way to get the callbacksCarlos Martín Nieto2015-08-191-0/+22
| | | | | | | | libgit2 implementations of smart subtransports can simply reach through the structure, but external implementors cannot. Add these two functions as a way for the smart subtransports to get the callbacks as set by the user.
* config: implement basic transactional supportCarlos Martín Nieto2015-08-121-0/+14
| | | | | | | When a configuration file is locked, any updates made to it will be done to the in-memory copy of the file. This allows for multiple updates to happen while we hold the lock, preventing races during complex config-file manipulation.
* Merge pull request #3332 from phatblat/ben/doc-warningsCarlos Martín Nieto2015-08-014-7/+7
|\ | | | | Resolve documentation warnings
| * Fix remaining documentation warningsBen Chatelain2015-07-272-2/+2
| |
| * Use correct Doxygen trailing comment syntaxBen Chatelain2015-07-271-4/+4
| |
| * Fix @param names in doc commentsBen Chatelain2015-07-272-2/+2
| |
* | refdb: delete a ref's reflog upon deletioncmn/reflog-del-backendCarlos Martín Nieto2015-07-121-2/+3
|/ | | | | | Removing a reflog upon ref deletion is something which only some backends might wish to do. Backends which are database-backed may wish to archive a reflog, log-based ones may not need to do anything.
* filters: custom filters with wildcard attributesEdward Thomson2015-07-011-1/+4
| | | | | | Allow custom filters with wildcard attributes, so that clients can support some random `filter=foo` in a .gitattributes and look up the corresponding smudge/clean commands in the configuration file.
* stream: add support for setting a proxyCarlos Martín Nieto2015-06-241-0/+2
| | | | | | | | If the stream claims to support this feature, we can let the transport set the proxy. We also set HTTPPROXYTUNNEL option so curl can create a tunnel through the proxy which lets us create our own TLS session (if needed).
* Merge pull request #3118 from libgit2/cmn/stream-sizeEdward Thomson2015-05-131-1/+1
|\ | | | | odb: make the writestream's size a git_off_t
| * 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.
* | remote: move the transport ctor to the callbacksCarlos Martín Nieto2015-05-131-20/+0
| | | | | | | | | | | | | | Instead of having it set in a different place from every other callback, put it the main structure. This removes some state from the remote and makes it behave more like clone, where the constructors are passed via the options.
* | Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-131-1/+1
|/ | | | | | | | | | | | | | Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
* Add a custom param to git_smart_subtransport_definitionLeo Yang2015-03-181-4/+12
| | | | | The smart transport has already take the payload param. For the sub transport a payload param is useful for the implementer.
* config: borrow refcounted referencescmn/config-borrow-entryCarlos Martín Nieto2015-03-031-1/+3
| | | | | | | | | | | | | | | This changes the get_entry() method to return a refcounted version of the config entry, which you have to free when you're done. This allows us to avoid freeing the memory in which the entry is stored on a refresh, which may happen at any time for a live config. For this reason, get_string() has been forbidden on live configs and a new function get_string_buf() has been added, which stores the string in a git_buf which the user then owns. The functions which parse the string value takea advantage of the borrowing to parse safely and then release the entry.
* git_filter_opt_t -> git_filter_flag_tEdward Thomson2015-02-191-2/+2
| | | | | For consistency with the rest of the library, where an opt is an options *structure*.
* git_writestream: from git_filter_streamEdward Thomson2015-02-181-8/+2
|
* filters: introduce streaming filtersEdward Thomson2015-02-171-0/+14
| | | | | | | Add structures and preliminary functions to take a buffer, file or blob and write the contents in chunks through an arbitrary number of chained filters, finally writing into a user-provided function accept the contents.
* Fixed error when including git2/include/sys/stream.hJohn Haley2015-02-111-0/+2
|
* Merge pull request #2839 from swisspol/typoEdward Thomson2015-01-261-1/+1
|\ | | | | Fixed typo in git_repository_reinit_filesystem() documentation
| * Fixed typo in git_repository_reinit_filesystem() documentationPierre-Olivier Latour2015-01-231-1/+1
| |