hexdump by default will replace any repeated groups with an asterisk and
a newline, which breaks prompts. This can be disabled with the `-v`
flag. For example:
```
printf 'aac' | hexdump -e '1/1 "%02x"'
61*
63
printf 'abc' | hexdump -e '1/1 "%02x"'
616263
printf 'aac' | hexdump -ve '1/1 "%02x"'
616163
```
When spawning a new bash session when entering a virtual environment
the VIRTUAL_ENV is overwritten by this line.
However not having this line does not affect the bin/activate script.
Stop as soon as "svn status" shows a change, not needed to walk through
all the changes in the whole repository. For my large repository this is
about twice as fast.
Extract just the information we need from "svn info"
When current-context does not exist or is unset in $KUBECONFIG, kubectl
is throwing a message to stderr "error: current-context is not set".
Ignore it.
In order to make `git_prompt_vars` run faster
As a user with slow `git stash list`
I want to be able to optionally disable running `git stash list` when
`git_prompt_vars` is executed
This patch adds very simple support for the Perforce SCM:
https://www.perforce.com/
Although perforce is proprietary software, it's somewhat prevalent in enterprise
companies. This patch looks to provide some basic bash_it functionality that
I've come to love for git. I base everything off of two perforce commands:
$ p4 set
This command does not require a connection the perforce server, it simply tells
us if a directory is managed by the Perforce SCM or not. In addition the
command:
$ p4 opened
is used to provide the list of pending changes in the client and the number of
opened files in the client. The `p4 opened` command requires a connection to the
perforce server, hence it's run under a `timeout` command. The "p4 opened"
processing into it's own bash file that now has to be sourced at the top-level
bash-it.sh. Since the processing in simple the newly added: _p4-opened-counts
function returns a number of things that are not currently used, but since I had
awk open and doing the processing, I've chosen to include them in the output
anyway.
Testing:
- Tested with the powerline-multiline theme in a few perforce based
workspaces/clients
- Ran:
❯ shellcheck themes/p4helpers.theme.bash
and fixed all the errors
- Ran the test suite:
❯ test/run
[...]
182 tests, 0 failures, 1 skipped
`tr 'A-Z' 'a-z'` will only convert non-accented characters. Switching to
`[:upper:]` and `[:lower:]` adds support for accents.
See https://github.com/koalaman/shellcheck/wiki/SC2018
Additionally, printf's character splitting does not support accented
characters, so output isn't as expected. Using bash's variable expansion
syntax instead will correctly get the full accented character.