From 73f81a18d4d860337f1343e89f2e3a250e83c5cc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:23:05 +0200 Subject: Adding git prompt. Signed-off-by: Daniel Baumann --- debian/local/bash/profile.d/zz-git.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 debian/local/bash/profile.d/zz-git.sh (limited to 'debian/local/bash/profile.d/zz-git.sh') diff --git a/debian/local/bash/profile.d/zz-git.sh b/debian/local/bash/profile.d/zz-git.sh new file mode 100644 index 0000000..4b7dac6 --- /dev/null +++ b/debian/local/bash/profile.d/zz-git.sh @@ -0,0 +1,18 @@ +# /etc/profile.d/zz-git.sh + +if [ "$(id -u)" -ne 0 ] && [ ! -e /etc/profile.d/zz-powerline.sh ] && [ -e /usr/lib/git-core/git-sh-prompt ] +then + export GIT_PS1_DESCRIBE_STYLE="branch" + export GIT_PS1_SHOWCOLORHINTS="true" + export GIT_PS1_SHOWDIRTYSTATE="true" + export GIT_PS1_SHOWSTASHSTATE="true" + export GIT_PS1_SHOWUNTRACKEDFILES="true" + export GIT_PS1_SHOWUPSTREAM="verbose" + + if [ -n "$SSH_CONNECTION" ] + then + export PROMPT_COMMAND="__git_ps1 '' '\[\033[1;32m\]\u\[\033[0m\]@\H:\w\\$ '" + else + export PROMPT_COMMAND="__git_ps1 '' '\[\033[1;32m\]\u\[\033[0m\]:\w\\$ '" + fi +fi -- cgit v1.2.3