Wow, am I the only person who prefers a shell prompt of just "$ "? I have a bunch of abbreviations for common git commands, though, so I guess it balances out.
I like a timestamp so that I know: (1) How long the last command took (approx, as there's time between the prompt showing and me putting in a command) (2) How long ago I ran the last command in a given shell window
Git info in your ZSH Prompt
21–27 of 27 posts
Re: Git info in your ZSH Prompt
#22Earlier quoted context omitted.
The one I wrote, for Bash, uses SIGALRM (via the Time::HiRes perl module) to time out after half a second: http://github.com/paulbaumgart/git-situational-awareness
It would be cool to do the opposite as well, don't start checking the fancy vcs stuff until 1/2 second after the prompt is loaded.
Re: Git info in your ZSH Prompt
#23Earlier quoted context omitted.
You're not- I can't stand waiting 3-5 seconds every time I hit enter, just so I can have a more verbose prompt that tells me things I already knew.
The one I wrote, for Bash, uses SIGALRM (via the Time::HiRes perl module) to time out after half a second: http://github.com/paulbaumgart/git-situational-awareness
When I want to fiddle with minor configuration details, hey, bash and zsh users have nothing on emacs. ;)
Re: Git info in your ZSH Prompt
#24You can also use Git's own __git_ps1 from git-completion.bash in either bash or in zsh (see my other comment). Here's an example of it in use: http://github.com/avar/dotfiles/blob/master/.bashrc#L86 It doesn't give you info about whether you have staged files (but maybe it should). But it gives you a bunch of other neat stuff, like whether you're in a git-rebase or git-am operation
Re: Git info in your ZSH Prompt
#25Wow, am I the only person who prefers a shell prompt of just "$ "? I have a bunch of abbreviations for common git commands, though, so I guess it balances out.
You're not- I can't stand waiting 3-5 seconds every time I hit enter, just so I can have a more verbose prompt that tells me things I already knew.
On the other hand, in this case I frequently just use 'git status' which reports my branch anyway among other info I want to double-check just in case I somehow forgot, and this is really just a neat shell trick rather than being really useful, like the one that prints a green ':)' when the last command succeeded and a red ':(' when it failed...
Re: Git info in your ZSH Prompt
#26You can also use Git's own __git_ps1 from git-completion.bash in either bash or in zsh (see my other comment). Here's an example of it in use: http://github.com/avar/dotfiles/blob/master/.bashrc#L86 It doesn't give you info about whether you have staged files (but maybe it should). But it gives you a bunch of other neat stuff, like whether you're in a git-rebase or git-am operation
It definitely can tell you whether you have staged files, because I use it for that among other things. I don't remember how I turned that feature on, but it wasn't hard. Perhaps someone will chime in with the details.
export GIT_PS1_SHOWDIRTYSTATE=yes
export GIT_PS1_SHOWUNTRACKEDFILES=yesRe: Git info in your ZSH Prompt
#27Earlier quoted context omitted.
It definitely can tell you whether you have staged files, because I use it for that among other things. I don't remember how I turned that feature on, but it wasn't hard. Perhaps someone will chime in with the details.
Just add the following lines in your .bashrc: export GIT_PS1_SHOWDIRTYSTATE=yes export GIT_PS1_SHOWUNTRACKEDFILES=yes