* fix(changelog): hide reverted commits again after the switch to 12-char hashes
Since #12096 the commit list is read with `--abbrev=12`, so the `types`
array is keyed by 12-character hashes, but `commit:is-revert` still
returned the first 7 characters of the reverted hash. The lookup in
`display-release` never matched, and both a reverted commit and its
`Revert "..."` commit were listed in the changelog.
* test(changelog): cover hiding reverted commits
On the Korean Dubeolsik keyboard layout, the Y key position produces ㅛ
(U+315B) when a Korean IME is active. Since the update confirmation prompt
only matched [yY$'\n'], Korean users who pressed the Y key with the IME on
had their update silently cancelled. Accept ㅛ as an affirmative answer.
* feat(updater): add cooldown option to delay applying updates (#13813)
Introduces a new `zstyle ':omz:update' cooldown <days>` setting that limits
the updater to only apply commits that are at least N days old. Defaults to 0
(current behavior — always pull latest).
When cooldown is set, the updater fetches the remote branch and finds the most
recent commit whose committer timestamp is at least N days old, then applies it
via `git merge --ff-only`. If the local copy is already at or past the cooldown
ref, nothing changes.
- tools/upgrade.sh: reads cooldown zstyle, replaces git pull with fetch +
merge --ff-only when cooldown > 0
- README.md: documents the new setting under "Getting Updates"
- templates/zshrc.zsh-template: adds commented-out cooldown example alongside
frequency, with rephrased comments to clarify how the two work together
* fix(updater): address cooldown review feedback
Pass cooldown into upgrade.sh as -c, extract the update helpers, and only
prompt when a cooldown-eligible commit would actually move HEAD.
* fix(updater): follow first-parent history for cooldown
HOME="${HOME:-$(eval echo ~"$USER")}" expands any shell metacharacters in
$USER when HOME is unset (CWE-78), e.g. USER='x"; <command>; "'. Validate the
username against a safe character set before running the eval and fall back
to $PWD for unsafe values. Also quote $USER in the getent call to avoid word
splitting.
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
NOTE: this feature is in alpha / preview mode, it is not guaranteed to work 100% of the
time in all cases. If you experience any issues, open an issue or search for an open
one describing your same situation.
To use this, use the zstyle update mode settings [1] with the value `background-alpha`:
zstyle ':omz:update' mode background-alpha
[1] https://github.com/ohmyzsh/ohmyzsh#getting-updates