Skip to content
Snippets Groups Projects
Commit 62896f1b authored by Richard Hartmann's avatar Richard Hartmann
Browse files

doc/sample_hooks/: Cleanups

parent 30e3b0e7
No related branches found
No related tags found
No related merge requests found
#!/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 '' {} \;
#!/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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment