Commit Graph

2573 Commits

Author SHA1 Message Date
Edward Thomson
ca225744b9 v1.9.2: update changelog and version numbers 2025-12-02 21:51:10 +00:00
Edward Thomson
4bb0ece2a2 v1.9.1: update version numbers 2025-06-06 14:40:38 +01:00
Yuriy Chernyshov
c38a362ec6 Fix circular includes between types.h and oid.h 2025-06-06 13:58:55 +01:00
Dominique Fuchs
e07acfda4a docs: correct docstring info for git_remote_url
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2025-06-06 13:58:55 +01:00
Edward Thomson
298a9ba6c0 Include common.h in version.h
Fixes #7027
2025-06-06 13:58:55 +01:00
Florian Pircher
2a601e0d76 include: Fix code comment termination 2025-06-06 13:32:47 +01:00
Edward Thomson
3aeb5bd0f6 meta: revert soname version update
Changing our SONAME / ABI version update policy without an announcement
is a breaking change. Provide time to announce a policy update.
2024-12-28 08:30:39 +00:00
Edward Thomson
c536fcbb85 v1.9: update version numbers
Update the library's (API) version number to v1.9.0. Also update the
soname version number to 2.0, since we've had breaking ABI changes
to the library.
2024-12-28 01:00:19 +00:00
Edward Thomson
ccc202802c Merge pull request #6962 from ryan-ph/ryanpham/negative-refspec/remote
remote: Handle fetching negative refspecs
2024-12-24 23:55:06 +00:00
Edward Thomson
67900a0fcb options: update X509 cert constant
By placing the X509 cert constant option in the middle of the existing
options, it renumbers everything unnecessarily. Move it to the end in
to avoid breaking changes.
2024-12-23 09:47:03 +00:00
Edward Thomson
19a031d075 Introduce git_libgit2_feature_backend API
Provide a mechanism to understand the backend provider for feature
within libgit2. For example, one can query the mechanism that provides
HTTPS by asking for the backend for the `GIT_FEATURE_HTTPS`.

This is particularly useful for features that are not completely
isomorphic; the HTTPS providers may have slightly different
functionality that can be controlled (eg, certificates or cipher
support). And the SSH feature is _very_ different between libssh2 and
OpenSSH.

It may also be useful to understand the support for things like the SHA1
or SHA256 backends to ensure that sha1dc is used, or that FIPS mode is
enabled.
2024-12-22 15:37:56 +00:00
Edward Thomson
6aa9bc4a97 midx: add options to writer function
Provide an options structure to MIDX writing. This allows us to
specify information (like OID type) during writer creation.
2024-12-18 16:27:46 +00:00
Edward Thomson
0738b054d3 commit_graph: add opts to open function
Provide an options structure to commit graph opening. This allows us to
specify information (like OID type) during opening.
2024-12-18 16:27:46 +00:00
Edward Thomson
54d666e5f7 commit_graph: move opts to new function
Instead of making the commit and dump functions take individual options
structures; provide the options structure to the writer creator. This
allows us to add additional information (like OID type) during
generation.
2024-12-18 16:27:46 +00:00
Edward Thomson
622035e6ad repo: take an options structure for repository_new
Future-proof the SHA256-ification of `git_repository_new` by taking an
options structure instead of an oid type.
2024-12-18 16:27:46 +00:00
Edward Thomson
43c31ecc42 repo: don't require oid_type to wrap_odb
The `wrap_odb` function doesn't need to know the OID types in the object
database; the object database already knows the type.
2024-12-18 16:27:46 +00:00
Edward Thomson
cefcabfcc1 repo: specify odb options to odb_wrap
odb wrapping
2024-12-18 16:27:46 +00:00
Edward Thomson
9aa5faa38b indexer: move oid_type into the opts structure
Object ID type should be an option within the options structure; move it
there.
2024-12-18 16:27:46 +00:00
Edward Thomson
708d64f1e8 index: provide a index_options structure when opening
Instead of simply taking the oid type, future-proof our index opening
and creation functionality by taking an options structure.
2024-12-18 16:12:21 +00:00
Ryan Pham
3d9f4061ca refspec: Add func to distinguish negative refspecs
Negative refspecs were added in Git v2.29.0 and are denoted by prefixing
a refspec with a caret. This adds a way to distinguish if a refspec is
negative and match negative refspecs.
2024-12-17 09:23:28 +09:00
Edward Thomson
f675ea3cd7 docs: remind people about git_libgit2_init
Currently `git_libgit2_init` must be called before you can work with the
library. Remind people about this as they read the documentation.
2024-12-11 10:54:21 +00:00
Edward Thomson
455ce40994 Make GIT_WIN32 an internal declaration
The `GIT_WIN32` macro should only be used internally; keep it as such.
2024-12-09 23:36:34 +00:00
Edward Thomson
4282cbd6d8 Merge remote-tracking branch 'main' into mempack_empty 2024-12-09 22:38:29 +00:00
Edward Thomson
4bb69b0827 odb_mempack: use an out param 2024-12-09 22:36:10 +00:00
Edward Thomson
88fee7af56 Documentation: update refdb_backend docs
Parameters are documented by `@param`, not `@arg`
2024-12-09 21:52:44 +00:00
Edward Thomson
338ceb93b6 Improve documentation 2024-11-26 21:44:09 +00:00
Edward Thomson
5353a2cc20 reflog: remove unused sys functions
The `git_reflog_entry__alloc` function is not actually defined, nor
used. Remove references to it in the headers. It is not clear why the
corresponding `__free` is, or should be, exported. Make it internal to
the library.
2024-11-26 21:22:10 +00:00
Caleb Owens
d2f5ce220c Update documentation of merge_base_many 2024-10-23 19:10:39 +01:00
Vladyslav Yeremeichuk
b190162f3e Add the ability to get the number of objects in mempack
Implement git_mempack_object_count, which returns the number of
objects in mempack and -1 on error.
2024-10-22 13:58:10 +03:00
Vladyslav Yeremeichuk
d1be60bbe8 Add the ability to check if a mempack is empty
Implement git_mempack_empty, which returns 1 if the mempack is empty
and 0 otherwise.
2024-10-21 22:42:56 +03:00
Edward Thomson
1692d30809 Merge pull request #6559 from libgit2/ethomson/update_tips_spec
remote: add update_refs with git_refspec
2024-10-20 00:04:52 +01:00
Edward Thomson
c1b2b25ebc remote: add update_refs callback
Add an `update_refs` callback that includes the refspec; `update_tips`
is retained for backward compatibility.
2024-10-19 23:42:26 +01:00
Edward Thomson
69555048fd clone: refactor to pass clone options around
Instead of dealing with the clone options sub-options (fetch, checkout,
etc) individually, treat them as a cohesive whole when passing them
throughout the system.

