4 ms·
Oookay, we're going to need the gist of how you built that. That sounds cool.
by i336_ 9y ago
Oookay, we're going to need the gist of how you built that. That sounds cool.
- cyphar 9y agoIt's quite crude, since all I needed was the current branch name and the hash. git internally does a bunch of cache warming and verification that make it slower, so I just don't do that. The code is in my dotfiles[1]. I've been meaning to update it to include more information but I really don't want to have to touch packfiles in shell. [1]: https://github.com/cyphar/dotfiles/blob/acbd9096a1daead80ba50ebef3fa1b6fdb5a89a2/.zsh/prompt#L49-L153 https://github.com/cyphar/dotfiles/blob/acbd9096a1daead80ba5...
- i336_ 9y agoThanks! Parsing git information without using git has always been mildly interesting to me :) This is most definitely for zsh, FWIW; I choked slightly on `echo $var[1,12]` for a minute there. That's not a problem - you wrote this for your shell prompt, you use zsh, it makes sense to use zsh features - I'm just noting that others might need to do a bit of porting. (I personally use bash by choice myself because it's the most widely installed shell and I don't want to switch until I fully know how to make the most concise and least surprising use of it.)