Add bin directory

This commit is contained in:
2019-12-18 10:04:20 +01:00
parent 075c9bc55e
commit 9300b749d6
9 changed files with 123 additions and 0 deletions

15
bin/git-sm-commit Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -o nounset
submodule_count=$(git diff --staged --submodule=log | grep -c '^Submodule')
if (( $submodule_count == 1 )) ; then
msg="Update submodule $(git diff --staged --submodule=log | grep '^Submodule' | cut -d ' ' -f 2)"
else
msg="Update submodules"
fi
git commit --edit --no-status \
--message="$msg" \
--message "$(git diff --staged --color=never --submodule=log | sed 's/^S/\nS/' | sed 's/^Submodule /* /' | sed 's/ >/ */')"