Commit Graph

14609 Commits

Author SHA1 Message Date
Edward Thomson
8444b6dce7 odb_hash*: accept the oid type to hash into
The git_odb_hash helper functions should not assume SHA1, and instead
should be given the oid type that they're producing.
2022-06-20 17:05:29 -04:00
Edward Thomson
c50b280fa5 oid: provide an oid type to hash type map
We intentionally separate oid types from hash types; a hash is a generic
hunk of bytes, an object id has meaning and backs an object on disk.  As
a result of this separation, we need a 1:1 mapping.
2022-06-20 17:05:29 -04:00
Edward Thomson
14798060a6 oid: specify a default implementation
libgit2's current default oid type is SHA1, set a public macro for that.
2022-06-20 17:05:29 -04:00
Edward Thomson
817324134c clar: format sha256 in cl_assert_equal_oid 2022-06-20 17:05:29 -04:00
Edward Thomson
0db1c57cf0 oid: add sha256 typed oids 2022-06-20 17:05:29 -04:00
Edward Thomson
3fbf580c91 oid: give oids a type
`git_oid`s now have a type, and we require the oid type when creating
the object id from creation functions.
2022-06-20 17:05:29 -04:00
Edward Thomson
61838295a0 object: move oid header printing to object 2022-06-14 22:29:57 -04:00
Edward Thomson
b7a46fa850 object: move oid header parsing to object 2022-06-14 22:29:57 -04:00
Edward Thomson
c43601160b oid: include maximum oid raw/hex sizes 2022-06-14 22:29:57 -04:00
Edward Thomson
0b068214a5 oid: add functions to inspect oid information
Provide helper functions to provide information about the object id size
given its type.
2022-06-14 22:29:57 -04:00
Edward Thomson
74ffce2078 oid: introduce git_oid_t
We require an enumeration to help us identify the different types of
object IDs.  Currently, we only support SHA1 but we will support SHA256
in the future.
2022-06-14 22:29:57 -04:00
Edward Thomson
0acaf3a8eb oid: define GIT_OID_SHA1_ZERO
Callers should not assume the layout of the oid structure; provide them
a macro that defines the null / zero sha1 object id.
2022-06-14 22:29:57 -04:00
Edward Thomson
dbc4ac1c76 oid: GIT_OID_*SZ is now GIT_OID_SHA1_*SIZE
In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ`
need to indicate that they're the size of _SHA1_ OIDs.
2022-06-14 22:29:57 -04:00
Edward Thomson
f98dd5438f Merge pull request #6321 from libgit2/ethomson/ownership
repo: allow administrator to own the configuration
2022-06-13 22:14:37 -04:00
Edward Thomson
05f211543b Merge pull request #6322 from libgit2/ethomson/stat
status: update documentation for default options
2022-06-13 21:56:01 -04:00
Edward Thomson
fb68f18071 status: update documentation for default options 2022-06-13 21:44:05 -04:00
Edward Thomson
70a182c6d0 Merge pull request #6320 from libgit2/ethomson/config-docs
config: update config entry iteration lifecycle
2022-06-13 21:38:32 -04:00
Edward Thomson
cdff2f0237 repo: allow administrator to own the configuration
Update our ownership checks that were introduced in libgit2 v1.4.3
(to combat CVE 2022-24765). These were not compatible with git's; git
itself allows administrators to own the path. Our checks now match
this behavior.
2022-06-13 21:37:04 -04:00
Edward Thomson
1ed1e19afa config: update config entry iteration lifecycle 2022-06-13 21:23:42 -04:00
Edward Thomson
96c6117414 cmake: only use getloadavg where it exists 2022-06-13 12:16:27 -04:00
Edward Thomson
3809ab0eb8 cmake: add gnu library for Haiku 2022-06-13 10:50:40 -04:00
Edward Thomson
9bc82c8f88 cmake: detect getentropy
Look for `getentropy` and flag its existence.
2022-06-13 10:46:21 -04:00
Edward Thomson
7eb7edd4a1 Merge pull request #6278 from lhchavez/git_transport_smart_remote_connect_options
transport: introduce `git_transport_smart_remote_connect_options`
2022-06-12 10:51:13 -04:00
Edward Thomson
cc4c37ca9e transport: remove git_transport_smart_proxy_options
Snuck in during refactoring; let's get rid of it.
2022-06-12 10:50:43 -04:00
Edward Thomson
d333dbea26 Merge pull request #6288 from libgit2/cmn/mwindow-simplifications
A couple of simplications around mwindow
2022-06-12 10:40:12 -04:00
Edward Thomson
660e6bd5cd Merge pull request #6023 from libgit2/ethomson/clang-format
Add a .clang-format with our style
2022-06-11 21:21:01 -04:00
lhchavez
0a7c00be7f Merge remote-tracking branch 'origin/main' into main 2022-06-11 14:31:16 -07:00
lhchavez
a75416761c Apply suggestions from code review
Co-authored-by: Edward Thomson <ethomson@github.com>
2022-06-11 14:29:15 -07:00
Edward Thomson
2b28ee77ca Merge pull request #6319 from libgit2/ethomson/progress_32bit
CLI: progress updates
2022-06-11 16:51:04 -04:00
Edward Thomson
28d2ea1d28 Merge pull request #6305 from zawata/fix_refdb_error_msg
refs: fix missing error message
2022-06-11 16:50:56 -04:00
Edward Thomson
3b8a06c01c Merge pull request #6287 from SkinnyMind/docs-typos
docs: fix couple of typos
2022-06-11 16:50:35 -04:00
Edward Thomson
565a331737 Merge pull request #6299 from dongcarl/patch-1
revparse: Remove error-prone, redundant test
2022-06-11 16:28:12 -04:00
Edward Thomson
4f7b568db2 Merge pull request #6291 from libgit2/cmn/midx-no-hash
midx: do not verify the checksum on load
2022-06-11 16:26:50 -04:00
Edward Thomson
3a7371694c progress: fewer updates about throughput
Avoid too much flashing on the console with updates about throughput.
Only update throughput once a second.
2022-06-11 16:14:11 -04:00
Edward Thomson
286e7f0ad0 cli: show progress on 32 bit machines 2022-06-11 16:08:28 -04:00
Edward Thomson
4f0ee02fc2 Merge pull request #6306 from libgit2/ethomson/ci_test
Include test results data in CI
2022-06-11 15:40:10 -04:00
Edward Thomson
6bd024aacd Merge pull request #6309 from ccstolley/ccs_fix_midx_offset
midx: fix large offset table check.
2022-06-11 15:38:33 -04:00
Edward Thomson
11b81717f6 Merge pull request #6318 from apnadkarni/patch-3
Add link to Tcl bindings for libgit2
2022-06-11 15:36:37 -04:00
Edward Thomson
529aa17380 Merge pull request #6310 from theseion/add-pharo-to-language-bindings
chore(docs): Add Pharo to language bindings
2022-06-11 15:35:42 -04:00
apnadkarni
f140f69bd5 Add link to Tcl bindings for libgit2 2022-06-02 16:15:42 +05:30
Max Leske
25830642f8 chore(docs): add Pharo to language bindings 2022-05-22 14:13:09 +02:00
Colin Stolley
97954ee546 Replace bitwise AND 0x7fffffff with XOR 0x80000000.
Though both are correct, this makes it clear that we're dealing with
the same value.
2022-05-20 14:15:27 -05:00
Colin Stolley
8a765c72a8 midx: fix large object offset table check.
It's insufficient to only check if the offset high order bit is set, we
must also check to see if object_large_offsets are in use.

This bug is causing objects to appear missing because they can't be
found in the index.
2022-05-20 14:00:18 -05:00
Edward Thomson
3fada6695e ci: show test results summary 2022-05-17 17:51:44 -04:00
Edward Thomson
8747c0041d ci: upload test result data as artifacts 2022-05-17 16:27:24 -04:00
Edward Thomson
fd8d3673c8 ci: use uid/gid of actions runner
Avoid mismatches between the container uid/gid and the actions runner,
build the container with the actions runner's uid/gid
2022-05-17 16:24:43 -04:00
John Alden
640e8a6301 fix missing error message 2022-05-17 11:01:43 -07:00
Carl Dong
7f53d7b600 revparse: Remove error-prone, redundant test
Originally introduced in: 776a6a8e5f

This test case has recently been fixed in bdab22384c, but that fix will only last for a year. Next year the same problem will crop up and the test will need to be re-edited.

This is not ideal as
- This test case becomes an unnecessary burden for developers
- Downstream distros or even just users who want to build older versions of libgit2 are guaranteed to have this test fail

Furthermore, this test case is entirely unnecessary, as the functionality that was originally (see 776a6a8e5f) intended to be tested is well-covered by subsequent tests which specify a date instead of a "x ago" specification.
2022-05-09 12:09:08 -04:00
Carlos Martín Nieto
a3f9617bcf midx: do not verify the checksum on load
This is something we only want to do during explicit verification rather than on
every load.

Verifying does not seem like a big deal when we're running with test workloads
but once your `multi-pack-index` reaches gigabytes, we spend more time hashing
this than doing any work.
2022-05-03 14:09:40 +02:00
Carlos Martín Nieto
bdab22384c revparse: adjust reflog test as we move away from the dates
The dates we use in `refs::revparse::date` has just passed the ten years, so
now everything is beyond ten years, leading to an unexpected commit being
returned.

Adjust it to 11 years so it all looks fine again.
2022-05-03 09:28:43 +02:00