Commit graph

5,935 commits

Author SHA1 Message Date
Marc Cornellà
aff4049499 chore: update git-lfs maintainer handle 2021-03-21 13:37:49 -04:00
Roman Perepelitsa
0675c91f4d fix(genpass): improve performance and usability and fix bugs (#9520)
*Bugs*

The following bugs have been fixed:

- All generators ignored errors from external commands. For example,
  if `/usr/share/dict/words` was unreadable, `genpass-xkcd` would
  print "0-" as a password and return success.
- All generators silently ignored the argument if it wasn't a number.
  For example, `genpass-apple -2` was generating one password and
  not printing any errors.
- All generators silently ignored extra arguments. For example,
  `genpass-apple -n 2` was generating one password and not printing
  any errors.
- `genpass-xkcd` was generating passwords with less than 128 bits of
  security margin in contradiction to documentation. The smaller the
  dictionary size, the weaker the passwords it was generating. For a
  dictionary with 27 words, `genpass-xkcd` was generating passwords
  with 93 bits of security margin (`log2(27!)`).
- The source of random data used by `genpass-xkcd` was not
  cryptographically secure in contradiction to documentation. See:
  https://www.gnu.org/software/coreutils/manual/html_node/Random-sources.html
- `genpass-apple` could generate a password with non-ascii characters
  depending on user locale. For example, passwords could contain 'İ'
  for users with Turkish locale.
- `genpass-apple` didn't work with `ksh_arrays` shell option.
- `genpass-xkcd` was printing spurious errors with `ksh_arrays` shell
  option.
- `genpass-xkcd` was producing too short (weak) or too strong (long)
  and/or printing errors when `IFS` was set to non-default value.
- All generators were printing fewer passwords than requested and
  returning success when passed a very large number as an argument.

*Usability*

Generators are now implemented as self-contained executable files.
They can be invoked from scripts with no additional setup.

Generators no longer depend on external commands. The only dependencies
are `/dev/urandom` and, for `genpass-xkcd`, `/usr/share/dict/words`.

All generators used to silently ignore all arguments after the first
and the first argument if it wasn't a number. For example, both
`genpass-apple -2` and `genpass-apple -n 2` were generating one password
and not printing any errors. Now these print an error and fail.

*Performance*

The time it takes to load the plugin has been greatly reduced. This
translates into faster zsh startup when the plugin is enabled.

Incidentally, two generators out of three have been sped up to a large
degree while one generator (`genpass-xkcd`) has gotten slower. This is
unlikely to matter one way or another unless generating a very large
number of passwords. In the latter case `genpass-xkcd` is now also
faster than it used to be.

The following table shows benchmark results from Linux x86-64 on i9-7900X.
The numbers in the second and third columns show how many times a given
command could be executed per second. Higher numbers are better.

command                     | before (Hz) | after (Hz) | speedup |
----------------------------|------------:|-----------:|--------:|
`source genpass.plugin.zsh` |        4810 |      68700 |  +1326% |
`genpass-apple`             |        30.3 |        893 |  +2846% |
`genpass-monkey`            |         203 |       5290 |  +2504% |
`genpass-xkcd`              |        34.4 |       14.5 |    -58% |
`genpass-xkcd 1000`         |       0.145 |      0.804 |   +454% |
2021-03-21 13:37:49 -04:00
Patrick Harrison
85db8c2be3 fix(genpass): add compatibility for macOS paste command
"paste" on macOS requires a '-' to signify that the standard input is used.
Without the '-' character, the command errors out.
2021-03-21 13:37:49 -04:00
Marc Cornellà
f9285022ca fix(genpass): warn if no wordlist is found 2021-03-21 13:37:49 -04:00
Patrick Harrison
1c963854cc fix(genpass): check for presence of shuf command.
"shuf" is not a standard command on MacOS and requires installation of the brew coreutils package
2021-03-21 13:37:49 -04:00
Matt Lewin
dfb4bfa0cf fix(genpass): fix grep regex in genpass-xkcd for FreeBSD version (#9514) 2021-03-21 13:37:49 -04:00
Aaron Toponce
3919d0f427 fix(genpass): only use words with ASCII characters in genpass-xkcd (#9508) 2021-03-21 13:37:49 -04:00
Marc Cornellà
42dbb1b375 fix(changelog): allow breaking change message to span multiple lines
This also allows the option to put extra paragraphs after the BREAKING CHANGE
message while properly displaying the breaking change message. Useful, for
example, to add signed-off or co-authored lines.
2021-03-21 13:37:49 -04:00
Marc Cornellà
6f223b3157 feat(updater): save version prior to updating so omz changelog just works™
Fixes #9505
2021-03-21 13:37:49 -04:00
Aaron Toponce
bb3f100281 feat(plugins): add genpass plugin with 3 distinct password generators (#9502) 2021-03-21 13:37:49 -04:00
Marc Cornellà
b23f47fe46 fix(composer): autoload _cache_invalid for antigen compatibility
Antigen doesn't call `compinit` until the user prompt is about to be shown,
which means `_cache_invalid` isn't automatically autoloaded. This patch
fixes that, though we should work towards a better caching mechanism.

Fixes #9490
2021-03-21 13:37:49 -04:00
Marc Cornellà
e6aaf4a60b chore!: notify breaking change in git_prompt_info
BREAKING CHANGE: the git config option to skip running `git_prompt_info` has changed from `oh-my-zsh.hide-status` to `oh-my-zsh.hide-info` (#9188).
2021-03-21 13:37:49 -04:00
Bruno Borges
4e0a759f73 feat(lib): show upstream branch in git_prompt_info (#9188)
Show the remote branch the local branch is tracking if `ZSH_THEME_GIT_SHOW_UPSTREAM`
is set, like so: `ZSH_THEME_GIT_SHOW_UPSTREAM=1`.

Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2021-03-21 13:37:49 -04:00
Marc Cornellà
27966adec0 refactor(hanami): change global aliases and clean up README 2021-03-21 13:37:49 -04:00
Marc Cornellà
00e2ff2591 Document fd alias change in README 2021-03-21 13:37:49 -04:00
Rohit Goswami
bf42b991f1 fd: Rework command to be more idiomatic
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2021-03-21 13:37:49 -04:00
Rohit Goswami
6aa3c97bbf aliases: Don't overshadow fd 2021-03-21 13:37:49 -04:00
Mark Mercado
2e9de78ce4 feat(plugins): add grc plugin for Generic Colouriser (#9315)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2021-03-21 13:37:49 -04:00
Joseph Heyburn
ac4de0de49 fix(git): silently fail in git_main_branch if not in a git repo (#9484)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2021-03-21 13:37:49 -04:00
Marc Cornellà
271a607c58 chore: add Josh Medeski as wp-cli plugin maintainer 2021-03-21 13:37:49 -04:00
ratijas
3871488913 refactor(archlinux): prevent leaking local variables (#9476)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2021-03-21 13:37:49 -04:00
Veesar
c28d02e371 feat(wp-cli): add aliases for DB management (#9469) 2021-03-21 13:37:49 -04:00
Marc Cornellà
1818ed6685 feat(lib)!: soft-deprecate upgrade_oh_my_zsh function for everybody
BREAKING CHANGE: the `upgrade_oh_my_zsh` function now calls `omz update` directly.
2021-03-21 13:37:49 -04:00
Marc Cornellà
f351559580 fix(changelog): fix assoc array syntax for zsh 5.4.2 and older (#9495)
Also fixed a call to a defunct display:type-header function in displaying
breaking changes.
2021-03-21 13:37:49 -04:00
Marc Cornellà
92afc883c4 fix(updater): don't show changelog when running unattended update (#9495)
Fixes #9495
2021-03-21 13:37:49 -04:00
赵崇延
004bcf0cc5 fix(command-not-found): show error in Ubuntu when no package is found (#9418) 2021-03-21 13:37:49 -04:00
Marc Cornellà
23472c9c43 fix(changelog): fix highlight of codeblocks in subject 2021-03-21 13:37:49 -04:00
Marc Cornellà
281a804917 feat(CLI): add --unattended flag to omz update to not reload zsh (#9187) 2021-03-21 13:37:49 -04:00
Marc Cornellà
a9e962fe72 fix(updater): properly show changelog via less 2021-03-21 13:37:49 -04:00
Stimim Chen
2b5f522075 fix(git-prompt): make gitstatus.py python3-compatible (#9186)
check_output() in get_tagname_or_hash() returns bytes instead of str in
python3.  Decode the return value to utf-8, this works in both python2
and python3.

Co-authored-by: Stimim Chen <stimim@google.com>
2021-03-21 13:37:49 -04:00
Marc Cornellà
dc89cdc39c fix(updater): fix ignored variable name in read
I used _ which is a convention in other languages, but in shell scripting
$_ is a special variable set by the shell, and in Zsh versions older than
5.0.6 it complains for being a `read-only variable`.

Fixes #9482
2021-03-21 13:37:49 -04:00
Marc Cornellà
9e61673813 fix(updater): make sure to run it with zsh 2021-03-21 13:37:49 -04:00
Marc Cornellà
7abef85965 feat(CLI): add omz changelog command 2021-03-21 13:37:49 -04:00
Marc Cornellà
d789ddb553 feat(updater): add changelog display by parsing the commit list 2021-03-21 13:37:49 -04:00
Marc Cornellà
db4435a1e6 fix(updater): correctly restart the zsh session when the update pulled changes 2021-03-21 13:37:49 -04:00
Marc Cornellà
73dcbf6dad refactor(updater): switch to Zsh execution and fix git remote detection logic 2021-03-21 13:37:49 -04:00
Marc Cornellà
af206e793c fix(git-auto-fetch): background git-fetch-all and other fixes (#9468) 2021-03-21 13:37:49 -04:00
Marc Cornellà
943b94623d fix(magic-enter): fix various bugs in the plugin (#9466) 2021-03-21 13:37:49 -04:00
Peter Kingswell
1412f08b45 Merge branch 'master' of https://github.com/sming/ohmyzsh 2020-11-24 16:20:52 -05:00
Peter Kingswell
2f780fb7c5 various improvements 2020-11-24 16:19:40 -05:00
Eugéne Roux
7a76afd61e
style(ansible): minor style change (#8356) 2020-11-22 15:42:39 +01:00
Mohamed El Mouctar Haidara
88b3f028f4
feat(terraform): add autocompletion for Terraform 0.13 (#9226) 2020-11-20 18:45:31 +01:00
Septs
d57131dc49
fix(shell-proxy): change NAME env variable for WSL clash (#9447) 2020-11-20 12:42:51 +01:00
Peter Kingswell
628fe75ce3 merged in master & gfind improvements 2020-11-19 21:01:14 -05:00
Peter Kingswell
6d11dace69 stuff 2020-11-19 21:01:14 -05:00
Peter Kingswell
6dec4d414f stuff 2020-11-19 21:01:14 -05:00
System Administrator
41215e8091 added my fishy 2020-11-19 21:01:14 -05:00
Peter Kingswell
d1be9bba2e some new functions 2020-11-19 21:01:14 -05:00
Felipe Contreras
e92a4667cb
feat(gitfast): update to git-completion 1.2 (#9458)
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2020-11-19 19:45:19 +01:00
Roman Danyk
ce836647e5
feat(aws): respect optional parameters from the AWS CLI config file (#9453) 2020-11-19 17:24:09 +01:00