copied from git's repo (contrib/completion)

https://github.com/git/git/tree/master/contrib/completion