summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/git-setup23
-rwxr-xr-xtools/move.sh10
-rwxr-xr-xtools/reset.sh4
3 files changed, 30 insertions, 7 deletions
diff --git a/tools/git-setup b/tools/git-setup
new file mode 100755
index 0000000000..6f3c36f1cb
--- /dev/null
+++ b/tools/git-setup
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+cd "$(dirname -- "$0")"
+cd "$(git rev-parse --show-toplevel)"
+
+if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
+ # This part is allowed to fail
+ cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
+ chmod +x .git/hooks/pre-commit && \
+ echo "Activated pre-commit hook." || :
+fi
+
+declare -A fetch
+git config -f .gitconfig --get-regexp '.*' | while read -r key val; do
+ if [[ $key = *.fetch ]]; then
+ if [[ -z "${fetch[$key]}" ]]; then
+ git config --local --unset-all "$key"
+ fetch[$key]='true'
+ fi
+ git config --local --add "$key" "$val"
+ else
+ git config --local "$key" "$val"
+ fi
+done
diff --git a/tools/move.sh b/tools/move.sh
index ef41e28c10..0e16dc771f 100755
--- a/tools/move.sh
+++ b/tools/move.sh
@@ -392,16 +392,16 @@ main() {
exit 1
fi
- git checkout -b postmove
+ git checkout -b tmp/postmove
move
git add .
git commit -m './move.sh'
- git merge -s ours lukeshu/postmove
- git checkout lukeshu/postmove
- git merge postmove
- git branch -d postmove
+ git merge -s ours notsystemd/postmove
+ git checkout notsystemd/postmove
+ git merge tmp/postmove
+ git branch -d tmp/postmove
}
main "$@"
diff --git a/tools/reset.sh b/tools/reset.sh
index 66b629c217..d7141587fa 100755
--- a/tools/reset.sh
+++ b/tools/reset.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
-git checkout lukeshu/premove
-git branch -D postmove || true
+git checkout notsystemd/premove
+git branch -D tmp/postmove || true
git checkout .
git clean -xdf