Commit Graph

15185 Commits

Author SHA1 Message Date
Edward Thomson
979615298d wip 2023-08-19 15:24:53 +01:00
Edward Thomson
8a160f7a98 fixup 2023-08-19 14:36:10 +01:00
Edward Thomson
332ad46acf fixup - cast carefully on windows for calling conventions 2023-08-19 14:31:46 +01:00
Edward Thomson
ac3c8cc73b fixup git_stream 2023-08-18 23:35:16 +01:00
Edward Thomson
ba22522e95 fix - git_stream nomenclature 2023-08-18 23:14:58 +01:00
Edward Thomson
ad65a4e204 fix - error state 2023-08-18 23:12:49 +01:00
Edward Thomson
31d22a070e url: move git_net_url into net/url.[ch] 2023-08-18 17:20:58 +01:00
Edward Thomson
eb0c1423e6 http: move httpclient into utils
The httpclient pieces are not git-specific code, and should (ideally)
belong in the utility area. Move them there.
2023-08-18 17:20:58 +01:00
Edward Thomson
fbca082ab0 http: teach httpclient user-agent as options 2023-08-18 17:20:40 +01:00
Edward Thomson
7971dbbe74 streams: move to util 2023-08-18 15:01:52 +01:00
Edward Thomson
5947827d88 https: further renaming for consistency 2023-08-18 15:01:47 +01:00
Edward Thomson
75cd761e09 https: rename constants for consistency
Rename constants like `GIT_OPENSSL` to (eg) `GIT_HTTPS_OPENSSL` to be
nice and hierarchical and match things like our `GIT_SHA1` constants.
2023-08-18 15:01:40 +01:00
Edward Thomson
f1346cc2a3 threadstate: remove the thread state object
We now have no "big single object" that contains thread state.
2023-08-18 14:56:26 +01:00
Edward Thomson
1261c10cde oid: move thread local storage into oid.c
Now that thread-local error data is handled in error, move the thread
local data out of the `threadstate` object, since it has now become
useless indirection.
2023-08-18 14:54:47 +01:00
Edward Thomson
f8f93a8604 errors: move into util 2023-08-18 14:20:28 +01:00
Edward Thomson
9c1b70b0bc errors: keep thread-local state internal 2023-08-18 14:20:28 +01:00
Edward Thomson
d0dd293969 errors: simplify the saved-state handling
Instead of having a separate type for saving state, we can re-use the
`git_error` structure. In practice, saving the error code along with the
`git_error` information has not proven necessary or useful, so it can be
removed to simplify down to re-using a single structure.
2023-08-18 14:20:28 +01:00
Edward Thomson
a8f3381719 errors: move systems things into the sys includes
Most callers only need to _get_ error messages. Only callers implemented
more complicated functions (like a custom ODB for example) need to set
them.

