summaryrefslogtreecommitdiff
path: root/src/git_config
AgeCommit message (Collapse)Author
2024-11-20testability: add pretty_assertions, git mocksThomas Otto
2024-11-05Add optional capture-output writer to run_app()Thomas Otto
The output and exit code of run_app() are now testable, used for diff test.
2023-08-13Support users other than git in github SSH URLs (#1509)Dan Davison
E.g. org-123456@github.com:temporalio/api.git
2023-04-26Replace deprecated `error_chain` crate with `anyhow` (#1405)nickelc
The `error_chain` crate is now deprecated for a long time and `anyhow` has proven to be a popular replacement for applications. This also improves the current error messages for panics. ``` PAGER='"less' git show thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: \ Error(Msg("Could not parse pager command."), State { next_error: Some(ParseError), \ backtrace: InternalBacktrace })', src/main.rs:136:88 ``` ``` PAGER='"less' git show thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Could not parse pager command. Caused by: missing closing quote', src/main.rs:125:88 ```
2023-03-12Merge the different `GitConfig` constructors for a config file (#1342)nickelc
The `try_create_from_path` function and the `from_path` function for tests can be merged into a single function.
2023-03-09Rename `git_config_entry` module to `remote` (#1337)nickelc
The `GitConfigEntry` enum has been removed from the module and now only contains the `GitRemoteRepo` type.
2023-03-08Get git's minus/plus style from config instead of copying it around (#1329)nickelc
2023-03-05Added config option. (#1324)Paolo Insogna
* feat: Added config option.
2023-03-05Return the `GitRemoteRepo` type directly (#1328)nickelc
The type is unnecessarily wrapped and it's the only use for `GitConfigEntry::GitRemote` enum variant.
2023-03-05Encapsulate `git2` types (#1326)nickelc
* Move theme iteration logic to `GitConfig` The `git2::Config` type is now encapsulated and the regex is given to `libgit2` to filter the config entries. * Move remote url getter to `GitConfig`
2023-02-28Fix clippy warnings (#1298)nickelc
* Fix clippy warnings - `clippy::uninlined_format_args` * Fix clippy warnings - `clippy::clone_on_copy` - `clippy::explicit_auto_deref` - `clippy::iter_cloned_collect` - `clippy::map_clone` - `clippy::needless_borrow` - `clippy::needless_lifetimes` - `clippy::needless_return` - `clippy::redundant_clone` - `clippy::redundant_field_names` - `clippy::seek_to_start_instead_of_rewind` - `clippy::unnecessary_cast` - `clippy::unused_unit`
2022-10-06Add codeberg link parsing (#1194)Chinmay Dalal
2022-09-14Add sourcehut link parsing (#1190)Chinmay Dalal
* Add sourcehut link parsing * refactor: GitRemoteRepo::GitHubRepo -> ..::GitHub, repo_slug -> slug https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names * readme.md: change bitbucket to sourcehut
2022-08-16Fix clippy warnings after rust 1.63 upgrademliszcz
Following fixes are included: * derive_partial_eq_without_eq: Eq trait was added by running `cargo clippy --fix --no-deps`. * get_first: Function was replaced by running `cargo clippy --fix --no-deps`. * unnecessary_to_owned: This check was disabled for ANSIString as to_string call is required to enforce formatting. Otherwise the underlying string was returned directly (probably due to Deref implementation). * type_complexity: Closure type was simplified and Box<> usage was removed.
2022-03-30Add custom env struct to store env at init (#1025)William Escande
This allow to no longer ignore some tests (marked previously as FIXME) by storing the env at the start of the program (Or creating a custom env for test purpose) This centralize almost alls calls to std::env inside one wrapper Add a test profile to increase speed for testing (5min -> 20sec on my machine) clean a few code style like this: ``` if Some(value) = ... if value ``` to ``` if Some(true) = ... ``` Co-authored-by: William Escande <wescande@google.com>
2022-02-21Enable commit links for GitLab (#972)Johan Wärlander
* Enable commit links for GitLab
2022-01-17Construct hyperlink file path relative to cwdDan Davison
Fixes #890
2022-01-04Make Config cloneable for DeltaTest, store as Cow<Config> thereThomas Otto
Only cloneable when testing, the types git2::Config and git2::Repository in GitConfig contain C pointers and can't really be cloned.
2021-10-18Use fatal() to exit with errorcode 2 (#739)Thomas Otto
* Fix two typos * Dismantle two Pyramids of Doom Use question mark operator instead * Use fatal() to exit with errorcode 2
2021-07-26Recognize GitHub SSH remote URLs that don't start with `git@` for hyperlinks ↵Sebastian Paarmann
(#668) Closes #667. SSH remote URLs are usually formatted as `git@github.com:user/repo` but certain setups can allow using just `github.com:user/repo`, see issue #667 for an example. This modifies the regex used to detect a GitHub remote for hyperlink generation to also allow the latter form.
2021-04-24Support new GIT_CONFIG_PARAMETERS env var formatDan Davison
https://github.com/git/git/blob/311531c9de557d25ac087c1637818bd2aad6eb3a/Documentation/RelNotes/2.31.0.txt#L127-L130
2021-04-24Add failing test: support new GIT_CONFIG_PARAMETERS formatDan Davison
2021-04-24Use verbose regex styleDan Davison
2021-04-24Refactor test to allow multiple env var formats to be testedDan Davison
2021-04-24Implement tested feature: support HTTPs and SSH URLsDan Davison
2021-04-24Test HTTPS and SSH Github URLsDan Davison
2021-04-24Fix Github repo URL regexDan Davison
Ref #563
2021-04-24Add failing tests for remote repo string parsingDan Davison
2021-04-23Support matching GitHub remotes that don't end in `.git` (#563)Andy Freeland
`.git` is optional in clones from GitHub.com.
2021-03-27Get themes from gitconfig instead of hardcodingCatherine Noll
2021-01-08Reorganize git_config moduleDan Davison
2021-01-08Prevent tests setting env vars from affecting other testsDan Davison
2021-01-08Parse GIT_CONFIG_PARAMETERSDan Davison
When git is invoked as `git -c aaa.bbb=ccc -c ddd.eee=fff` then git sets the env var GIT_CONFIG_PARAMETERS containing the changed config entries, so that child processes can honor them. libgit2 doesn't yet honor the env var: see https://github.com/libgit2/libgit2/issues/3854. Fixes #493 Fixes #307 Ref https://github.com/dandavison/magit-delta/issues/13
2021-01-08Add accidentally not-committed fileDan Davison
2021-01-08Create git_config moduleDan Davison