X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=host%2Fgit-configure;fp=host%2Fgit-configure;h=a56d788134bbe61dea81aaa472f4e138dd7b6671;hp=0000000000000000000000000000000000000000;hb=3ad6118386977e346d81042e924e5db9c5f15b7d;hpb=22f04b9fac14adc3d3fc98273ba126c3a51792c3 diff --git a/host/git-configure b/host/git-configure new file mode 100755 index 0000000..a56d788 --- /dev/null +++ b/host/git-configure @@ -0,0 +1,23 @@ +#!/bin/sh -eu +tool=$(readlink -e "${0%/*}/..") +. "$tool"/host/lib.sh + +cd "$tool" +git config --replace branch.master.remote . +git config --replace branch.master.merge refs/remotes/master +local tool +tool=$(cd "$tool"; cd -) +install -m 770 /dev/stdin \ + .git/hooks/post-update <<-EOF + #!/bin/sh -efux + case \$1 in + (refs/remotes/master) + cd .. + #git --git-dir=\$PWD/.git checkout -f -B master remotes/master && + git --git-dir=\$PWD/.git checkout HEAD'^' && + git --git-dir=\$PWD/.git branch -f master remotes/master && + git --git-dir=\$PWD/.git checkout master + git --git-dir=\$PWD/.git clean -f -d -x + ;; + esac + EOF