From: Stephen Haberman Date: Thu, 14 Aug 2008 03:19:02 +0000 (-0500) Subject: Scripts/hooks to store settings in a separate 'gitconfig' branch. X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=18a4197da76d882fff76d04589431780d3be6fdb;p=git-central.git Scripts/hooks to store settings in a separate 'gitconfig' branch. --- 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 +