include/git2/sys


Log

Author Commit Date CI Message
Carlos Martín Nieto 9a97f49e 2014-12-21T15:31:03 config: borrow refcounted references 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.
Edward Thomson 795eaccd 2015-02-19T11:09:54 git_filter_opt_t -> git_filter_flag_t For consistency with the rest of the library, where an opt is an options *structure*.
Edward Thomson b75f15aa 2015-02-18T09:25:32 git_writestream: from git_filter_stream
Edward Thomson fbdc9db3 2015-01-22T16:10:06 filters: introduce streaming filters 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.
John Haley a36486ef 2015-02-11T10:31:54 Fixed error when including git2/include/sys/stream.h
Edward Thomson f483720c 2015-01-26T11:25:16 Merge pull request #2839 from swisspol/typo Fixed typo in git_repository_reinit_filesystem() documentation
Pierre-Olivier Latour 86815dca 2015-01-23T16:04:23 Make sure sys/repository.h includes the required headers It was missing "common.h" and "types.h" like other system headers. This generated compilation errors if including it directly.
Pierre-Olivier Latour 22b6a923 2015-01-23T15:59:54 Fixed typo in git_repository_reinit_filesystem() documentation
Edward Thomson 85880693 2015-01-14T10:19:28 Merge branch 'pr/2740'
Pierre-Olivier Latour 36fc5497 2014-12-02T05:11:12 Added GIT_HASHSIG_ALLOW_SMALL_FILES to allow computing signatures for small files The implementation of the hashsig API disallows computing a signature on small files containing only a few lines. This new flag disables this behavior. git_diff_find_similar() sets this flag by default which means that rename / copy detection of small files will now work. This in turn affects the behavior of the git_status and git_blame APIs which will now detect rename of small files assuming the right options are passed.
David Calavera d76e9df9 2015-01-02T15:56:03 Include git2/common.h in sys/openssl.h.
Edward Thomson 2fe8157e 2014-12-22T18:42:03 index: reuc and name entrycounts should be size_t For the REUC and NAME entries, we use size_t internally, and we take size_t for the get_byindex() functions, but the entrycount() functions strangely cast to an unsigned int instead.
Edward Thomson d147900e 2014-12-20T21:24:45 Merge pull request #2759 from libgit2/cmn/openssl-sys Make OpenSSL locking warnings more severe
Damien PROFETA ceb651c9 2014-12-19T15:31:49 Fix public header on sys/refs.h GIT_BEGIN/END_DECL were missing from sys/refs.h and preventing compilation with g++ as the symbol were mangled.
Carlos Martín Nieto 263b1d6e 2014-12-12T08:29:43 Make the OpenSSL locking function warnings more severe Our git_openssl_set_locking() would ideally not exist. Make it clearer that we provide it as a last resort and you should prefer anything else.
Edward Thomson cd305c2f 2014-12-10T11:30:28 Merge pull request #2678 from libgit2/cmn/io-stream Introduce stackable IO streams
Carlos Martín Nieto 49ae22ba 2014-12-10T01:38:52 stream: constify the write buffer
Carlos Martín Nieto dd4ff2c9 2014-11-01T12:35:54 Introduce stackable IO streams We currently have gitno for talking over TCP, but this needs to know about both plaintext and OpenSSL connections and the code has gotten somewhat messy with ifdefs determining which version of the function should be called. In order to clean this up and abstract away the details of sending over the different types of streams, we can instead use an interface and stack stream implementations. We may not be able to use the stackability with all streams, but we are definitely be able to use the abstraction which is currently spread between different bits of gitno.
Carlos Martín Nieto a295bd2d 2014-12-06T03:36:18 doc: add documentation to all the public structs and enums This makes them show up in the reference, even if the text itself isn't the most descriptive. These have been found with grep -Przon '\n\ntypedef struct.*?\{' -- include grep -Przon '\n\ntypedef enum.*?\{' -- include
Will Stamper b874629b 2014-12-04T21:06:59 Spelling fixes
Carlos Martín Nieto 55cb4999 2014-10-23T19:05:02 config: remove the refresh function and backend field We have been refreshing on read and write for a while now, so git_config_refresh() is at best a no-op, and might just end up wasting cycles.
Edward Thomson 10cf4b26 2014-10-09T10:49:37 Merge pull request #2448 from libgit2/cmn/reference-transaction Introduce reference transactions
Vicent Marti 737b5051 2014-10-01T12:03:24 hashsig: Export as a `sys` header
Carlos Martín Nieto ab8d9242 2014-06-28T06:39:38 Introduce reference transactions A transaction allows you to lock multiple references and set up changes for them before applying the changes all at once (or as close as the backend supports). This can be used for replication purposes, or for making sure some operations run when the reference is locked and thus cannot be changed.
Vicent Marti 1312f87b 2014-09-17T14:56:39 Merge pull request #2464 from libgit2/cmn/host-cert-info Provide a callback for certificate validation
Carlos Martín Nieto 41698f22 2014-09-11T10:04:05 net: remove support for outright ignoring certificates This option make it easy to ignore anything about the server we're connecting to, which is bad security practice. This was necessary as we didn't use to expose detailed information about the certificate, but now that we do, we should get rid of this. If the user wants to ignore everything, they can still provide a callback which ignores all the information passed.
Carlos Martín Nieto 9b940586 2014-07-04T12:45:43 Provide a callback for certificate validation If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
Russell Belfer 1fbeb2f0 2014-09-15T21:59:23 Fix attribute lookup in index for bare repos When using a bare repo with an index, libgit2 attempts to read files from the index. It caches those files based on the path to the file, specifically the path to the directory that contains the file. If there is no working directory, we use `git_path_dirname_r` to get the path to the containing directory. However, for the `.gitattributes` file in the root of the repository, this ends up normalizing the containing path to `"."` instead of the empty string and the lookup the `.gitattributes` data fails. This adds a test of attribute lookups on bare repos and also fixes the problem by simply rewriting `"."` to be `""`.
Edward Thomson c180c065 2014-07-09T17:58:39 Custom transport: minor cleanups * Move the transport registration mechanisms into a new header under 'sys/' because this is advanced stuff. * Remove the 'priority' argument from the registration as it adds unnecessary complexity. (Since transports cannot decline to operate, only the highest priority transport is ever executed.) Users who require per-priority transports can implement that in their custom transport themselves. * Simplify registration further by taking a scheme (eg "http") instead of a prefix (eg "http://").
Russell Belfer d2c4d1c6 2014-05-12T10:04:52 Merge pull request #2188 from libgit2/cmn/config-snapshot Configuration snapshotting
Russell Belfer 45c53eb6 2014-05-08T10:46:04 Use unsigned type for APIs with opt flag mask
Russell Belfer 5269008c 2014-05-06T16:01:49 Add filter options and ALLOW_UNSAFE Diff and status do not want core.safecrlf to actually raise an error regardless of the setting, so this extends the filter API with an additional options flags parameter and adds a flag so that filters can be applied with GIT_FILTER_OPT_ALLOW_UNSAFE, indicating that unsafe filter application should be downgraded from a failure to a warning.
Russell Belfer bc91347b 2014-04-30T11:16:31 Fix remaining init_options inconsistencies There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
Russell Belfer 9c8ed499 2014-04-29T15:05:58 Remove trace / add git_diff_perfdata struct + api
Jacques Germishuys 48e60ae7 2014-04-21T11:23:29 Don't redefine the same callback types, their signatures may change
Carlos Martín Nieto 523032cd 2014-03-31T09:58:44 config: refresh before reading a value With the isolation of complex reads, we can now try to refresh the on-disk file before reading a value from it. This changes the semantics a bit, as before we could be sure that a string we got from the configuration was valid until we wrote or refreshed. This is no longer the case, as a read can also invalidate the pointer.
Carlos Martín Nieto 55ebd7d3 2014-03-13T17:11:34 config: implement config snapshotting In order to have consistent views of the config files for remotes, submodules et al. and a configuration that represents what is currently stored on-disk, we need a way to provide a view of the configuration that does not change. The goal here is to provide the snapshotting part by creating a read-only copy of the state of the configuration at a particular point in time, which does not change when a repository's main config changes.
Russell Belfer 27e54bcf 2014-02-07T14:17:19 Add public diff print helpers 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.
Vicent Marti 6105d597 2014-03-26T18:17:08 In-memory packing backend
Matthew Bowen b9f81997 2014-03-05T21:49:23 Added function-based initializers for every options struct. The basic structure of each function is courtesy of arrbee.
Russell Belfer f5753999 2014-03-04T15:34:23 Add exists_prefix to ODB backend and ODB API
Russell Belfer 80c29fe9 2014-01-17T10:45:11 Add git_commit_amend API 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.
Carlos Martín Nieto 7ee8c7e6 2014-02-05T11:07:34 refs: placeholder conditional delete We don't actually pass the old value yet.
Carlos Martín Nieto 91123661 2014-02-04T22:04:00 refdb: add conditional symbolic updates Add a parameter to the backend to allow checking for the old symbolic target.
Carlos Martín Nieto 9b148098 2013-12-18T19:58:16 refs: conditional ref updates Allow updating references if the old value matches the given one.
Carlos Martín Nieto 47e28349 2014-01-24T12:01:34 commit: remvoe legacy 'oid' naming
Vicent Marti 4e1f517c 2013-12-18T09:33:45 Merge pull request #1920 from libgit2/cmn/ref-with-log Reference operations with log
Russell Belfer 9cfce273 2013-12-12T12:11:38 Cleanups, renames, and leak fixes 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.
Carlos Martín Nieto f2105129 2013-11-23T14:39:53 refs: expose has_log() on the backend 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.
Carlos Martín Nieto 8d5ec910 2013-11-23T14:13:01 refs: expose a way to ensure a ref has a log 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.
Carlos Martín Nieto a57dd3b7 2013-11-13T18:15:20 reflog: integrate into the ref writing 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.
Carlos Martín Nieto 110df893 2013-11-13T13:36:37 refdb: add a `message` parameter for appending to the log This is as yet unused.
Daniel Rodríguez Troitiño 3793fa9b 2013-10-31T01:08:50 Fix saving remotes with several fetch/push ref specs. 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.
Vicent Martí 5c50f22a 2013-10-28T09:25:44 Merge pull request #1891 from libgit2/cmn/fix-thin-packs Add support for thin packs
Ben Straub 8f4a8b09 2013-10-28T06:20:28 Merge pull request #1802 from libgit2/cmn/reflog-backend Make reflog part of refdb
Russell Belfer 867f7c9b 2013-10-08T16:59:59 Rename new fn to git_repository_reinit_filesystem
Russell Belfer 92dac975 2013-10-08T16:35:57 Make reference lookups apply precomposeunicode 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.
Carlos Martín Nieto 0b33fca0 2013-10-02T13:39:35 indexer: fix thin packs 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.
Carlos Martín Nieto 0174794a 2013-08-21T05:12:49 reflog: bring _append and _drop back to the frontend These functions act purely on the reflog data structure.
Carlos Martín Nieto b976f3c2 2013-08-19T13:01:49 reflog: move the reflog implementation into refdb_fs 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.
Edward Thomson e0b267af 2013-09-25T10:49:25 That's the refdb, it's not the odb...
Edward Thomson e3f3868a 2013-09-24T11:04:14 'del' instead of 'delete' for the poor C++ users
Russell Belfer eefc32d5 2013-09-16T12:54:40 Bug fixes and cleanups 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.
Russell Belfer eab3746b 2013-09-15T22:23:39 More filtering tests including order 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.
Russell Belfer b47349b8 2013-09-12T14:48:24 Port tests from PR 1683 This ports over some of the tests from https://github.com/libgit2/libgit2/pull/1683 by @yorah and @ethomson
Russell Belfer a9f51e43 2013-09-11T22:00:36 Merge git_buf and git_buffer 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.
Russell Belfer 4b11f25a 2013-09-11T16:38:33 Add ident filter 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.
Russell Belfer 40cb40fa 2013-09-11T14:23:39 Add functions to manipulate filter lists 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.
Russell Belfer 29e92d38 2013-09-10T16:53:09 Hook up filter initialize callback I knew I forgot something
Russell Belfer 2a7d224f 2013-09-10T16:33:32 Extend public filter api with filter lists 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.
Russell Belfer 974774c7 2013-09-09T16:57:34 Add attributes to filters and fix registry 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.
Russell Belfer 570ba25c 2013-08-30T16:02:07 Make git_filter_source opaque
Russell Belfer 85d54812 2013-08-28T16:44:04 Create public filter object and use it 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.
nulltoken b1a6c316 2013-08-30T17:36:00 odb: Move the auto refresh logic to the pack backend 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).
Vicent Martí b8b22d77 2013-08-28T06:04:51 Merge pull request #1772 from libgit2/config-iter Configuration iterators redux
Carlos Martín Nieto 7a3764be 2013-08-17T01:55:52 odb: document git_odb_stream 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.
Carlos Martín Nieto fe0c6d4e 2013-08-17T01:41:08 odb: make it clearer that the id is calculated in the frontend 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).
Carlos Martín Nieto f4be8209 2013-08-14T00:45:05 config: don't special-case the multivar iterator Build it on top of the normal iterator instead, which lets use re-use a lot of code.
Carlos Martín Nieto 99dfb538 2013-08-08T17:57:59 config: working multivar iterator Implement the foreach version as a wrapper around the iterator.
Carlos Martín Nieto cca5df63 2013-08-08T16:59:39 config: hopefully get the iterator to work on multivars
Carlos Martín Nieto 3a7ffc29 2013-08-08T16:18:07 config: initial multivar iterator
Carlos Martín Nieto eba73992 2013-08-08T14:39:32 config: move next() and free() into the iterator Like we have in the references iterator, next and free belong in the iterator itself.
Carlos Martín Nieto 4efa3290 2013-08-08T13:41:18 config: get_multivar -> get_multivar_foreach The plain function will return an iterator, so move this one out of the way.
Carlos Martín Nieto 4d588d97 2013-08-08T11:24:47 Don't typedef a pointer Make the iterator structure opaque and make sure it compiles.
Nico von Geyso a603c191 2013-03-18T21:02:36 replaced foreach() with non callback based iterations in git_config_backend 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`
Carlos Martín Nieto c05a55b0 2013-07-23T09:40:19 Clean up some documentation clang's docparser highlighted these.
Vicent Marti 4e6e2ff2 2013-05-30T03:47:10 ...Aaaand this works
Vicent Marti ec24e542 2013-05-29T22:47:37 What are the chances, really
Vicent Marti 56960b83 2013-05-28T20:47:55 Liike this
Russell Belfer 16adc9fa 2013-05-24T10:35:58 Typedef git_config_level_t and use it everywhere The GIT_CONFIG_LEVEL constants actually work well as an enum because they are mutually exclusive, so this adds a typedef to the enum and uses that everywhere that one of these constants are expected, instead of the old code that typically used an unsigned int.
nulltoken 1fed6b07 2013-05-13T21:57:37 Fix trailing whitespaces
Linquize 0cb16fe9 2013-05-15T20:26:55 Unify whitespaces to tabs
Edward Thomson b6cc559a 2013-05-11T02:42:49 Merge pull request #1385 from carlosmn/refs-iter Introduce a refs iterator
Carlos Martín Nieto c58cac12 2013-05-04T18:06:14 Introduce a glob-filtering iterator If the backend doesn't provide support for it, the matching is done in refdb on top of a normal iterator.
Carlos Martín Nieto 2b562c3a 2013-05-04T16:32:58 refs: remove the OID/SYMBOLIC filtering Nobody should ever be using anything other than ALL at this level, so remove the option altogether. As part of this, git_reference_foreach_glob is now implemented in the frontend using an iterator. Backends will later regain the ability of doing the glob filtering in the backend.
Carlos Martín Nieto 4def7035 2013-03-02T19:31:03 refs: introduce an iterator This allows us to get a list of reference names in a loop instead of callbacks.
nulltoken 467cbec7 2013-05-05T16:48:34 commit: make create_from_oids() accept plain oid
Edward Thomson 75d1c8c6 2013-04-30T17:33:11 move NAME and REUC extensions to sys/
Vicent Marti 879458e7 2013-04-24T15:52:33 repo: Add `git_repository__cleanup`
Russell Belfer 21ca0451 2013-04-21T12:52:17 Move git_reference__alloc to include/git2/sys Create a new include/git2/sys/refs.h and move the reference alloc functions there. Also fix some documentation issues and some minor code cleanups.