![]() ![]() Frankly I've thought about removing it entirely, and that might be the better way to go. That's what I mean when I say you want to turn off the informative prompt. If you stop that, and just see if there are modified/staged/untracked/etc things are much faster, while still giving you the important information (do you act any differently if there are 3 modified files as opposed to 2?). The bit in git prompts that is always the slowest is counting how many modified/staged/untracked/etc files there are. Options -b, -branch, Show branch information -show-stash, Show stash information -porcelain version, Give the output in the short-format -ahead-behind. That's basically the same point about counting stuff again. ![]() Add -uall, and the result matches, but suddenly all of the performance improvement disappears. Give the output in an easy-to-parse format for scripts. For instance I've run your code on a test repo of mine, it reports "3" untracked files, while the current code reports 60000 - because it just reports that 3 directories have changed. ![]() Only nobody turns on the -z NUL-delimited mode.Īnd the speedup is typically because it counts differently - git status -porcelain will not decend into subdirectories. Technically the porcelain format was meant to be machine-readable, which implies that you need to be able to use arbitrary filenames - that includes newlines. It "works perfectly" for you because you barely do anything with it. I recall renamed files being a particular PITA.īasically, both versions of git status -porcelain are bad, but the v1 format is truly horrible once you look a little closer. In that case it was about the paths it prints, but just using spaces here is quite awkward, and some other, more unusual, notations are awful. >git stash The result is: >fatal: bad object HEAD >fatal: 'git stash -porcelain' failed in submodule xxxx >cannot save the current worktree state I want to stash my last modificat. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |