I added an alias in my ~/.gitconfig:
[alias]
h = "!git status -s | LC_ALL=C sort -k1 | my_function"
But when I call git h, I get:
> git h
git status -s|LC_ALL=C sort -k1| my_function: my_function: command not found
Now, I know that my function exists in my local shell. It's in my .bashrc and I can see it when I call compgen -A function:
> compgen -A function|grep my_function
my_function
> my_function
(expected output)
Why isn't git recognizing that I've already defined the function in my shell?