bashstrap
bashstrap copied to clipboard
Shows incorrect 'dirty' indication for Git repository
The prompt was working as intended since long. But lately, it's showing the *
indication for clean repositories too. Behaviour is recurring even on a fresh OS install.
Details: OS: Mac OS Sierra. Was also happening on El Capitan recently.
@purezen
It happens, because script tries to find substring working directory clean
in git status
output.
This text was returned in git v1.9.1, but now git v2.10.1 returns working tree clean
.
You can replace text in your .bash_profile
: https://github.com/barryclark/bashstrap/blob/master/.bash_profile#L77
Would be nice to have this updated in the .bash_profile file. There is even a pull request for it. Is this project still maintained?
@rkrv
@purezen
The parse_git_dirty
function can be fixed by replacing it with:
parse_git_dirty() {
[[ -n "$(git status -s 2> /dev/null)" ]] && echo "*"
}
much less operations and it works as expected
This has been addressed in MustyMouse/bashstrap#1