looper/update-commits.sh
2024-09-28 10:31:18 -07:00

10 lines
283 B
Bash
Executable file

#!/bin/sh
git submodule status |
sed 's/^.//' |
while read -r i; do
commit="$(echo -n "$i" | cut -d\ -f1)"
path="$(echo -n "$i" | cut -d\ -f2)"
key="submodule.${path}.commit"
git config -f .gitmodules --unset-all "$key"
git config -f .gitmodules --add "$key" "$commit"
done