diff-so-fancy icon indicating copy to clipboard operation
diff-so-fancy copied to clipboard

git dependency

Open 0-wiz-0 opened this issue 3 years ago • 1 comments

When I use diff-so-fancy in an environment where git is not installed I see:

# diff-so-fancy  --help
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Can't exec "git": No such file or directory at /usr/pkg/bin/diff-so-fancy line 451.
Diff-so-fancy: https://github.com/so-fancy/diff-so-fancy
Version      : 1.4.2

Usage:

git diff --color | diff-so-fancy         # Use d-s-f on one diff
cat diff.txt | diff-so-fancy             # Use d-s-f on a diff/patch file
diff -u one.txt two.txt | diff-so-fancy  # Use d-s-f on unified diff output

diff-so-fancy --colors                   # View the commands to set the recommended colors
diff-so-fancy --set-defaults             # Configure git-diff to use diff-so-fancy and suggested colors
diff-so-fancy --patch                    # Use diff-so-fancy in patch mode (interoperable with `git add --patch`)

# Configure git to use d-s-f for *all* diff operations
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

# Configure git to use d-s-f for `git add --patch`
git config --global interactive.diffFilter "diff-so-fancy --patch"

But diff-so-fancy is useful without git (diff(1), hg(1)), so perhaps these warnings can be at least hidden?

0-wiz-0 avatar Jan 09 '22 14:01 0-wiz-0

This is a valid issue. I hadn't really considered the use case where git is not installed at all. I will ponder this today.

scottchiefbaker avatar Jan 13 '22 16:01 scottchiefbaker

@0-wiz-0 I just landed 9ffea48 which should address this. If this doesn't address your issue please open this issue back up.

scottchiefbaker avatar Jun 09 '23 17:06 scottchiefbaker

Works for me, thank you!

0-wiz-0 avatar Jun 09 '23 21:06 0-wiz-0

@0-wiz-0 great news. Thanks for reporting back. I will cross this one off the list ;)

scottchiefbaker avatar Jun 09 '23 21:06 scottchiefbaker