Skip to content

Commit 46bc690

Browse files
Merge branch 'patch-mode-35' of https://github.com/wren/diff-so-fancy into next
2 parents e178338 + ed24bc1 commit 46bc690

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

diff-so-fancy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if ($args->{color_on}) {
5353
$color_forced = 1;
5454
}
5555

56-
# `git add --patch` requries our output to match the number of lines from the
56+
# `git add --patch` requires our output to match the number of lines from the
5757
# input. So, when patch mode is active, we print out empty lines to pad our
5858
# output to match any lines we've consumed.
5959
if ($args->{patch}) {
@@ -711,9 +711,13 @@ diff -u one.txt two.txt | diff-so-fancy # Use d-s-f on unified diff output
711711
712712
diff-so-fancy --colors # View the commands to set the recommended colors
713713
diff-so-fancy --set-defaults # Configure git-diff to use diff-so-fancy and suggested colors
714+
diff-so-fancy --patch # Use diff-so-fancy in patch mode (interoperable with `git add --patch`)
714715
715716
# Configure git to use d-s-f for *all* diff operations
716-
git config --global core.pager \"diff-so-fancy | less --tabs=4 -RFX\"\n";
717+
git config --global core.pager \"diff-so-fancy | less --tabs=4 -RFX\"
718+
719+
# Configure git to use d-s-f for `git add --patch`
720+
git config --global interactive.diffFilter \"diff-so-fancy --patch\"\n";
717721

718722
return $out;
719723
}

0 commit comments

Comments
 (0)