fix(self-update): honor -q in changelog display

When the checkout is behind upstream, the commit-log display piped
through .zinit-pager unconditionally, so self-update -q (and the quiet
.zinit-self-update call made by update --all) could hang in less until
dismissed. Skip the display, munging included, under --quiet.

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
Vladislav Doster 2026-08-31 15:50:14 -05:00
parent cc3baf395f
commit a85e9dcc3e

View file

@ -2005,7 +2005,7 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
builtin cd -q "$ZINIT[BIN_DIR]" \
&& lines=( ${(f)"$(command git log --color --date=short --pretty=format:'%Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..@\{u\})"} )
# Use '..@{u}' which refers to the configured upstream branch, instead of '..origin/HEAD'
if (( ${#lines} > 0 )); then
if (( ${#lines} > 0 && ! OPTS[opt_-q,--quiet] )); then
# Remove the (origin/main ...) segments, to expect only tags to appear
lines=( "${(S)lines[@]//\(([,[:blank:]]#(origin|HEAD|master|main)[^a-zA-Z]##(HEAD|origin|master|main)[,[:blank:]]#)#\)/}" )
# Remove " ||" if it ends the line (i.e. no additional text from the body)