mirror of
https://github.com/marian-nmt/marian.git
synced 2024-11-27 10:33:14 +03:00
Added post-rewrite hook to automatically update submodules when
they change.
This commit is contained in:
parent
b133012cf8
commit
93af06e9c7
4
git-hooks/README.md
Normal file
4
git-hooks/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
This directory contains git hooks (programs automatically triggered by git events).
|
||||
They cannot be put in ./git/hooks by way of version control; you have to copy them
|
||||
there yourself. Make sure they are executable.
|
||||
|
13
git-hooks/post-rewrite
Normal file
13
git-hooks/post-rewrite
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# from https://gist.github.com/digitaljhelms/f74eaf56835262d6bf3f
|
||||
echo "[post rewrite hook: $1]"
|
||||
|
||||
# quick script to call "git submodule update" automatically if the
|
||||
# .gitmodules file is changed
|
||||
|
||||
changedfiles=( `git diff-tree --no-commit-id --name-only HEAD@{1} HEAD` )
|
||||
|
||||
if [[ "${changedfiles[*]}" =~ ".gitmodules" ]]; then
|
||||
echo "initializing & updating submodule(s)"
|
||||
git submodule update --init --recursive
|
||||
fi
|
Loading…
Reference in New Issue
Block a user