Skip to content
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

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

AnyOldName3
Copy link

Resolves #2799

@AnyOldName3
Copy link
Author

I don't think the CI failure is related - the linker's complaining about expat.lib being missing, but I've just edited an unrelated shell script.

Copy link
Member

@dscho dscho left a 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>
@dscho
Copy link
Member

dscho commented Sep 14, 2020

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).

@dscho
Copy link
Member

dscho commented Oct 8, 2020

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).

@dscho dscho merged commit 3706bcf into git-for-windows:main Oct 8, 2020
@dscho dscho added this to the Next release milestone Oct 8, 2020
dscho added a commit to git-for-windows/build-extra that referenced this pull request Oct 8, 2020
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>
dscho added a commit that referenced this pull request Oct 8, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 8, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 8, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 8, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 8, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 8, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 8, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit to dscho/git that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit to dscho/git that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 9, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 12, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 12, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 13, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit to dscho/git that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit to dscho/git that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 15, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 16, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 16, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 19, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 19, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
git-for-windows-ci pushed a commit that referenced this pull request Oct 19, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 20, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
dscho added a commit that referenced this pull request Oct 24, 2020
Allow GIT_PS1_COMPRESSSPARSESTATE to be unset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git Bash prompt doesn't work with set -u
2 participants