summaryrefslogtreecommitdiff
path: root/include/git2/sys
Commit message (Collapse)AuthorAgeFilesLines
* index: reuc and name entrycounts should be size_tEdward Thomson2014-12-221-2/+2
| | | | | | 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.
* Merge pull request #2759 from libgit2/cmn/openssl-sysEdward Thomson2014-12-201-0/+38
|\ | | | | Make OpenSSL locking warnings more severe
| * Make the OpenSSL locking function warnings more severeCarlos Martín Nieto2014-12-121-0/+38
| | | | | | | | | | 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.
* | Fix public header on sys/refs.hDamien PROFETA2014-12-191-0/+11
|/ | | | | GIT_BEGIN/END_DECL were missing from sys/refs.h and preventing compilation with g++ as the symbol were mangled.
* Merge pull request #2678 from libgit2/cmn/io-streamEdward Thomson2014-12-101-0/+40
|\ | | | | Introduce stackable IO streams
| * stream: constify the write bufferCarlos Martín Nieto2014-12-101-1/+1
| |
| * Introduce stackable IO streamsCarlos Martín Nieto2014-12-101-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | doc: add documentation to all the public structs and enumscmn/doc-allCarlos Martín Nieto2014-12-063-5/+24
| | | | | | | | | | | | | | | | | | | | 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
* | Spelling fixesWill Stamper2014-12-042-2/+2
|/
* config: remove the refresh function and backend fieldcmn/config-refresh-removeCarlos Martín Nieto2014-10-231-1/+0
| | | | | | 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.
* Merge pull request #2448 from libgit2/cmn/reference-transactionEdward Thomson2014-10-091-0/+13
|\ | | | | Introduce reference transactions
| * Introduce reference transactionsCarlos Martín Nieto2014-09-301-0/+13
| | | | | | | | | | | | | | | | | | 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.
* | hashsig: Export as a `sys` headervmg/hashsigVicent Marti2014-10-011-0/+76
|/
* Merge pull request #2464 from libgit2/cmn/host-cert-infoVicent Marti2014-09-171-3/+1
|\ | | | | Provide a callback for certificate validation
| * net: remove support for outright ignoring certificatesCarlos Martín Nieto2014-09-161-3/+0
| | | | | | | | | | | | | | | | | | | | 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.
| * Provide a callback for certificate validationCarlos Martín Nieto2014-09-161-0/+1
| | | | | | | | | | | | | | | | | | 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.
* | Fix attribute lookup in index for bare reposrb/attr-with-bareRussell Belfer2014-09-151-0/+13
|/ | | | | | | | | | | | | | | | 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 `""`.
* Custom transport: minor cleanupsEdward Thomson2014-08-141-0/+354
| | | | | | | | | | | | * 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://").
* Merge pull request #2188 from libgit2/cmn/config-snapshotRussell Belfer2014-05-121-1/+3
|\ | | | | Configuration snapshotting
| * config: refresh before reading a valueCarlos Martín Nieto2014-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
| * config: implement config snapshottingCarlos Martín Nieto2014-04-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Use unsigned type for APIs with opt flag maskRussell Belfer2014-05-081-3/+3
| |
* | Add filter options and ALLOW_UNSAFERussell Belfer2014-05-061-2/+10
| | | | | | | | | | | | | | | | | | 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.
* | Fix remaining init_options inconsistenciesRussell Belfer2014-05-023-15/+12
| | | | | | | | | | There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
* | Remove trace / add git_diff_perfdata struct + apiRussell Belfer2014-05-021-0/+28
| |
* | 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
|