Skip to content

Commit 2651b15

Browse files
authored
Replace complicated dsf alias with simple alias and corresponding pager
This setup makes use of an additional `pager` config for the `dsf` alias to avoid having to spawn a new shell command, forward the arguments, and deal with internal details like `$GIT_PREFIX`.
1 parent a2671f0 commit 2651b15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pro-tips.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ You can do also do a one-off:
66
```shell
77
git diff --color | diff-so-fancy
88
```
9-
or configure an alias to use `diff-so-fancy`:
9+
or configure an alias and a corresponding pager to use `diff-so-fancy`:
1010
```shell
11-
git config --global alias.dsf '!f() { [ -z "$GIT_PREFIX" ] || cd "$GIT_PREFIX" '\
12-
'&& git diff --color "$@" | diff-so-fancy | less --tabs=4 -RFXS; }; f'
11+
git config --global alias.dsf "diff --color"
12+
git config --global pager.dsf "diff-so-fancy | less --tabs=4 -RFXS"
1313
```
1414

1515
#### Opting-out

0 commit comments

Comments
 (0)