Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
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
justinfreeman (Agileware)
Core
Commits
f2e45cbe
Commit
f2e45cbe
authored
12 years ago
by
Kurund Jalmi
Browse files
Options
Downloads
Plain Diff
Merge pull request #385 from totten/merge-forward
Add tools/scripts/merge-forward
parents
7c661be2
8f9505e1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/scripts/merge-forward
+52
-0
52 additions, 0 deletions
tools/scripts/merge-forward
with
52 additions
and
0 deletions
tools/scripts/merge-forward
0 → 100755
+
52
−
0
View file @
f2e45cbe
#!/bin/bash
set
-e
RELPATH
=
"
$1
"
REMOTE
=
"
$2
"
MAINTBRANCH
=
"
$3
"
DEVBRANCH
=
"
$4
"
TMPBRANCH
=
$MAINTBRANCH
-
$DEVBRANCH
-
$(
date
"+%Y-%m-%d-%H-%M-%S"
)
if
[
-z
"
$RELPATH
"
-o
-z
"
$REMOTE
"
-o
-z
"
$MAINTBRANCH
"
-o
-z
"
$DEVBRANCH
"
]
;
then
PROG
=
$(
basename
$0
)
echo
"Merge any changes from the maintenance-branch into the development-branch."
echo
"If there are no conflicts, then push the changes."
echo
""
echo
"Usage:
$PROG
<relpath> <remote> <maintenance-branch> <development-branch>"
echo
""
echo
"Example:
$PROG
drupal upstream 7.x-4.3 7.x-master"
exit
1
fi
pushd
"
$RELPATH
"
>>
/dev/null
TMPFILE
=
$(
mktemp
)
set
-x
git fetch
$REMOTE
git checkout
-b
$TMPBRANCH
$REMOTE
/
$DEVBRANCH
git merge
$REMOTE
/
$MAINTBRANCH
|
tee
$TMPFILE
set
+x
if
grep
-q
CONFLICT
"
$TMPFILE
"
;
then
echo
""
echo
"==> Conflicted merge. Please resolve conflicts and then push with:"
echo
""
echo
"git push
$REMOTE
$TMPBRANCH
:
$DEVBRANCH
"
elif
grep
-q
"Already up-to-date."
"
$TMPFILE
"
;
then
echo
""
echo
"==> No update needed"
echo
""
else
echo
""
echo
"==> Clean merge; proceeding with push"
echo
""
set
-x
git push
$REMOTE
$TMPBRANCH
:
$DEVBRANCH
git fetch
$REMOTE
git checkout
$REMOTE
/
$DEVBRANCH
git branch
-d
$TMPBRANCH
set
+x
fi
/bin/rm
-f
"
$TMPFILE
"
popd
>>
/dev/null
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