Skip to content

Commit dce7a22

Browse files
committed
goodnight.sh: create a git hook that will auto-run self after stacked rebase performed in this repo
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 615fdec commit dce7a22

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

goodnight.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,22 @@ set -e
55
git branch -f nightly @
66
git push -f origin nightly
77

8+
# create a git hook for this repo
9+
# that will auto-run this goodnight.sh script
10+
# after a stacked-rebase is finished in this repo.
11+
POST_STACKED_REBASE_HOOK_PATH=".git/hooks/post-stacked-rebase"
12+
13+
cat > "$POST_STACKED_REBASE_HOOK_PATH" <<'EOF'
14+
#!/bin/sh
15+
16+
# DO NOT EDIT THIS FILE MANUALLY
17+
# AUTO-GENERATED BY GIT-STACKED-REBASE's goodnight.sh script.
18+
19+
DIRNAME="$(dirname $0)"
20+
21+
GOODNIGHT_SCRIPT="$(realpath $DIRNAME/../../goodnight.sh)"
22+
23+
sh "$GOODNIGHT_SCRIPT"
24+
EOF
25+
26+
chmod +x "$POST_STACKED_REBASE_HOOK_PATH"

0 commit comments

Comments
 (0)