3 ms·
Personally, I'd argue you do want to keep track of whether you are in a repo or not, since including that pipeline in your PS1 always forks three processes on e
by decklin 17y ago
Personally, I'd argue you do want to keep track of whether you are in a repo or not, since including that pipeline in your PS1 always forks three processes on every prompt. And if you're going to do that in your shell, it's good to have separate commands for each task.
For the case of not being on a branch, the output of 'git branch' is not very useful. I am currently using 'git name-rev --name-only HEAD', but the contrib script has an even fancier mechanism (via 'git describe') for coming up with something to display when HEAD isn't a symbolic ref.