Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vcsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
vcsh
Commits
62896f1b
Commit
62896f1b
authored
Feb 8, 2014
by
Richard Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
doc/sample_hooks/: Cleanups
parent
30e3b0e7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/sample_hooks/post-merge-unclobber
+5
-5
5 additions, 5 deletions
doc/sample_hooks/post-merge-unclobber
doc/sample_hooks/pre-merge-unclobber
+5
-5
5 additions, 5 deletions
doc/sample_hooks/pre-merge-unclobber
with
10 additions
and
10 deletions
doc/sample_hooks/post-merge-unclobber
+
5
−
5
View file @
62896f1b
#!/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
g
it repository gets checked out
#
and the extant object
s end up back in the working
directory. Git now
# see
s
these as un-staged changes to the
working branch and you can deal
# w
ith 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
G
it repository gets checked out
#
without error and the pre-existing file
s end up back in the working
#
directory. Git and thus vcsh now
see these as un-staged changes to the
# w
orking branch and you can deal with them as usual
.
find
-name
'*.vcsh-unclobber'
-execdir
rename .vcsh-unclobber
''
{}
\;
This diff is collapsed.
Click to expand it.
doc/sample_hooks/pre-merge-unclobber
+
5
−
5
View file @
62896f1b
#!/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 object
s.
# 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 file
s.
for
object
in
$(
git ls-tree
-r
origin/master |
awk
'{print $4}'
)
;
do
[
-e
"
$object
"
]
&&
mv
"
$object
"
"
$object
.vcsh-unclobber"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment