so-fancy / diff-so-fancy

Good-lookin' diffs. Actually… nah… The best-lookin' diffs. :tada:
MIT License
17.36k stars 335 forks source link

When viewing diff in a subdirectory paths aren't relative #467

Closed ghost closed 1 year ago

ghost commented 1 year ago

When I'm viewing a diff with "git diff ." while beeing in a subdirectory of a project the paths shows still point to the root of the project, which is a bit annoying since I cannot just select and copy the paths to a new git command as i'd usually do.

Not sure if this can be fixed, but perhaps by taking the current working directory into account?

scottchiefbaker commented 1 year ago

git by default shows absolute paths (from the base of the repo). If you pass the --relative flag you will get what you want. You can put this in your ~/.gitconfig

[diff]
    relative = true

More information on Stack Overflow.

ghost commented 1 year ago

Thanks!