summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #5953 from boretrk/c99-inlineEdward Thomson2021-07-301-0/+2
|\ \ \ \ \ | | | | | | | | | | | | common.h: use inline when compiling for C99 and later
| * | | | | common.h: use inline when compiling for c99 and laterPeter Pettersson2021-07-261-0/+2
| | | | | |
* | | | | | Merge pull request #5952 from libgit2/ethomson/attrs_from_commitEdward Thomson2021-07-2910-183/+363
|\ \ \ \ \ \ | | | | | | | | | | | | | | Support reading attributes from a specific commit
| * | | | | | filter: introduce GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMITEdward Thomson2021-07-222-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a mechanism to filter using attribute data from a specific commit (making use of `GIT_ATTR_CHECK_INCLUDE_COMMIT`).
| * | | | | | attr: introduce GIT_ATTR_CHECK_INCLUDE_COMMITEdward Thomson2021-07-224-17/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce `GIT_ATTR_CHECK_INCLUDE_COMMIT`, which like 4fd5748 allows attribute information to be read from files in the repository. 4fd5748 always reads the information from HEAD, while `GIT_ATTR_CHECK_INCLUDE_COMMIT` allows users to provide the commit to read the attributes from.
| * | | | | | attr: cache nonexistent attr files from commitsEdward Thomson2021-07-221-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When looking up an attribute file in a commit, we can cache a nonexistent attribute file indefinitely (since a commit could not somehow later contain an attribute file). Cache an empty buffer when an attribute file does not exist in a given commit.
| * | | | | | filter: add git_filter_optionsEdward Thomson2021-07-222-15/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow filter users to provide an options structure instead of simply flags. This allows for future growth for filter options.
| * | | | | | filter: filter options are now "filter sessions"Edward Thomson2021-07-223-26/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Filters use a short-lived structure to keep state during an operation to allow for caching and avoid unnecessary reallocations. This was previously called the "filter options", despite the fact that they contain no configurable options. Rename them to a "filter session" in keeping with an "attribute session", which more accurately describes their use (and allows us to create "filter options" in the future).
| * | | | | | attr: introduce `git_attr_options` for extended queriesEdward Thomson2021-07-223-19/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow more advanced attribute queries using a `git_attr_options`, and extended functions to use it. Presently there is no additional configuration in a `git_attr_options` beyond the flags, but this is for future growth.
| * | | | | | attr: include the filename in the attr sourceEdward Thomson2021-07-226-78/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The attribute source object is now the type and the path.
| * | | | | | attr: the attr source is now a structEdward Thomson2021-07-223-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We may want to extend the attribute source; use a structure instead of an enum.
| * | | | | | attr: rename internal attr file source enumEdward Thomson2021-07-226-69/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The enum `git_attr_file_source` is better suffixed with a `_t` since it's a type-of source. Similarly, its members should have a matching name.
* | | | | | | Swap the order of the `git_graph_reachable_from_any` paramslhchavez2021-07-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | len, array -> array, len
* | | | | | | graph: Create `git_graph_reachable_from_any()`lhchavez2021-07-273-18/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new API function `git_graph_reachable_from_any()`, that answers the question whether a commit is reachable from any of the provided commits through following parent edges. This function can take advantage of optimizations provided by the existence of a `commit-graph` file, since it makes it faster to know whether, given two commits X and Y, X cannot possibly be an reachable from Y. Part of: #5757
* | | | | | | commit-graph: Introduce `git_commit_list_generation_cmp`lhchavez2021-07-264-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes calculations of merge-bases a bit faster when there are complex graphs and the commit times cause visiting nodes multiple times. This is done by visiting the nodes in the graph in reverse generation order when the generation number is available instead of commit timestamp. If the generation number is missing in any pair of commits, it can safely fall back to the old heuristic with no negative side-effects. Part of: #5757
* | | | | | | Merge pull request #5765 from lhchavez/cgraph-revwalksEdward Thomson2021-07-266-91/+293
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | commit-graph: Use the commit-graph in revwalks
| * | | | | | commit-graph: Create `git_commit_graph` as an abstraction for the filelhchavez2021-03-105-161/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change does a medium-size refactor of the git_commit_graph_file and the interaction with the ODB. Now instead of the ODB owning a direct reference to the git_commit_graph_file, there will be an intermediate git_commit_graph. The main advantage of that is that now end users can explicitly set a git_commit_graph that is eagerly checked for errors, while still being able to lazily use the commit-graph in a regular ODB, if the file is present.
| * | | | | | commit-graph: Use the commit-graph in revwalkslhchavez2021-03-104-2/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes revwalks a bit faster by using the `commit-graph` file (if present). This is thanks to the `commit-graph` allow much faster parsing of the commit information by requiring near-zero I/O (aside from reading a few dozen bytes off of a `mmap(2)`-ed file) for each commit, instead of having to read the ODB, inflate the commit, and parse it. This is done by modifying `git_commit_list_parse()` and letting it use the ODB-owned commit-graph file. Part of: #5757
* | | | | | | Merge pull request #5890 from lolgear/git_submodule_dupEdward Thomson2021-07-221-0/+11
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | [Submodule] Git submodule dup
| * | | | | | submodule: git submodule dup out and source parameters have become mandatory.Dmitry Lobanov2021-06-151-2/+2
| | | | | | |
| * | | | | | submodule: git submodule dup implementation has been reverted. Assert has ↵Dmitry Lobanov2021-05-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | been added.
| * | | | | | submodule: git submodule dup object dup has been added.Dmitry Lobanov2021-05-261-5/+2
| | | | | | |
| * | | | | | submodule: git submodule dup guard statement has been fixed.Dmitry Lobanov2021-05-191-1/+1
| | | | | | |
| * | | | | | submodule: git submodule dup has been added.Dmitry Lobanov2021-05-161-0/+8
| | | | | | |
* | | | | | | Merge branch 'pr/5948' into mainEdward Thomson2021-07-221-13/+17
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | |
| * | | | | | trace: drop unnecessary write indirectionEdward Thomson2021-07-221-17/+9
| | | | | | |
| * | | | | | Remove macro magicCalvin Buckley2021-07-191-10/+0
| | | | | | |
| * | | | | | Variadic arguments aren't in C89Calvin Buckley2021-07-171-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactors this to a wrapper function, as well as changing the existing API have a va_list and ... version.
* | | | | | | Update src/allocators/stdalloc.cEdward Thomson2021-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | Co-authored-by: lhchavez <lhchavez@lhchavez.com>
* | | | | | | merge: don't try to malloc(0)Edward Thomson2021-07-191-1/+2
| | | | | | |
* | | | | | | packbuilder: don't try to malloc(0)Edward Thomson2021-07-191-10/+16
| | | | | | |
* | | | | | | alloc: add GIT_DEBUG_STRICT_ALLOCEdward Thomson2021-07-193-10/+48
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `GIT_DEBUG_STRICT_ALLOC` to help identify problematic callers of allocation code that pass a `0` size to the allocators and then expect a non-`NULL` return. When given a 0-size allocation, `malloc` _may_ return either a `NULL` _or_ a pointer that is not writeable. Most systems return a non-`NULL` pointer; AIX is an outlier. We should be able to cope with this AIXy behavior, so this adds an option to emulate it.
* | | | | | Merge pull request #5941 from NattyNarwhal/stdintificationEdward Thomson2021-07-169-25/+16
|\ \ \ \ \ \ | | | | | | | | | | | | | | stdintification: use int64_t and INT64_C instead of long long
| * | | | | | khash 64-bit type is unsigned, use int32_t tooCalvin Buckley2021-07-151-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 32-bit int: There's no real reason for that ifdef if we explicitly specify the stdint.h type. For 64-bit int: ope, I made it signed accidentally
| * | | | | | Remove sus unsigned long constantCalvin Buckley2021-07-071-1/+1
| | | | | | |
| * | | | | | Convert long long constant specifiers to stdint macrosCalvin Buckley2021-07-076-10/+10
| | | | | | |
| * | | | | | Initial pass at using int64_t instead of long longCalvin Buckley2021-07-064-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even on systems without C99 where long long and stdint are both missing, we can shim stdint and point it to any compiler-specific type (i.e long long, _int64, etc.). Also next is constant suffixes and determining what needs to include stdint.
* | | | | | | Allow compilation on systems without CLOCK_MONOTONICPeter Pettersson2021-07-153-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes usage of CLOCK_MONOTONIC conditional and makes functions that uses git__timer handle clock resynchronization. Call gettimeofday with tzp set to NULL as required by https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html
* | | | | | | Merge pull request #5824 from palmin/fix-ignore-negateEdward Thomson2021-07-141-3/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | fix check for ignoring of negate rules
| * | | | | | | Apply suggestions from code reviewEdward Thomson2021-06-151-4/+4
| | | | | | | |
| * | | | | | | Update src/ignore.cAnders Borum2021-06-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: lhchavez <lhchavez@lhchavez.com>
| * | | | | | | Update src/ignore.cAnders Borum2021-06-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: lhchavez <lhchavez@lhchavez.com>
| * | | | | | | fix check for ignoring of negate rulesAnders Borum2021-03-201-2/+11
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gitignore rule like "*.pdf" should be negated by "!dir/test.pdf" even though one is inside a directory since *.pdf isn't restricted to any directory this is fixed by making wildcard match treat * like ** by excluding WM_PATHNAME flag when the rule isn't for a full path
* | | | | | | Merge pull request #5938 from NattyNarwhal/time-type-mismatchEdward Thomson2021-07-141-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix wrong time_t used in function
| * | | | | | | Fix wrong time_t used in functionCalvin Buckley2021-07-061-1/+1
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function doesn't interoperate with any system functions that use the system time_t, but rather only works with the git_time_t type in libgit2, which could be a different width than the system one. Fixes a compile warning.
* | | | | | | Merge pull request #5926 from Batchyx/batchyx/config-refresh-twiceEdward Thomson2021-07-141-6/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | config: fix included configs not refreshed more than once
| * | | | | | | config: fix included configs not refreshed more than onceNicolas Cavallari2021-06-231-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an included config is refreshed twice, the second update is not taken into account. This is because the list of included files is cleared after re-reading the new configuration, instead of being cleared before. Fix it and add a test case to check for this bug.
* | | | | | | | Merge pull request #5908 from punkymaniac/patch-mem-leakEdward Thomson2021-07-131-0/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Fix memory leak in git_smart__connect
| * | | | | | | | Remove useless conditionpunkymaniac2021-06-041-2/+1
| | | | | | | | |
| * | | | | | | | Fix memory leak in git_smart__connectpunkymaniac2021-06-031-0/+3
| | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to git_proxy_options_dup will replace the url pointer of the proxy. But if the url pointer is already set, the old address will be lost forever and will never be free.