From 91df36e67cad534bcd606836fd20cd41ecdcc6ba Mon Sep 17 00:00:00 2001 From: J Rob Gant Date: Thu, 10 Dec 2020 11:14:30 -0500 Subject: [PATCH 1/6] Check for both shallow clones at the same time. --- Library/Homebrew/cmd/update.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index d557ad2f3d..111644907b 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -390,6 +390,22 @@ EOS fi fi + if [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core/.git/shallow" && + -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask/.git/shallow" ]] + then + odie < Date: Thu, 10 Dec 2020 11:20:46 -0500 Subject: [PATCH 2/6] fix typo --- Library/Homebrew/cmd/update.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 111644907b..9f2d6070fd 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -399,7 +399,7 @@ homebrew-core and homebrew-cask are shallow clones. To \`brew update\` first run git -C "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask" fetch --unshallow This restriction has been made on GitHub's request because updating shallow clones is an extremely expensive operation due to the tree layout and traffic of -Homebrew/homebrew-core and Homebrew/homebrew-core. We don't do this for you +Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you automatically to avoid repeatedly performing an expensive unshallow operation in CI systems (which should instead be fixed to not use shallow clones). Sorry for the inconvenience! From 290179091a9c86418884a76f28bef97c423f217f Mon Sep 17 00:00:00 2001 From: J Rob Gant Date: Thu, 10 Dec 2020 13:22:15 -0500 Subject: [PATCH 3/6] If the eariler code produced multiple messages I wouldn't have complained. --- Library/Homebrew/cmd/update.sh | 50 ++++++++++------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 9f2d6070fd..ad38381413 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -390,45 +390,23 @@ EOS fi fi - if [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core/.git/shallow" && - -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask/.git/shallow" ]] - then - odie < Date: Fri, 11 Dec 2020 12:43:23 -0500 Subject: [PATCH 4/6] Better newlines --- Library/Homebrew/cmd/update.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index ad38381413..6757f324c3 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -396,11 +396,12 @@ EOS if [[ -n $SHALLOW_CORE || -n $SHALLOW_CASK ]] then odie < Date: Fri, 11 Dec 2020 12:47:47 -0500 Subject: [PATCH 5/6] Update the variable names --- Library/Homebrew/cmd/update.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 6757f324c3..2d576c6859 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -390,17 +390,17 @@ EOS fi fi - [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core/.git/shallow" ]] && SHALLOW_CORE=1 - [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask/.git/shallow" ]] && SHALLOW_CASK=1 + [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core/.git/shallow" ]] && HOMEBREW_CORE_SHALLOW=1 + [[ -f "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-cask/.git/shallow" ]] && HOMEBREW_CASK_SHALLOW=1 - if [[ -n $SHALLOW_CORE || -n $SHALLOW_CASK ]] + if [[ -n $HOMEBREW_CORE_SHALLOW || -n $HOMEBREW_CASK_SHALLOW ]] then odie < Date: Fri, 11 Dec 2020 19:27:54 -0500 Subject: [PATCH 6/6] Update Library/Homebrew/cmd/update.sh Co-authored-by: Maxim Belkin --- Library/Homebrew/cmd/update.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 2d576c6859..1ed5ede009 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -396,18 +396,18 @@ EOS if [[ -n $HOMEBREW_CORE_SHALLOW || -n $HOMEBREW_CASK_SHALLOW ]] then odie <