From 5ffb9c9901ef8c2832cffb40c9c3bfacae0e6e39 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 22 Jan 2026 15:30:28 -0500 Subject: [PATCH] update-third-party: sync with upstream Fixes usage on Apple and defers shortlog generation until it is necessary. --- .git-remote-files | 2 +- Utilities/Scripts/update-third-party.bash | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.git-remote-files b/.git-remote-files index b1653bed2f..ec5762d3cf 100644 --- a/.git-remote-files +++ b/.git-remote-files @@ -1,5 +1,5 @@ [file "update-common.sh" from "https://gitlab.kitware.com/utils/git-import-third-party.git"] -commit = 8e52fdc2adb7d481798581af64047cbc228fea8e +commit = 8f83cbcdac0af41574abfb632dfbe2c403948803 branch = master target = Utilities/Scripts/update-third-party.bash comment = Core third party import logic diff --git a/Utilities/Scripts/update-third-party.bash b/Utilities/Scripts/update-third-party.bash index 9f744b9c8b..0fea65a394 100644 --- a/Utilities/Scripts/update-third-party.bash +++ b/Utilities/Scripts/update-third-party.bash @@ -160,8 +160,6 @@ else basehash="$( git rev-list --author="$ownership" --grep="$basehash_regex" -n 1 HEAD )" fi readonly basehash -upstream_old_short="$( git cat-file commit "$basehash" | sed -n '/'"$basehash_regex"'/ {s/.*(//;s/)//;p;}' | grep -E '^[0-9a-f]+$' )" -readonly upstream_old_short [ -n "$basehash" ] || \ warn "'basehash' is empty; performing initial import" @@ -212,6 +210,9 @@ readonly upstream_datetime upstream_date="$( echo "$upstream_datetime" | grep -o -e "$regex_date" )" readonly upstream_date if $do_shortlog && [ -n "$basehash" ]; then + upstream_old_short="$( git -C "$toplevel_dir" cat-file commit "$basehash" | sed -n '/'"$basehash_regex"'/ {s/.*(//;s/)//;p;}' | grep -E '^[0-9a-f]+$' )" + readonly upstream_old_short + commit_shortlog=" Upstream Shortlog @@ -252,9 +253,10 @@ if [ -n "$basehash" ]; then git merge --log -s recursive "-Xsubtree=$subtree/" --no-commit "upstream-$name" else # Note: on Windows 'git merge --help' will open a browser, and the check - # will fail, so use the flag by default. + # will fail, so use the flag by default. Apple opens an editor instead; + # assume the flag is understood there too. unrelated_histories_flag="" - if git --version | grep -q windows; then + if git --version | grep -q -E 'windows|Apple'; then unrelated_histories_flag="--allow-unrelated-histories" elif git merge --help | grep -q -e allow-unrelated-histories; then unrelated_histories_flag="--allow-unrelated-histories"