git-prompt.sh: remove annoying space when MSYSTEM not set#472
git-prompt.sh: remove annoying space when MSYSTEM not set#472DRSDavidSoft wants to merge 2 commits intogit-for-windows:mainfrom
Conversation
Signed-off-by: David Refoua <David@Refoua.me>
|
CI is failing a |
Signed-off-by: David Refoua <David@Refoua.me>
| if [ ! -z "$MSYSTEM" ] | ||
| then | ||
| PS1="$PS1"'\[\033[35m\]' # change to purple | ||
| PS1="$PS1"'$MSYSTEM ' # show MSYSTEM | ||
| fi |
There was a problem hiding this comment.
While I suspect that the use case is broken (because MSYSTEM should always be set), I am open to getting convinced that it makes sense.
But a terse "remove annoying space when MSYSTEM not set" does not even begin to convince anyone.
In other words, this change needs a substantially improved commit message, one in accordance to https://github.blog/2022-06-30-write-better-commits-build-better-projects/.
After that is done, a better way to implement this is:
| if [ ! -z "$MSYSTEM" ] | |
| then | |
| PS1="$PS1"'\[\033[35m\]' # change to purple | |
| PS1="$PS1"'$MSYSTEM ' # show MSYSTEM | |
| fi | |
| PS1="$PS1${MSYSTEM:+\[\033[35m\]$MSYSTEM }" # show MSYSTEM in purple (if set) |
There was a problem hiding this comment.
this change needs a substantially improved commit message
@DRSDavidSoft are you working on this?
This PR has not seen any attempt to motivate the change in the past 3 weeks, therefore I'll close it. |
Signed-off-by: David Refoua David@Refoua.me
This commit removes the annoying double space in the first line of PS1 when
MSYSTEMis not set.