Skip to content

Commit ac7d9d5

Browse files
yannrichetCopilot
andcommitted
fix: sync gitmodules-shas to d8f89daa (version 0.9-4) + fix update script
update_submodule_shas.sh now reads from the git index (git ls-files --stage) instead of HEAD, so it correctly captures staged submodule pointer changes during a pre-commit hook run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 659c88e commit ac7d9d5

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

tools/gitmodules-shas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file records the specific commit SHAs for each submodule
22
# It is automatically generated and should be updated when submodules are updated
33
# Format: <submodule_path> <commit_sha>
4-
src/libK 87651a2436dda9439888c9acb1ef363d35ec607d
4+
src/libK d8f89daab531c20ecf807ef678b811f7e04e4c43
55
src/slapack 72a7f3753e02b0471e93296f2b22877c6fee7328

tools/update_submodule_shas.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@ SHAS_FILE="$SCRIPT_DIR/gitmodules-shas"
99

1010
echo "Updating tools/gitmodules-shas with current submodule commits..."
1111

12-
# Get the list of submodules and their commits
13-
git ls-tree HEAD $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }') > "$SHAS_FILE.tmp"
14-
15-
# Add header and format
12+
# Use staged index if available (during pre-commit), otherwise fall back to HEAD
13+
# git ls-files --stage shows the staged state; for submodules mode=160000
1614
{
1715
echo "# This file records the specific commit SHAs for each submodule"
1816
echo "# It is automatically generated and should be updated when submodules are updated"
1917
echo "# Format: <submodule_path> <commit_sha>"
20-
awk '{print $4, $3}' "$SHAS_FILE.tmp"
18+
git ls-files --stage | awk '$1 == "160000" { print $4, $2 }'
2119
} > "$SHAS_FILE"
2220

23-
rm -f "$SHAS_FILE.tmp"
24-
2521
echo "✓ Updated tools/gitmodules-shas:"
2622
cat "$SHAS_FILE"
2723

0 commit comments

Comments
 (0)