From ea8b29a0a7144166e0950a0d2a1e0d43176a3c06 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Sun, 1 Mar 2020 21:36:14 -0500 Subject: Update README with install/usage instructions --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b7799fd..cfc085e 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,43 @@ [diff-highlight](https://github.com/git/git/tree/master/contrib/diff-highlight) (and, eventually, [diff-so-fancy](https://github.com/so-fancy/diff-so-fancy)) on Windows, because Perl and Windows -[don't](https://github.com/so-fancy/diff-so-fancy/issues/361) seem to +[don't seem](https://github.com/so-fancy/diff-so-fancy/issues/361) +to [get along](https://github.com/microsoft/terminal/issues/4738) when it comes to ANSI coloring. This project is still in early development. +## Installation + +Make sure you have PowerShell Core (`pwsh.exe`) in your `PATH` somewhere. Then, copy the `pwsh-diff` +script to a directory in your `PATH`. That's it! + +## Usage + +Configure Git to use `pwsh-git` for all diff/log output: + +```ps +git config --global core.pager "pwsh-diff | less --tabs=4 -RFX" +``` + +### Improved colors + +`pwsh-diff` will read the same color settings expected by `diff-highlight`, and it depends on Git +itself to colorize everything besides the lines with highlighted bits. The following options are +recommended: + +```ps +git config --global color.ui true + +git config --global color.diff-highlight.oldNormal "red bold" +git config --global color.diff-highlight.oldHighlight "red bold 52" +git config --global color.diff-highlight.newNormal "green bold" +git config --global color.diff-highlight.newHighlight "green bold 22" + +git config --global color.diff.old "red bold" +git config --global color.diff.new "green bold" +``` + ## Acknowledgements Much of the requisite logic has been adapted directly from the aforementioned -- cgit v1.2.3