X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/49a6af92db204536f6752583c1c24a34c1070c8c..bca2d01e18e69ae7b602950ee640a08ea1c8cef0:/doc/sample_hooks/pre-merge-unclobber diff --git a/doc/sample_hooks/pre-merge-unclobber b/doc/sample_hooks/pre-merge-unclobber new file mode 100755 index 0000000..93a7319 --- /dev/null +++ b/doc/sample_hooks/pre-merge-unclobber @@ -0,0 +1,11 @@ +#!/bin/sh + +# This code does amost exactly what the native VCSH sanity checking code +# does except that on finding a potential merge conflict, it moves the +# extant object out of the way temporarily. The merge then happens cleanly +# as far as git knows, and a post-merge hook can figure out what to do with +# the extant versions of the objects. + +for object in $(git ls-tree -r origin/master | awk '{print $4}'); do + [ -e "$object" ] && mv "$object" "$object.vcsh-unclobber" +done