When not in the repo root dir `in_hg` used `hg summary` which is terribly slow on big repositories, and `hg_get_branch_name` called `hg branch` which is also pretty slow as well.
Based on the [branch](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/branch) plugin, I created the function `hg_get_dir` that fetch the `.hg` directory if it exists, going up in the directory tree. From there, we know if we're in an HG repository if `in_hg` returns a non empty string, and we can simply get the branch name from the content of the `.hg/branch` file.
### Benchmarks
Based on 10 calls to `hg_get_branch_name` in subdir (so that the old `hg summary` is called), here are the average times:
* Before: `/tmp/test.zsh 0.08s user 0.04s system 96% cpu 0.133 total`
* After: `/tmp/test.zsh 0.00s user 0.00s system 71% cpu 0.008 total`
It's faster and it uses less CPU!
The other changes after that are purely esthetic (fit in 80 columns and indentation fix).
PHP can be executed as CLI script but due to the automated attempt
to add browser support to that extension such ability is prevented
in certain circumstances.
This allows for the user to combine the jump command with something else. In my example cd and jump are now combined like this:
```bash
jumpcd() {
jump $1 > /dev/null || cd $1
}
alias cd="jumpcd"
```
Also:
- Changes `globes` (which doesn't exist) to `glob expressions`.
- Delete the `trigger autocompletion to your current aliases` use case, since that's not
really implemented.
* cp plugin: change cpv to function so that completion works
* cp plugin: show numbers in units of 1024 (K,M,G,T)
Use `-h` level (3): output numbers in units of 1024.
See the manpage of rsync for more information.
* cp plugin: add a README file
* cp plugin: recurse directories
* cp plugin: remove `--` to separate files from options
This has some undesired effects, like having `cpv --help` be a file
not found error.
Use `--` yourself if you need it (which you generally don't):
```zsh
cpv -- -some-file-with-hyphens.txt /tmp
```
Added this same info to the README.
This commit removes most of its contents: it just leaves the
contribution signature. The rest is obsolete and superseeded
by #5460, but the contribution is still valuable.
Related: #4263.
Signed-off-by: Marc Cornellà <marc.cornella@live.com>
The current list of directories to search for autoenv on misses the default location on Ubuntu systems if you just do a normal `pip install autoenv` - [it will place](https://github.com/kennethreitz/autoenv/blob/master/setup.py#L16) `activate.sh` in `/usr/local/bin` unless you manually override the `--prefix` or something.
The `/usr/local/opt/autoenv` is fine for macOS/homebrew installations but it would be nice not to have to manually patch on Linux :)
When making a WIP commit, we generally just want to save the state of the
current branch temporarily, maybe because we want to push our work for backup
purposes, or change branch to work on something else. Therefore, it's generally
undesirable to run Git hooks, which might do things like run linters, because
we probably don't care if our WIP has lint errors.