@@ -714,11 +714,13 @@ ZINIT[EXTENDED_GLOB]=""
714
714
[[ $1 = -q ]] && +zinit-message " {info2}Updating Zinit{…}{rst}"
715
715
716
716
local nl=$' \n ' escape=$' \x1b ['
717
+ local current_branch=$( builtin pushd $ZINIT [BIN_DIR] > /dev/null && git branch --show-current && popd > /dev/null)
717
718
local -a lines
718
- ( builtin cd -q " $ZINIT [BIN_DIR]" && \
719
- command git checkout main & > /dev/null && \
720
- command git fetch --quiet && \
721
- lines=( ${(f)" $( command git --no-pager log --color --date=short --pretty=format:' %Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..FETCH_HEAD) " } )
719
+ (
720
+ builtin cd -q " $ZINIT [BIN_DIR]" \
721
+ && +zinit-message -n " {pre}[self-update]{msg2} fetching changes for {msg2}$current_branch$nl {cmd}" \
722
+ && command git fetch --quiet \
723
+ && lines=( ${(f)" $( command git log --color --date=short --pretty=format:' %Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..FETCH_HEAD) " } )
722
724
if (( ${# lines} > 0 )) ; then
723
725
# Remove the (origin/main ...) segments, to expect only tags to appear
724
726
lines=( " ${(S)lines[@]// \( ([,[:blank:]]# (origin|HEAD|master|main)[^a-zA-Z]## (HEAD|origin|master|main)[,[:blank:]]# )# \) / } " )
@@ -727,8 +729,9 @@ ZINIT[EXTENDED_GLOB]=""
727
729
# If there's no ref-name, 2 consecutive spaces occur - fix this
728
730
lines=( " ${lines[@]/ (# b)[[:space:]]# \|\| [[:space:]]# (* )(# e)/ || ${match[1]} } " )
729
731
lines=( " ${lines[@]/ (# b)$escape ([0-9]## )m[[:space:]]## ${escape} m/ $escape ${match[1]} m${escape} m} " )
730
- # Replace what follows "|| ..." with the same thing but with no newlines,
731
- # and also only first 10 words (the (w)-flag enables word-indexing)
732
+ # Replace what follows "|| ..." with the same thing but with no
733
+ # newlines, and also only first 10 words (the (w)-flag enables
734
+ # word-indexing)
732
735
lines=( " ${lines[@]/ (# b)[[:blank:]]# \|\| (* )(# e)/ | ${${match[1]// $nl / } [(w)1,(w)10]} } " )
733
736
builtin print -rl -- " ${lines[@]} " | .zinit-pager
734
737
builtin print
@@ -744,17 +747,12 @@ ZINIT[EXTENDED_GLOB]=""
744
747
}
745
748
command rm -f $ZINIT [BIN_DIR]/* .zwc(DN)
746
749
zcompile -U $ZINIT [BIN_DIR]/zinit.zsh
747
- zcompile -U $ZINIT [BIN_DIR]/zinit-side.zsh
748
- zcompile -U $ZINIT [BIN_DIR]/zinit-install.zsh
749
- zcompile -U $ZINIT [BIN_DIR]/zinit-autoload.zsh
750
- zcompile -U $ZINIT [BIN_DIR]/zinit-additional.zsh
750
+ zcompile -U $ZINIT [BIN_DIR]/zinit-{' side' ,' install' ,' autoload' ,' additional' }.zsh
751
751
zcompile -U $ZINIT [BIN_DIR]/share/git-process-output.zsh
752
752
# Load for the current session
753
753
[[ $1 != -q ]] && +zinit-message " Reloading Zinit for the current session{…}"
754
754
source $ZINIT [BIN_DIR]/zinit.zsh
755
- source $ZINIT [BIN_DIR]/zinit-side.zsh
756
- source $ZINIT [BIN_DIR]/zinit-install.zsh
757
- source $ZINIT [BIN_DIR]/zinit-autoload.zsh
755
+ zcompile -U $ZINIT [BIN_DIR]/zinit-{' side' ,' install' ,' autoload' }.zsh
758
756
# Read and remember the new modification timestamps
759
757
local file
760
758
for file ( " " -side -install -autoload ) {
0 commit comments