Commit Graph

13891 Commits

Author SHA1 Message Date
Edward Thomson
a7bc8de4e7 Update VSCode / Github Codespaces workflow 2021-08-02 21:25:08 +00:00
Edward Thomson
a8098903cd .devcontainer: settings for a codespace workflow
Add devcontainer settings for running within a codespace.
2021-08-02 17:07:28 -04:00
Edward Thomson
e65229ee97 Merge pull request #5962 from libgit2/ethomson/futimens 2021-07-31 09:45:30 -04:00
Edward Thomson
f6b3f72634 README: link to more information about cmake 2021-07-30 12:40:36 -04:00
Edward Thomson
3062a63364 cmake: extended futimens checking on macOS 2021-07-30 12:03:35 -04:00
Edward Thomson
c73ee7407c Merge pull request #5961 from libgit2/ethomson/odb_tests_priority
tests: reset odb backend priority
2021-07-30 12:02:00 -04:00
Edward Thomson
e5975f36d7 tests: reset odb backend priority 2021-07-30 11:37:12 -04:00
Edward Thomson
e87bcb3d77 Merge branch 'pr/5491' 2021-07-30 10:32:02 -04:00
Edward Thomson
0c34767e68 Merge pull request #5957 from lhchavez/fix-master-build
Fix one memory leak in master
2021-07-30 10:31:16 -04:00
Tony De La Nuez
cd460522c5 odb: Implement option for overriding of default odb backend priority
Introduce GIT_OPT_SET_ODB_LOOSE_PRIORITY and GIT_OPT_SET_ODB_PACKED_PRIORITY
to allow overriding the default priority values for the default ODB
backends. Libgit2 has historically assumed that most objects for long-
running operations will be packed, therefore GIT_LOOSE_PRIORITY is
set to 1 by default, and GIT_PACKED_PRIORITY to 2.
When a client allows libgit2 to set the default backends, they can
specify an override for the two priority values in order to change
the order in which each ODB backend is accessed.
2021-07-30 10:29:51 -04:00
lhchavez
d15b6132a6 Fix one memory leak in master
There was one test that wasn't correctly disposing of the repository.
2021-07-30 07:18:57 -07:00
Edward Thomson
cc68c19a3a Merge branch 'pr/5861' 2021-07-30 08:56:51 -04:00
Edward Thomson
f2915ec488 tests: reformat upstream merge 2021-07-30 08:56:34 -04:00
Edward Thomson
47dd9f4797 Merge branch 'pr/5940' 2021-07-30 08:52:37 -04:00
Edward Thomson
346f15ba89 status: document GIT_STATUS_OPT_INCLUDE_UNREADABLE
Document `GIT_STATUS_OPT_INCLUDE_UNREADABLE`, and some minor cleanups.
2021-07-30 08:51:43 -04:00
Edward Thomson
708d9336bb Merge pull request #5953 from boretrk/c99-inline
common.h: use inline when compiling for C99 and later
2021-07-30 08:34:28 -04:00
Edward Thomson
003a1df654 Merge pull request #5952 from libgit2/ethomson/attrs_from_commit
Support reading attributes from a specific commit
2021-07-29 08:48:17 -04:00
Edward Thomson
f313b3834b Merge pull request #5954 from Crayon2000/patch-1 2021-07-28 08:14:08 -04:00
Crayon
59af78a48f Fix typo in general.c 2021-07-28 01:58:32 -04:00
Edward Thomson
f08cae109d Merge pull request #5767 from lhchavez/cgraph-reachable-from-any 2021-07-27 18:59:15 -04:00
lhchavez
8d453f1638 Swap the order of the git_graph_reachable_from_any params
len, array -> array, len
2021-07-27 13:00:31 -07:00
lhchavez
ce5400cdc7 graph: Create git_graph_reachable_from_any()
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
2021-07-27 08:14:08 -07:00
Edward Thomson
08c79128be Merge pull request #5766 from lhchavez/cgraph-generation-cmp
commit-graph: Introduce `git_commit_list_generation_cmp`
2021-07-27 10:18:52 -04:00
lhchavez
6f544140a0 commit-graph: Introduce git_commit_list_generation_cmp
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
2021-07-26 18:46:17 -07:00
Peter Pettersson
88a3b8e1c8 common.h: use inline when compiling for c99 and later 2021-07-26 23:12:12 +02:00
Edward Thomson
2370e49102 Merge pull request #5765 from lhchavez/cgraph-revwalks
commit-graph: Use the commit-graph in revwalks
2021-07-26 16:27:54 -04:00
Edward Thomson
43b5075df4 Merge pull request #5890 from lolgear/git_submodule_dup
[Submodule] Git submodule dup
2021-07-22 17:07:56 -04:00
Edward Thomson
c87e476009 Merge branch 'pr/5948' into main 2021-07-22 16:51:11 -04:00
Edward Thomson
fe40de40d8 trace: drop unnecessary write indirection 2021-07-22 16:50:26 -04:00
Edward Thomson
1439b9ff05 filter: introduce GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT
Provide a mechanism to filter using attribute data from a specific
commit (making use of `GIT_ATTR_CHECK_INCLUDE_COMMIT`).
2021-07-22 16:40:42 -04:00
Edward Thomson
0bd547a8be attr: introduce GIT_ATTR_CHECK_INCLUDE_COMMIT
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.
2021-07-22 16:22:28 -04:00
Edward Thomson
093d579f7b attr: cache nonexistent attr files from commits
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.
2021-07-22 16:22:28 -04:00
Edward Thomson
d7e8b9348c filter: add git_filter_options
Allow filter users to provide an options structure instead of simply
flags.  This allows for future growth for filter options.
2021-07-22 16:22:28 -04:00
Edward Thomson
1db5b2199b filter: filter options are now "filter sessions"
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).
2021-07-22 15:08:50 -04:00
Edward Thomson
3779a04794 attr: introduce git_attr_options for extended queries
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.
2021-07-22 15:08:50 -04:00
Edward Thomson
1cd863fd16 attr: include the filename in the attr source
The attribute source object is now the type and the path.
2021-07-22 15:08:50 -04:00
Edward Thomson
96dc1ffdc8 attr: the attr source is now a struct
We may want to extend the attribute source; use a structure instead of
an enum.
2021-07-22 15:08:50 -04:00
Edward Thomson
5ee5048841 attr: rename internal attr file source enum
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.
2021-07-22 15:08:50 -04:00
Edward Thomson
5c5c19a6b9 Merge pull request #5951 from libgit2/ethomson/strict_alloc
Optional stricter allocation checking (for `malloc(0)` cases)
2021-07-20 08:51:57 -04:00
Edward Thomson
b0980dcfb3 Update src/allocators/stdalloc.c
Co-authored-by: lhchavez <lhchavez@lhchavez.com>
2021-07-20 08:25:59 -04:00
Calvin Buckley
688bf4ce38 Remove macro magic 2021-07-19 19:25:58 -03:00
Edward Thomson
c69852d6bc ci: enable strict allocation checking on one node 2021-07-19 16:03:36 -04:00
Edward Thomson
31e84edb14 merge: don't try to malloc(0) 2021-07-19 16:02:30 -04:00
Edward Thomson
419ffdde6a packbuilder: don't try to malloc(0) 2021-07-19 15:51:53 -04:00
Edward Thomson
48e6b02be9 alloc: add GIT_DEBUG_STRICT_ALLOC
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.
2021-07-19 15:41:44 -04:00
Calvin Buckley
950a7f76e2 Variadic arguments aren't in C89
This refactors this to a wrapper function, as well as changing the
existing API have a va_list and ... version.
2021-07-17 16:21:05 -03:00
Edward Thomson
6a7f04030e Merge pull request #5941 from NattyNarwhal/stdintification
stdintification: use int64_t and INT64_C instead of long long
2021-07-16 08:47:37 -04:00
Edward Thomson
d6bea53d10 Update tests/graph/commit_graph.c 2021-07-16 08:47:28 -04:00
Edward Thomson
36e803069f Merge pull request #5945 from boretrk/resynctimer
git__timer: Allow compilation on systems without CLOCK_MONOTONIC
2021-07-16 08:41:18 -04:00
Calvin Buckley
589654d8b4 khash 64-bit type is unsigned, use int32_t too
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
2021-07-15 20:34:14 -03:00