why can't one alias `git stash`?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey.

Personally, I've always disliked that `git stash` already does the
`push` and would have much more preferred it, if it did a `stash list`.

So I tried to solve this via an alias like:
[alias]
        stash = "!c(){ if [ \"$#\" -eq 0 ]; then git stash list; else git stash \"$@\"; fi; }; c"

which seems however to be ignored when the alias name is "stash" (it
works as it should when I use e.g. foo = ...).


Any idea why that doesn't work?


Also when using such shell functions seems to be not extensively
documented (or I didn't find it)... the example in git-config gives the
"!c()..." syntax but doesn't seem to tell what the ! is for?

Are these functions executed in a separate shell execution environment
(or could I accidentally override a function from some git shell
script)?

Is there any sanitisation of the environment that the shell gets (or
does it simply get whatever the user has)?
I mean a badly set IFS or similar could easily cause troubles.


Thanks,
Chris.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux