Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions git-extra/git-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ else
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'\u@\h ' # user@host<space>
PS1="$PS1"'\[\033[35m\]' # change to purple
PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
if [ ! -z "$MSYSTEM" ]
then
PS1="$PS1"'\[\033[35m\]' # change to purple
PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
fi
Comment on lines +16 to +20
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change needs a substantially improved commit message

@DRSDavidSoft are you working on this?

PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
PS1="$PS1"'\w' # current working directory
if test -z "$WINELOADERNOEXEC"
Expand Down