[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pimp your shell - Debian developer tips?



On Wed, May 27, 2020 at 8:00 PM Adam Borowski wrote:

> I would like to add at minimum:
> * current git branch (but not -dirty as that can take ages on large repos
>   on slow media -- you want changing directory to be instant)

The standard git prompt stuff supports turning each part off individually:

$ cat ~/.bash.d/vcs
source /usr/lib/git-core/git-sh-prompt
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWUPSTREAM="auto verbose"
GIT_PS1_SHOWUPSTREAM=auto
GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_DESCRIBE_STYLE=branch

> * result of the last command

I wrote the attached bash monstrosity with the help of a few folks. It
is buggy in a few ways but works for me (including for PIPESTATUS). It
also enables the standard git prompt stuff and does some other things.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

Attachment: z_prompt
Description: Binary data


Reply to: