Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem w/ usage #354

Closed
scy86dev opened this issue Nov 2, 2019 · 3 comments
Closed

Problem w/ usage #354

scy86dev opened this issue Nov 2, 2019 · 3 comments

Comments

@scy86dev
Copy link

scy86dev commented Nov 2, 2019

Your readme doesn't indicate basic usage from what I can see. When I try to do a diff such as...
diff-so-fancy file1 file2
... it replies with the following...

[~/sandbox] > diff-so-fancy file1.txt file2.txt 
Diff-so-fancy: https://github.com/so-fancy/diff-so-fancy
Version      : 1.2.6

Usage:

git diff --color | diff-so-fancy # Use d-s-f on one diff
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

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

What am I doing wrong here? I have already executed git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX" and have already setup the recommended colors via your readme instructions.

@scottchiefbaker
Copy link
Contributor

diff-so-fancy expect all data to be passed in via STDIN. If you want to use it outside of git it needs to be in the format of

diff -u file1 file2 | diff-so-fancy
cat foo.diff | diff-so-fancy

@alichtman
Copy link

alichtman commented Nov 7, 2019

You can put this in your .zshrc to use diff-so-fancy more easily from the command line:

function pdiff () {
	diff -u $1 $2 | diff-so-fancy
}

@scottchiefbaker
Copy link
Contributor

This should be addressed in the last commit I just landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants