Commit Graph

15192 Commits

Author SHA1 Message Date
Edward Thomson
18e5a56a03 fix 2023-08-24 09:55:04 +01:00
Edward Thomson
0e0b2a030d mbed 2023-08-23 10:18:27 +01:00
Edward Thomson
07b59bc0f8 fix 2023-08-22 17:48:51 +01:00
Edward Thomson
122dc51d7f hmm 2023-08-22 17:39:08 +01:00
Edward Thomson
f42e9550bd openssl 2023-08-22 17:15:13 +01:00
Edward Thomson
2b2d9ae44a z 2023-08-22 16:13:29 +01:00
Edward Thomson
6f4a6f5b1e fix 2023-08-22 16:05:08 +01:00
Edward Thomson
1df6e952b8 streams win32 2023-08-22 14:25:46 +01:00
Edward Thomson
818141df73 fixup! checkpoint 2023-08-22 06:40:48 -04:00
Edward Thomson
c2eafb2f6e checkpoint 2023-08-22 06:40:28 -04:00
Edward Thomson
ae3d81e2b8 wip - refactoring stream interface 2023-08-21 22:14:46 +01:00
Edward Thomson
75cc95110a streams: remove proxy idea
Streams don't have proxies. Remove this concept.
2023-08-21 22:14:45 +01:00
Edward Thomson
c8dfd09454 url: move git_net_url into net/url.[ch] 2023-08-20 15:34:54 +01:00
Edward Thomson
36d7ac1907 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-20 15:34:54 +01:00
Edward Thomson
551d6030a7 http: teach httpclient user-agent as options 2023-08-20 15:34:54 +01:00
Edward Thomson
b76a0270c7 streams: move to util 2023-08-20 15:34:54 +01:00
Edward Thomson
d6fb8bfde0 streams: renaming for consistency 2023-08-20 15:34:54 +01:00
Edward Thomson
ea767fe3d0 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-20 15:34:41 +01:00
Edward Thomson
43619608a4 threadstate: remove the thread state object
We now have no "big single object" that contains thread state.
2023-08-20 14:57:23 +01:00
Edward Thomson
70de6ae692 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-20 14:57:23 +01:00
Edward Thomson
1e040b1844 errors: move into util 2023-08-20 14:57:23 +01:00
Edward Thomson
e98814fb89 errors: keep thread-local state internal 2023-08-20 14:57:23 +01:00
Edward Thomson
f11f6b952e 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-20 14:57:23 +01:00
Edward Thomson
f89427acf4 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-20 14:57:23 +01:00
Edward Thomson
f32c5c48c3 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-20 14:57:23 +01:00
Edward Thomson
2cbe89d937 ssh: refactor to avoid using error state
The error handling in the ssh certificate callback is straightforward.
There's no error messages from an external library that need to be
saved, we populate the error message ourselves. Since there's nothing
custom here, it does not need to use the error saving mechanism.
2023-08-20 14:57:23 +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