Fix paths in push hooks

master
Daniel Borchmann 2020-12-20 11:19:27 +01:00
parent d8f11efb19
commit a249982665
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 6 additions and 15 deletions

View File

@ -48,26 +48,17 @@ the following configuration
git config receive.denyCurrentBranch updateInstead
~~~
- Remove `quilt` patches on `pre-receive`, i.e., before receiving updates:
- When updating the worktree after push, first remove all patches, then update,
then update all submodules, and then reapply all patches:
~~~sh
cat <<SCRIPT > .git/hooks/pre-receive
cat <<SCRIPT > .git/hooks/push-to-checkout
#!/bin/sh
quilt pop -a
SCRIPT
chmod +x .git/hooks/pre-receive
~~~
- After pushing, update all submodules, apply patches, and fix permissions:
~~~sh
cat <<SCRIPT > .git/hooks/post-update
#!/bin/sh
git read-tree -u -m HEAD "$1"
git submodule update --init
quilt push -a
quilt push -a
chmod -R a+rX .
SCRIPT
chmod +x .git/hooks/post-update
chmod +x .git/hooks/push-to-checkout
~~~