git git status がつらいと聞いて
最近某社の人と、「そういうコマンドあったんだ」みたいな話ってあんまり外に出てこないし、無駄なことしてる可能性あるよね(意訳)みたいな話をした。
ということでそういうコマンドをどんどん書いていきたい。
1個目は git git 問題。
git まで打って、少し考えて git git status と走らせたことはないだろうか。僕はある。あれは悲しい。
drop-git() {
if let "$# > 0"; then
while [[ "$1" == "git" ]]; do
shift 1
done
if type command >/dev/null 2>&1; then
command git "$@"
else
git "$@"
fi
else
if type command >/dev/null 2>&1; then
command git
else
git
fi
fi
}
alias git="drop-git"
ということでこういう alias を張って凌いでいる。