summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* sha1: don't inline `git_hash_global_init` for win32ethomson/win32_hashEdward Thomson2019-04-042-14/+16
| | | | | Users of the Win32 hash cannot be inlined, as it uses a static struct. Don't inline it, but continue to declare the function in the header.
* Merge pull request #5020 from implausible/fix/gitignore-negationPatrick Steinhardt2019-03-292-12/+25
|\ | | | | Negation of subdir ignore causes other subdirs to be unignored
| * ignore: move tests from status to attr ignore suiteSteven King Jr2019-03-202-40/+25
| |
| * ignore: add additional test casesSteven King Jr2019-03-151-3/+5
| |
| * ignore: Do not match on prefix of negated patternsSteve King Jr2019-03-142-15/+23
| | | | | | | | | | | | | | | | | | | | | | Matching on the prefix of a negated pattern was triggering false negatives on siblings of that pattern. e.g. Given the .gitignore: dir/* !dir/sub1/sub2/** The path `dir/a.text` would not be ignored.
| * Implement failing test for gitignore of complex subdirectory negationTyler Ang-Wanek2019-03-141-0/+18
| | | | | | | | When a directory's contents are ignored, and then a glob negation is made to a nested subdir, other subdirectories are now unignored
* | Merge pull request #5024 from stewid/xdiff-fix-typoPatrick Steinhardt2019-03-291-1/+1
|\ \ | | | | | | xdiff: fix typo
| * | xdiff: fix typoStefan Widgren2019-03-201-1/+1
| |/
* | Merge pull request #5032 from eaigner/checkout-force-safe-docfixEdward Thomson2019-03-281-2/+14
|\ \ | | | | | | docs: clarify relation of safe and forced checkout strategy
| * | docs: clarify relation of safe and forced checkout strategyErik Aigner2019-03-251-2/+14
| | |
* | | Merge pull request #5026 from tenderlove/define-hash-global-init-consnstentlyEdward Thomson2019-03-243-17/+15
|\ \ \ | |_|/ |/| | Each hash implementation should define `git_hash_global_init`
| * | Each hash implementation should define `git_hash_global_init`Aaron Patterson2019-03-223-17/+15
|/ / | | | | | | | | | | This means the forward declaration isn't necessary. The forward declaration can cause compilation errors as it conflicts with the `GIT_INLINE` declaration (the signatures are different).
* | Merge pull request #5012 from dritter/dritter-patch-1Edward Thomson2019-03-061-1/+1
|\ \ | | | | | | [Doc] Update URL to git2-rs
| * | Update URL to git2-rsDominik Ritter2019-03-051-1/+1
|/ /
* | Merge pull request #5008 from libgit2/ethomson/remote_completionEdward Thomson2019-03-022-3/+6
|\ \ | | | | | | remote: Rename git_remote_completion_type to _t
| * | remote: Rename git_remote_completion_type to _tethomson/remote_completionEdward Thomson2019-02-252-3/+6
| | | | | | | | | | | | | | | For consistency with other "type" enums, rename git_remote_completion_type to git_remote_completion_t.
* | | Merge pull request #5005 from libgit2/ethomson/odb_backend_allocationsEdward Thomson2019-03-022-3/+58
|\ \ \ | | | | | | | | odb: provide a free function for custom backends
| * | | odb: provide a free function for custom backendsethomson/odb_backend_allocationsEdward Thomson2019-02-232-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Custom backends can allocate memory when reading objects and providing them to libgit2. However, if an error occurs in the custom backend after the memory has been allocated for the custom object but before it's returned to libgit2, the custom backend has no way to free that memory and it must be leaked. Provide a free function that corresponds to the alloc function so that custom backends have an opportunity to free memory before they return an error.
| * | | odb: rename git_odb_backend_malloc for consistencyEdward Thomson2019-02-232-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `git_odb_backend_malloc` name is a system function that is provided for custom ODB backends and allows them to allocate memory for an ODB object in the read callback. This is important so that libgit2 can later free the memory used by an ODB object that was read from the custom backend. However, the name _suggests_ that it actually allocates a `git_odb_backend`. It does not; rename it to make it clear that it actually allocates backend _data_.
* | | | Revert "foo"Edward Thomson2019-02-282-186/+142
| | | | | | | | | | | | | | | | This reverts commit 1fe3fa5e59818c851d50efc6563db5f8a5d7ae9b.
* | | | fooEdward Thomson2019-02-282-142/+186
| | | |
* | | | Merge branch 'threading-docs'Edward Thomson2019-02-271-26/+18
|\ \ \ \ | |_|/ / |/| | |
| * | | threading: clarify openssl default vs mbedtlsEdward Thomson2019-02-271-4/+5
| | | |
| * | | threading: clarify concurrency of accessEdward Thomson2019-02-271-1/+1
| | | |
| * | | Update threading.mdthreading-docsEtienne Samson2019-02-071-24/+15
| | | |
* | | | Merge pull request #5000 from augfab/branch_lookup_allEdward Thomson2019-02-252-4/+41
|\ \ \ \ | |_|/ / |/| | | Have git_branch_lookup accept GIT_BRANCH_ALL
| * | | branch: have git_branch_lookup accept GIT_BRANCH_ALLAugustin Fabre2019-02-221-2/+16
| | | |
| * | | branch: add test for git_branch_lookup to accept GIT_BRANCH_ALLAugustin Fabre2019-02-221-2/+25
| | | |
* | | | Merge pull request #4997 from libgit2/ethomson/transfer_progressEdward Thomson2019-02-2229-107/+157
|\ \ \ \ | | | | | | | | | | Rename git_transfer_progress to git_indexer_progress
| * | | | remote: deprecate git_push_transfer_progressethomson/transfer_progressEdward Thomson2019-02-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Safely deprecate `git_push_transfer_progress`, forwarding it to the new `git_push_transfer_progress_cb` name.
| * | | | remote: rename git_push_transfer_progress callbackEdward Thomson2019-02-222-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `git_push_transfer_progress` is a callback and as such should be suffixed with `_cb` for consistency. Rename `git_push_transfer_progress` to `git_push_transfer_progress_cb`.
| * | | | indexer: deprecate git_transfer_progressEdward Thomson2019-02-222-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Safely deprecate `git_transfer_progress` and `git_transfer_progress_cb` types, forwarding them to the new `git_indexer_progress` and `git_indexer_progress_cb`.
| * | | | indexer: use git_indexer_progress throughoutEdward Thomson2019-02-2227-74/+74
| | | | | | | | | | | | | | | | | | | | | | | | | Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
| * | | | indexer: rename git_transfer_progressEdward Thomson2019-02-222-30/+45
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name `git_transfer_progress` does not reflect its true purpose. It suggests that it's progress for a non-existence `git_transfer` object, and is used for indexing callbacks more broadly than just during transfers. Rename `git_transfer_progress` to `git_indexer_progress`.
* | | | Merge pull request #4901 from pks-t/pks/uniform-map-apiEdward Thomson2019-02-2234-861/+1122
|\ \ \ \ | | | | | | | | | | High-level map APIs
| * | | | idxmap: remove legacy low-level interfacePatrick Steinhardt2019-02-152-71/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the low-level interface that was exposing implementation details of `git_idxmap` to callers. From now on, only the high-level functions shall be used to retrieve or modify values of a map. Adjust remaining existing callers.
| * | | | oidmap: remove legacy low-level interfacePatrick Steinhardt2019-02-153-257/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the low-level interface that was exposing implementation details of `git_oidmap` to callers. From now on, only the high-level functions shall be used to retrieve or modify values of a map. Adjust remaining existing callers.
| * | | | offmap: remove legacy low-level interfacePatrick Steinhardt2019-02-152-88/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the low-level interface that was exposing implementation details of `git_offmap` to callers. From now on, only the high-level functions shall be used to retrieve or modify values of a map. Adjust remaining existing callers.
| * | | | strmap: remove legacy low-level interfacePatrick Steinhardt2019-02-153-153/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the low-level interface that was exposing implementation details of `git_strmap` to callers. From now on, only the high-level functions shall be used to retrieve or modify values of a map. Adjust remaining existing callers.
| * | | | cache: use iteration interface for cache evictionPatrick Steinhardt2019-02-151-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To relieve us from memory pressure, we may regularly call `cache_evict_entries` to remove some entries from it. Unfortunately, our cache does not support a least-recently-used mode or something similar, which is why we evict entries completeley at random right now. Thing is, this is only possible due to the map interfaces exposing the entry indices, and we intend to completely remove those to decouple map users from map implementations. As soon as that is done, we are unable to do this random eviction anymore. Convert this to make use of an iterator for now. Obviously, there is no random eviction possible like that anymore, but we'll always start by evicting from the beginning of the map. Due to hashing, one may hope that the selected buckets will be evicted at least in some way unpredictably. But more likely than not, this will not be the case. But let's see what happens and if any users complain about degraded performance. If so, we might come up with a different scheme than random removal, e.g. by using an LRU cache.
| * | | | indexer: use map iterator to delete expected OIDsPatrick Steinhardt2019-02-151-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To compute whether there are objects missing in a packfile, the indexer keeps around a map of OIDs that it still expects to see. This map does not store any values at all, but in fact the keys are owned by the map itself. Right now, we free these keys by iterating over the map and freeing the key itself, which is kind of awkward as keys are expected to be constant. We can make this a bit prettier by inserting the OID as value, too. As we already store the `NULL` pointer either way, this does not increase memory usage, but makes the code a tad more clear. Furthermore, we convert the previously existing map iteration via indices to make use of an iterator, instead.
| * | | | maps: provide high-level iteration interfacePatrick Steinhardt2019-02-158-25/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, our headers need to leak some implementation details of maps due to their direct use of indices in the implementation of their foreach macros. This makes it impossible to completely hide the map structures away, and also makes it impossible to include the khash implementation header in the C files of the respective map only. This is now being fixed by providing a high-level iteration interface `map_iterate`, which takes as inputs the map that shall be iterated over, an iterator as well as the locations where keys and values shall be put into. For simplicity's sake, the iterator is a simple `size_t` that shall initialized to `0` on the first call. All existing foreach macros are then adjusted to make use of this new function.
| * | | | maps: use high-level function to check existence of keysPatrick Steinhardt2019-02-158-24/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some callers were still using the tightly-coupled pattern of `lookup_index` and `valid_index` to verify that an entry exists in a map. Instead, use the more high-level `exists` functions to decouple map users from its implementation.
| * | | | maps: provide return value when deleting entriesPatrick Steinhardt2019-02-1510-48/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the delete functions of maps do not provide a return value. Like this, it is impossible to tell whether the entry has really been deleted or not. Change the implementation to provide either a return value of zero if the entry has been successfully deleted or `GIT_ENOTFOUND` if the key could not be found. Convert callers to the `delete_at` functions to instead use this higher-level interface.
| * | | | idxmap: have `resize` functions return proper error codePatrick Steinhardt2019-02-153-27/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The currently existing function `git_idxmap_resize` and `git_idxmap_icase_resize` do not return any error codes at all due to their previous implementation making use of a macro. Due to that, it is impossible to see whether the resize operation might have failed due to an out-of-memory situation. Fix this by providing a proper error code. Adjust callers to make use of it.
| * | | | idxmap: introduce high-level setter for key/value pairsPatrick Steinhardt2019-02-153-7/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, one would use the function `git_idxmap_insert` to insert key/value pairs into a map. This function has historically been a macro, which is why its syntax is kind of weird: instead of returning an error code directly, it instead has to be passed a pointer to where the return value shall be stored. This does not match libgit2's common idiom of directly returning error codes. Introduce a new function `git_idxmap_set`, which takes as parameters the map, key and value and directly returns an error code. Convert all callers of `git_idxmap_insert` to make use of it.
| * | | | idxmap: introduce high-level getter for valuesPatrick Steinhardt2019-02-153-9/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current way of looking up an entry from a map is tightly coupled with the map implementation, as one first has to look up the index of the key and then retrieve the associated value by using the index. As a caller, you usually do not care about any indices at all, though, so this is more complicated than really necessary. Furthermore, it invites for errors to happen if the correct error checking sequence is not being followed. Introduce new high-level functions `git_idxmap_get` and `git_idxmap_icase_get` that take a map and a key and return a pointer to the associated value if such a key exists. Otherwise, a `NULL` pointer is returned. Adjust all callers that can trivially be converted.
| * | | | offmap: introduce high-level setter for key/value pairsPatrick Steinhardt2019-02-153-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is only one caller that adds entries into an offset map, and this caller first uses `git_offmap_put` to add a key and then set the value at the returned index by using `git_offmap_set_value_at`. This is just too tighlty coupled with implementation details of the map as it exposes the index of inserted entries, which we really do not care about at all. Introduce a new function `git_offmap_set`, which takes as parameters the map, key and value and directly returns an error code. Convert the caller to make use of it instead.
| * | | | offmap: introduce high-level getter for valuesPatrick Steinhardt2019-02-153-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current way of looking up an entry from a map is tightly coupled with the map implementation, as one first has to look up the index of the key and then retrieve the associated value by using the index. As a caller, you usually do not care about any indices at all, though, so this is more complicated than really necessary. Furthermore, it invites for errors to happen if the correct error checking sequence is not being followed. Introduce a new high-level function `git_offmap_get` that takes a map and a key and returns a pointer to the associated value if such a key exists. Otherwise, a `NULL` pointer is returned. Adjust all callers that can trivially be converted.
| * | | | oidmap: introduce high-level setter for key/value pairsPatrick Steinhardt2019-02-1510-67/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, one would use either `git_oidmap_insert` to insert key/value pairs into a map or `git_oidmap_put` to insert a key only. These function have historically been macros, which is why their syntax is kind of weird: instead of returning an error code directly, they instead have to be passed a pointer to where the return value shall be stored. This does not match libgit2's common idiom of directly returning error codes.Furthermore, `git_oidmap_put` is tightly coupled with implementation details of the map as it exposes the index of inserted entries. Introduce a new function `git_oidmap_set`, which takes as parameters the map, key and value and directly returns an error code. Convert all trivial callers of `git_oidmap_insert` and `git_oidmap_put` to make use of it.