Closed chris-marsh closed 3 years ago
Mostly resolved in dev branch commit https://github.com/chris-marsh/pureline/commit/74cc57bdb488d091c0f46719b08219bb2a259628.
This reduces git calls to 3 and much improves performance.
Commit https://github.com/chris-marsh/pureline/commit/baf76dff37136649be63429be99c00c2ee30125b removes grep and tr from git stash list
. Not much difference in performance since still making a git call, but it feels right using a bash loop to count the result.
Reduced from initial 8 calls to 3;
branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
while...done <<< "$(git status -b --porcelain 2> /dev/null)"
while...done <<< "$(git stash list 2> /dev/null)"
Good enough for now.
Need to improve the performance of the git segment.
8 calls to git (plus
wc
andtr
for those calls). Most of this could be reduced to a single call togit status ---porcelain --branch
and parsing the result.