Skip to content

[bash completion] selectively disable the git bash prompt #12

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

Closed
wants to merge 1 commit into from
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
8 changes: 7 additions & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
# per-repository basis by setting the bash.showUpstream config
# variable.
#
# You can disable output from __git_ps1 per repository by setting
# the bash.prompt config variable to "false".
#
#
# To submit patches:
#
Expand Down Expand Up @@ -226,7 +229,10 @@ __git_ps1_show_upstream ()
__git_ps1 ()
{
local g="$(__gitdir)"
if [ -n "$g" ]; then

if [ "$( git config bash.prompt )" == "false" ]; then
echo ""
elif [ -n "$g" ]; then
local r=""
local b=""
if [ -f "$g/rebase-merge/interactive" ]; then
Expand Down