Additionally, move some functions around within the file to avoid
unnecessary decls at the top of the file.  And change a function
signature to avoid conflating truth with error.
2024-10-19 23:01:35 +01:00
Edward Thomson
933b62eedf checkout: make safe checkout the default
Make `GIT_CHECKOUT_SAFE` the default.  `NONE` is never what the user
wants _by default_; people expect checkout to, well, check things out.
Instead, it should be an opt-in "dry run" mode.

This removes some odd code in internal callers of `checkout` that takes
a `git_checkout_options` and updates the mode to `SAFE`.  This is now
unnecessary since everything has better defaults.
2024-10-19 23:01:35 +01:00
GravisZro
f1cac063ba Mandate C90 conformance
This PR ensures and enforces C90 conformance for all files C, including tests.

* Modify CMakeLists.txt to mandate C90 conformance (for better compiler compatibility)
* Update deps/ntlmclient/utf8.h to latest version
* Modify two tests and one header to use C comments instead of C++ comments
2024-10-18 22:26:57 +01:00
Edward Thomson
1ee2c33993 blame: provide line accessor
blame: introduce git_blame_line

Provide a structure that can provide the line-level information.
2024-10-18 10:02:02 +01:00
Edward Thomson
49402cc614 blame: add commit summary information 2024-10-18 10:02:02 +01:00
Edward Thomson
5378b80a9f blame: add final committer information
Our blame implementation tracks final _author_ but not final
_committer_. Make it so.
2024-10-18 10:02:02 +01:00
Edward Thomson
9cea29d154 blame: update API
Use `size_t` for sizes, standardize naming with the rest of the library.
2024-10-18 10:02:02 +01:00
John Colvin
c2d697e3ce s/size on bytes/size in bytes/ 2024-10-16 14:55:12 +01:00
Edward Thomson
751c68f1b6 Merge pull request #6877 from yerseg/ability_to_add_custom_x509_certs
ssl: ability to add raw X509 certs to the cert store
2024-10-02 13:09:31 +01:00
Edward Thomson
fa5b832544 openssl: point out the interaction between certs
The OpenSSL certificate setting functions _may_ interact; try to
document that a bit better.
2024-10-01 20:53:59 +01:00
Edward Thomson
2ba17303d0 Merge pull request #6882 from HamedMasafi/main
Add LIBGIT2_VER_CHECK Macro for Version Comparison
2024-09-30 23:26:41 +01:00
Edward Thomson
50d492063a Rename version constants to LIBGIT2_VERSION
For consistency, use LIBGIT2_VERSION_... as the constant name; deprecate
LIBGIT2_VER_... names.
2024-09-30 23:02:00 +01:00
Edward Thomson
e0b8b4b960 Add LIBGIT2_VERSION_CHECK and LIBGIT2_VERSION_NUMBER 2024-09-30 22:13:44 +01:00
Edward Thomson
54100fc081 Update include/git2/common.h 2024-09-29 22:58:39 +01:00
Edward Thomson
9ddd72f22a Merge pull request #6875 from roberth/mempack-thin-packfile 2024-09-27 17:20:00 +02:00
Robert Hensing
f9c35fb509 Add git_mempack_write_thin_pack
Unlike existing functions, this produces a _thin_ packfile by
making use of the fact that only new objects appear in the
mempack Object Database.

A thin packfile only contains certain objects, but not its whole
closure of references. This makes it suitable for efficiently
writing sets of new objects to a local repository, by avoiding
many small I/O operations.

This relies on write_pack (e.g. git_packbuilder_write_buf) to
implement the "recency order" optimization step.

Basic measurements comparing against the writing of individual
objects show a speedup during when writing large amounts of
content on machines with comparatively slow I/O operations,
and little to no change on machines with fast I/O operations.
2024-09-27 12:39:05 +02:00
Edward Thomson
9f3406163b Merge pull request #6804 from libgit2/ethomson/config_entry
config: remove `free` ptr from `git_config_entry`
2024-09-25 11:24:48 +02:00
Hamed Masafi
88bd589f7c Add VER_CHECK macro 2024-09-14 12:03:17 +03:30