-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset #2800
Conversation
I don't think the CI failure is related - the linker's complaining about |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find!
Would you mind, though, making the commit message a little bit more stand-alone? I have something along these lines in mind:
prompt: avoid using unset variables
After `set -u` in Bash, [...]
This fixes https://github.com/git-for-windows/git/issues/2799
Signed-off-by: [...]
After `set -u` in Bash, the Git prompt would not be displayed and the error `bash: GIT_PS1_COMPRESSSPARSESTATE: unbound variable` would be printed, due to `GIT_PS1_COMPRESSSPARSESTATE` being unset by default when it gets used. This change sets a default value of an empty string to use when the variable is unset to explicitly make the behaviour consistent between `set -u` and `set +u`. This fixes git-for-windows#2799 Signed-off-by: Chris Djali <krizdjali+github@gmail.com>
Heads-up: @szeder provided a related patch in https://lore.kernel.org/git/20200911131943.GA23146@szeder.dev/t/#u (although it lacks a comprehensive commit message so far). |
I'll just go ahead and merge this so that we do not lose it (my hope was that this would get combined with @szeder's efforts, but they seem to have stalled). |
The Git Bash prompt [now works even after calling `set -u`](git-for-windows/git#2800). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Resolves #2799