Re:Using GNU Stow to manage your dotfiles
by dietrichepp on Tuesday October 21, 2014 @02:56PM
(#8489076)
I remember giving advice once, to someone who did that and then
[ Parent
| on HN ]
That is terrifying. I just added this to my zshrc:
git() {
local toplevel=$(command git rev-parse --show-toplevel 2>/dev/null)
if [[ "${toplevel}" == "${HOME}" ]] && [[ "$1" == "clean" ]]; then
>&2 echo "Do NOT run git clean in this repository."
return
fi
command git "$@"
}That is especially problematic with gits directory traversal behavior. If you are in a wrong directory inside your home, you might accidentally nuke your homedir instead of the intended repo.