From: Richard Hartmann Date: Sat, 8 Feb 2014 16:00:47 +0000 (+0100) Subject: doc/sample_hooks/: Cleanups X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/62896f1b8dcf9a04f94c44170063ef274326fa4c doc/sample_hooks/: Cleanups --- diff --git a/doc/sample_hooks/post-merge-unclobber b/doc/sample_hooks/post-merge-unclobber index 017a13f..23c757c 100755 --- a/doc/sample_hooks/post-merge-unclobber +++ b/doc/sample_hooks/post-merge-unclobber @@ -1,10 +1,10 @@ #!/bin/sh # This finds objects that the pre-merge script moved out of the way to -# avoid conflicts when running git clone and moves them back to their -# original places. The result is that the git repository gets checked out -# and the extant objects end up back in the working directory. Git now -# sees these as un-staged changes to the working branch and you can deal -# with them by adding them or reverting. +# avoid conflicts when running `vcsh clone` and moves them back to their +# original places. The result is that the Git repository gets checked out +# without error and the pre-existing files end up back in the working +# directory. Git and thus vcsh now see these as un-staged changes to the +# working branch and you can deal with them as usual. find -name '*.vcsh-unclobber' -execdir rename .vcsh-unclobber '' {} \; diff --git a/doc/sample_hooks/pre-merge-unclobber b/doc/sample_hooks/pre-merge-unclobber index 93a7319..5261096 100755 --- a/doc/sample_hooks/pre-merge-unclobber +++ b/doc/sample_hooks/pre-merge-unclobber @@ -1,10 +1,10 @@ #!/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. +# This code does amost exactly what the native vcsh sanity checking code +# does except that on finding a potential merge conflict, it moves existing +# files out of the way temporarily. Merging (part of `vcsh clone`) happens +# cleanly, and a post-merge hook can be used to figure out what to do with +# the now-renamed files. for object in $(git ls-tree -r origin/master | awk '{print $4}'); do [ -e "$object" ] && mv "$object" "$object.vcsh-unclobber"