From 77e3020b80faa3cd678e2bbc81391f98b270df9c Mon Sep 17 00:00:00 2001 From: milesfrain Date: Tue, 18 Apr 2023 22:59:55 -0700 Subject: [PATCH] Add instructions for one-off wrapper --- manual/src/git.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/manual/src/git.md b/manual/src/git.md index 47a8000be8..5eb8db9fce 100644 --- a/manual/src/git.md +++ b/manual/src/git.md @@ -10,6 +10,21 @@ $ GIT_EXTERNAL_DIFF=difft git log -p --ext-diff $ GIT_EXTERNAL_DIFF=difft git show e96a7241760319 --ext-diff ``` +A wrapper function makes these one-off commands more convenient: +```sh +# add to ~/.bashrc +gitt() { + GIT_EXTERNAL_DIFF=difft git $1 --ext-diff $@[2,-1] +} +``` + +Then use `gitt` instead of `git`: +``` +$ gitt diff +$ gitt log -p +$ gitt show e96a7241760319 +``` + If you want to use difftastic by default, use `git config`. ```