From 18a4197da76d882fff76d04589431780d3be6fdb Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Wed, 13 Aug 2008 22:19:02 -0500 Subject: [PATCH] Scripts/hooks to store settings in a separate 'gitconfig' branch. --- scripts/make-gitconfig-branch.sh | 19 +++++++++++++ server/update-git-config | 21 ++++++++++++++ tests/t2800-server-update-git-config.sh | 38 +++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 scripts/make-gitconfig-branch.sh create mode 100644 server/update-git-config create mode 100644 tests/t2800-server-update-git-config.sh diff --git a/scripts/make-gitconfig-branch.sh b/scripts/make-gitconfig-branch.sh new file mode 100644 index 0000000..5556038 --- /dev/null +++ b/scripts/make-gitconfig-branch.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Create an empty file object +empty_file_hash=$(git hash-object -w --stdin <a && + git add a && + git commit -m "setup" && + git clone ./. server && + rm -fr server/.git/hooks && + git remote add origin ./server && + git config --add branch.master.remote origin && + git config --add branch.master.merge refs/heads/master && + git fetch +' + +install_update_hook 'update-git-config' + +test_expect_success 'pushing initial value works' ' + cd server && + ! git config --list | grep foo && + cd .. && + + ../../scripts/make-gitconfig-branch.sh && + git checkout gitconfig && + echo "foo.foo=bar" > config && + git commit -a -m "Set foo.foo=bar." + git push origin gitconfig + + cd server && + git config --list | grep foo && + cd .. +' + +test_done + -- 2.20.1