dotfiles
dotfiles copied to clipboard
Update .bash_prompt
parse_git_dirty wasn't always working for me, this seemed to make the call more consistent.
Related: https://github.com/paulirish/dotfiles/commit/db886671ccfce35a83802c4d5a6c07fd5f20005c This solution is less accurate than what’s currently in this repository (i.e. it doesn’t consider having an untracked file as ‘dirty’), but it is much faster.
Also https://github.com/mathiasbynens/dotfiles/pull/155.
Thanks for the quick reply, could you clarify your last comment? Are you saying that your current implementation does identify untracked files and my update does not, or are you saying that untracked files should not make a repo 'dirty'?
I was talking about @paulirish’s version: it doesn’t consider new, untracked files as dirty, even though it should IMHO — but it’s probably worth it because of the greatly improved performance (especially on large repositories like the WebKit project).
IMHO ideally we’d have both: a fast implementation that still detects untracked files. What does your version do?
Thanks for the clarification, my change is a hybrid of what @mathiasbynens and @paulirish had. Although I can't speak to its speed, it does detect untracked files and it removes the wildcards from the string evaluation.
I was using @paulirish implementation before and I noticed that it would give me a false positive during commits and wasn't tracking untracked files, so this was my stab at bringing two worlds together.
Yeah i just updated my branch check .. git branch
is SLOOOW. my new one is ~ 2x faster.
If you check out the chromium or blink git repos you'll see why perf matters. waiting 5s after hitting ^-C hurts. :)