mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
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:
parent
cc3baf395f
commit
a85e9dcc3e
|
|
@ -2005,7 +2005,7 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
|
||||||
builtin cd -q "$ZINIT[BIN_DIR]" \
|
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\})"} )
|
&& 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'
|
# 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
|
# 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:]]#)#\)/}" )
|
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)
|
# Remove " ||" if it ends the line (i.e. no additional text from the body)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue