Problem
I have three git aliases defined in .gitconfig (with an external bash script defining a function called diff-lines):
[alias]
diffc = diff --cached
diffnw = diff -w --ignore-cr-at-eol --ignore-all-space
diffln =!bash -c 'source $HOME/.bash_functions/diff-lines && git diff | diff-lines'
How can I define 'diffln' such that I can use it in combination with other aliases?
I'm looking for something to prevent me from having to define each version similar to:
diffcln =!bash -c 'source $HOME/.bash_functions/diff-lines && git diffc | diff-lines'
diffnwln =!bash -c 'source $HOME/.bash_functions/diff-lines && git diffnw | diff-lines'
diffcnwln =!bash -c 'source $HOME/.bash_functions/diff-lines && git diffnw --cached | diff-lines'
etc...
Previous Attempts
I have tried this:
diffln =!bash -c 'source $HOME/.bash_functions/diff-lines && git $@ | diff-lines'
and called via:
$ git diffln diffc
but it just gave me the default git options as if I was only calling $ git