News for hackers. Stuff that matters.
Re:Using GNU Stow to manage your dotfiles by burke on Tuesday October 21, 2014 @02:33PM (#8488944)
I just made ~/.git and ignore everything with .gitignore, whitelisting files I want to commit: https://github.com/burke/dotfiles/blob/master/.gitignore

It works really well for me.

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

    git clean -dfx
Re:Using GNU Stow to manage your dotfiles by burke on Tuesday October 21, 2014 @04:01PM (#8489536)
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 "$@"
    }
Re:Using GNU Stow to manage your dotfiles by zokier on Tuesday October 21, 2014 @03:20PM (#8489241)
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.