Skip to content

Commit

Permalink
bash completion: add space between branch name and status flags
Browse files Browse the repository at this point in the history
Improve the readability of the bash prompt by adding a space between
the branch name and the status flags (dirty, stash, untracked).

While we are cleaning up this section of code, the two cases for
formatting the prompt are identical except for the format string,
so make them the same.

Suggested-by: Roman Fietze <roman.fietze@telemotive.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Dec 31, 2009
1 parent c18d5d8 commit 4cc4738
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,8 @@ __git_ps1 ()
fi
fi

if [ -n "${1-}" ]; then
printf "$1" "$c${b##refs/heads/}$w$i$s$u$r"
else
printf " (%s)" "$c${b##refs/heads/}$w$i$s$u$r"
fi
local f="$w$i$s$u"
printf "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r"
fi
}

Expand Down

0 comments on commit 4cc4738

Please sign in to comment.