From: Caleb Maclennan Date: Sun, 20 Oct 2013 01:11:52 +0000 (-0600) Subject: add hooks to enable auto handing of merge conflicts X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/49a6af92db204536f6752583c1c24a34c1070c8c?ds=inline add hooks to enable auto handing of merge conflicts These hooks before and after the actual checkout process will enable a pair of hook scripts to automatically handle conflicts and potentially allow the checkout of repositories over existing file sets --- diff --git a/doc/hooks b/doc/hooks index 54ff795..30cd373 100644 --- a/doc/hooks +++ b/doc/hooks @@ -14,6 +14,12 @@ Available hooks are: * post-enter * pre-init * post-init +* pre-merge + Use this hook to detect and handle merge conflicts before vcsh's native code + finds and errors on them. This is useful for allowing clones on top of existing + files. +* post-merge + Use this hook to finish handling any merge conflicts found in the pre-merge hook. * pre-pull * post-pull * pre-push diff --git a/vcsh b/vcsh index 6ce5320..a6d8213 100755 --- a/vcsh +++ b/vcsh @@ -152,6 +152,7 @@ clone() { exit fi git fetch + hook pre-merge git ls-tree -r --name-only origin/master | (while read object; do [ -e "$object" ] && error "'$object' exists." && @@ -161,6 +162,7 @@ clone() { fatal "will stop after fetching and not try to merge! Once this situation has been resolved, run 'vcsh run $VCSH_REPO_NAME git pull' to finish cloning." 17 git merge origin/master + hook post-merge hook post-clone retire hook post-clone-retired