summaryrefslogtreecommitdiff
path: root/src/subcommands/diff.rs
AgeCommit message (Collapse)Author
2024-11-28Support external subcommands: rg, diff, git-show (etc.) (#1769)Thomas Otto
* Support external subcommands: rg, git show, git log (etc.) The possible command line now is: delta <delta-args> [SUBCMD <subcmd-args>] If the entire command line fails to parse because SUBCMD is unknown, then try (until the next arg fails) parsing <delta-args> only, and then parse and call SUBCMD.., its output is piped into delta. Other subcommands also take precedence over the diff/git-diff mode (`delta a b`, where e.g. a=git and b=show), and any diff call gets converted into an external subcommand first. Available are: delta rg .. => rg --json .. | delta delta a b .. => git diff a b .. | delta delta git show .. => git <color-on> show .. | delta and all other git-CMDS, of which add -p, blame, checkout -p, diff, grep, log -p, reflog -p, and stash show -p produce a diff. Because --json is automatically added for `delta rg ..`, it avoids the parsing ambiguities of and is easier to type than `rg .. | delta`. The piping is not done by the shell, but delta, so the subcommands are now child processes of delta. * Set calling process directly because delta started it This info then takes precedence over whatever start_determining_calling_process_in_thread() finds or rather doesn't find. (The simple yet generous SeqCst is used on purpose for the atomic operations.)
2024-11-29clippy 1.83: silence zombie_processes false positiveThomas Otto
But now < 1.83 clippy would complain about an unknown lint, so allow that, too.
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.
2024-08-15Support passing arguments to git diff and diff (#1697)Dan Davison
Adds --diff-args with short form -@.
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-11-13Fix clippy warnings (#1236)clnoll
2022-03-01Run in diff mode iff two positional arguments are suppliedDan Davison
Fixes #989
2022-02-23Fall back to plain diff when process substitution is used (#978)Thomas Otto
When detecting input generated by `delta <(echo foo) <(echo bar)` fall back to plain `diff` instead of `git diff --no-index`. This does not respect various git settings anymore (the original reason to switch from `diff` to `git diff`), but is better than just showing the names of the temporary files.
2022-02-15Make git include colors in output going to delta (#966)Dan Davison
Fixes #965
2021-08-29Refactor: subcommands moduleDan Davison