In-short: would like prompt to appear faster, although it's not sluggish.
Making a custom prompt for my bash terminal; the following list is in my /etc/bash.bashrc
I already use the "gitstatus" repo, which speeds up certain git commands. I think slowdowns come from the number of commands themselves. I want to know if I can generally use LESS git commands to do the same thing.
Here is a list of everything I do:
- Obtain branch (if head detached, commands requiring it skipped)
- Check for upstream
git rev-list --left-right --count "$branch"..."$upstream"
to check if ahead or behind- Check for stashes
EDIT: Disregard #5. I called command #8 first, obtained this information, and appended #5 to PS1
before command #8
Check for dirty branch (done separately; I know #8 provides this info, but this command is called earlier on, and I like the symbol there)
Check for remote
Check for untracked files (separately than the bullet below, as they are located early in the prompt as I treat them as a higher priority "problem")
All at once check for modified, added, removes, or unmerged files by parsing
git status -s
These are run using one git command per line. Will provide an image if needed as well.
On Bash for Windows terminal.