Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chaosframework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
chaos-lnf-control
chaosframework
Commits
a387abcd
Commit
a387abcd
authored
3 years ago
by
Andrea Michelotti
Browse files
Options
Downloads
Patches
Plain Diff
more portable, merge only if difference
parent
b991c756
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/chaos_git.sh
+30
-28
30 additions, 28 deletions
tools/chaos_git.sh
with
30 additions
and
28 deletions
tools/chaos_git.sh
+
30
−
28
View file @
a387abcd
...
...
@@ -151,7 +151,7 @@ shift $(( OPTIND - 1 ))
if
[
${#
on_dir
[@]
}
-eq
0
]
;
then
# dirs=$(find . -name ".git" -exec grep -sl infn \{\}/config \;)
dirs
=
$(
find
.
-maxdepth
$maxdepth
-name
".git"
-type
d
-not
-path
*
.repo/
*
)
dirs
=
$(
find
.
-maxdepth
$maxdepth
-name
".git"
-not
-path
*
.repo/
*
)
for
d
in
$dirs
;
do
dir
=
$(
dirname
$d
)
...
...
@@ -250,37 +250,39 @@ for dir in ${on_dir[@]}; do
usage
exit
1
fi
info_mesg
"[
$dir
] merging "
"
\"
$1
\"
=>
\"
$2
\"
(
$overall_mesg
) "
if
[
-z
"
$overall_mesg
"
]
;
then
info_mesg_n
"[
$dir
] empty comment to skip:"
read
mesg
else
mesg
=
$overall_mesg
fi
if
!
git diff
$1
origin/
$2
;
then
info_mesg
"[
$dir
] merging "
"
\"
$1
\"
=>
\"
$2
\"
(
$overall_mesg
) "
if
[
-z
"
$overall_mesg
"
]
;
then
info_mesg_n
"[
$dir
] empty comment to skip:"
read
mesg
else
mesg
=
$overall_mesg
fi
if
[
-n
"
$mesg
"
]
;
then
if
git_checkout
$dir
$2
;
then
if
git merge
-m
"
$mesg
"
--no-ff
$1
;
then
info_mesg
"[
$dir
] merge "
"done"
else
error_mesg
"[
$dir
] error merging
$1
->
$2
, skipping merge"
fi
if
git push origin
$2
;
then
info_mesg
"[
$dir
] push origin
$2
"
"done"
else
error_mesg
"[
$dir
] error pushing
$2
-> origin, skipping merge"
fi
if
git checkout
$1
;
then
info_mesg
"[
$dir
] back into branch
$1
"
"done"
else
error_mesg
"[
$dir
] error back into branch
$1
, skipping merge"
fi
if
[
-n
"
$mesg
"
]
;
then
if
git_checkout
$dir
$2
;
then
if
git merge
-m
"
$mesg
"
--no-ff
$1
;
then
info_mesg
"[
$dir
] merge "
"done"
else
error_mesg
"[
$dir
] error merging
$1
->
$2
, skipping merge"
fi
if
git push origin
$2
;
then
info_mesg
"[
$dir
] push origin
$2
"
"done"
else
error_mesg
"[
$dir
] error pushing
$2
-> origin, skipping merge"
fi
if
git checkout
$1
;
then
info_mesg
"[
$dir
] back into branch
$1
"
"done"
else
error_mesg
"[
$dir
] error back into branch
$1
, skipping merge"
fi
fi
fi
fi
fi
;;
b
)
...
...
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