(Callback users should likely ferry their own error information in their
callback payload.)
2023-08-18 14:20:28 +01:00
Edward Thomson
bd28315689 errors: never return a NULL error
Callers want to be able to simply call `git_error_last()->message`,
not have to worry about whether `git_error_last()` returns NULL or not.
2023-08-18 14:20:28 +01:00
Edward Thomson
8ffdc5a90c Merge pull request #6616 from libgit2/ethomson/config_cmd
cli: add a `git config` command
2023-08-14 20:41:10 +01:00
Edward Thomson
45647b721c Merge pull request #6615 from libgit2/ethomson/config_origin
config: provide an "origin" for config entries
2023-08-14 20:40:47 +01:00
Edward Thomson
af15738151 Merge pull request #6621 from mathworks/conan-link-update
README.md: Fix link to conan packages
2023-08-14 16:22:59 +01:00
Laurence McGlashan
7f098da459 README.md: Fix link to conan packages 2023-08-14 16:11:32 +01:00
Edward Thomson
95f3d41364 Merge pull request #6619 from libgit2/revert-6586-fix/cmake_msvc
Revert "CMake: Search for ssh2 instead of libssh2."
2023-08-10 10:39:04 +01:00
Edward Thomson
52db5d11c5 Revert "CMake: Search for ssh2 instead of libssh2." 2023-08-10 09:52:04 +01:00
Edward Thomson
804506ba57 Merge pull request #6597 from mathworks/proxy_invalid_url_crash
proxy: Return an error for invalid proxy URLs instead of crashing.
2023-08-02 20:46:05 +01:00
Edward Thomson
38b60fd062 winhttp: use new http-style url parser for proxies 2023-08-02 11:02:44 +01:00
Edward Thomson
5a64922408 http: test proxies in url and host:port format
Test proxies specified by both host:port format in configuration
options, environment variables, and `http.proxy` configuration.
2023-08-02 09:46:12 +01:00
Edward Thomson
b6fdb3cbdf http: allow proxies to be specified in common format
The common format for specifying proxy URLs is just 'host:port'. Handle
the common case.
2023-08-01 14:12:01 +01:00
Edward Thomson
8749655745 net: introduce http-biased url parsing
Introduce a url parser that defaults to treating poorly specified URLs
as http URLs. For example: `localhost:8080` is treated as
`http://localhost:8080/` by the http-biased url parsing, instead of a
URL with a scheme `localhost` and a path of `8080`..
2023-08-01 14:12:01 +01:00
Edward Thomson
8c2c0fa80a net: refactor url parsing
Refactor url parsing to simplify the state-passing (introducing a
struct) and add a path parser for future reusability.
2023-08-01 14:12:01 +01:00
Edward Thomson
a79aa14206 httpclient: safety 2023-08-01 14:12:01 +01:00
Edward Thomson
782c4d4d8f Merge pull request #6599 from steven9724/fix-ssh-memleak
ssh: fix known_hosts leak in _git_ssh_setup_conn
2023-07-30 09:03:37 +01:00
Edward Thomson
593ff41b34 Merge pull request #6610 from mascguy/mascguy-errSSLNetworkTimeout
stransport: macOS: replace errSSLNetworkTimeout, with hard-coded value
2023-07-27 22:52:32 +02:00
Edward Thomson
929ec75451 cli: add --add and --replace-all to config 2023-07-26 11:41:03 +02:00
Edward Thomson
a7512e6803 cli: add file levels to config command 2023-07-26 11:41:03 +02:00
Edward Thomson
4470ea3920 cli: use cli_repository_open 2023-07-26 11:41:03 +02:00
Edward Thomson
90d3cc6cd4 cli: common options 2023-07-26 11:41:03 +02:00
Edward Thomson
005bccea58 cli: reorder arguments for subcommands
Instead of special casing `--help`, reorder the arguments for
subcommands so that it can handle "global" arguments like `--help`,
`-c key=value`, etc.
2023-07-26 11:41:03 +02:00
Edward Thomson
1c381acf9d cli: accept configuration on the command line
Introduce `cli_repository_open` which will reparse command-line options
looking for `-c` or `--config-env`. Add those values to an in-memory
configuration database and configure the opened repository with that.
2023-07-25 19:26:29 +02:00
Edward Thomson
877968418a cli: add config command
Add a `config` command with `--list` and `--get`.
2023-07-25 18:55:04 +02:00
Edward Thomson
21d3301135 config: provide two memory-backed config backends
Provide two memory-backed configuration backends -- one that takes a
string in config file format `[section] key=value` and one that takes a
list of strings in `section.key=value` format.
2023-07-25 18:38:15 +02:00
Edward Thomson
1977a9a450 config: memory backends have an optional type 2023-07-25 18:38:15 +02:00
Edward Thomson
d901220276 config: provide origin in git_config_entry
A git_config_entry now knows the type of the origin for the entry
("file", "memory", etc) and the path details (for files, the path on
disk). This is propagated through snapshots.
2023-07-25 18:38:15 +02:00
Edward Thomson
a8cac7ff7d config: drop entry payload; teach config_list about entries
The opaque `payload` on an entry is unnecessary and distracting; config
entries should follow the patterns of other objects and use space
elsewhere in the structure with a "base" config entry struct embedded.
2023-07-25 18:38:15 +02:00
Edward Thomson
1951864f7d config: rename config_entries to config_list 2023-07-25 18:38:15 +02:00
Edward Thomson
23ba7aedff config: complete entry during creation
Don't set entry data when we "get" an entry from the collection, add the
data to the entry before it's put into the collection. This keeps the
entry creation logic in a single place.
2023-07-25 18:38:15 +02:00
Christopher Nielsen
3e15292d88 stransport: macos: replace errSSLNetworkTimeout, with hard-coded value
- Constant only available in 10.13+, causing build failures for older macOS releases
Fixes: https://github.com/libgit2/libgit2/issues/6606
2023-07-24 20:43:23 -04:00
Edward Thomson
42b5d85276 Merge pull request #6608 from dvzrv/dvzrv/fix_git_oidarray_import
fix: Add missing include for oidarray.
2023-07-22 14:41:04 +01:00
David Runge
f7c746a2ef fix: Add missing include for oidarray.
Add a missing include for `git2/oidarray.h` so build doesn't fail on
using `git_oidarray` when using custom transports.

Fixes #6607
2023-07-21 16:18:39 +02:00