Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

vcs_info: an variable for the .git directory in hooks



vcs_info exposes the `base` variable in `hook_com` to get to the base directory of a repository. For git, the only use I know is to get to the .git directory in order to retrieve something there. For example, this hook <http://eseth.org/2010/git-in-zsh.html#show-stashed-changes> looks up $base/.git/refs/stash to see if there are any stashed changes.

However, that's a bad idea, because it won't work in eg. submodules, where the real .git folder is in .git/modules/path/to/module/. The correct solution is to use `git rev-parse --git-dir` which will do the right thing. Would that make sense to expose the result of that command in a `miscN` variable?

Quentin


Messages sorted by: Reverse Date, Date, Thread, Author