-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support external subcommands: rg, diff, git-show (etc.) (#1769)
* 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.)
- Loading branch information
Showing
8 changed files
with
550 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.