Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
1d6db553
Commit
1d6db553
authored
Jul 08, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix two issues in cherry_pick_pull:
* Ignore errexit in trap handler * Check for branch (since two people have complained now..)
parent
7ccc0a4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
cherry_pick_pull.sh
hack/cherry_pick_pull.sh
+14
-4
No files found.
hack/cherry_pick_pull.sh
View file @
1d6db553
...
@@ -29,7 +29,11 @@ declare -r STARTINGBRANCH=$(git symbolic-ref --short HEAD)
...
@@ -29,7 +29,11 @@ declare -r STARTINGBRANCH=$(git symbolic-ref --short HEAD)
declare
-r
REBASEMAGIC
=
"
${
KUBE_ROOT
}
/.git/rebase-apply"
declare
-r
REBASEMAGIC
=
"
${
KUBE_ROOT
}
/.git/rebase-apply"
if
[[
"$#"
-ne
2
]]
;
then
if
[[
"$#"
-ne
2
]]
;
then
echo
"
${
0
}
<pr-number> <branch>: cherry pick <pr> onto <branch> and leave instructions for proposing pull request"
echo
"
${
0
}
<pr-number> <remote branch>: cherry pick <pr> onto <remote branch> and leave instructions for proposing pull request"
echo
""
echo
" Checks out <remote branch> and handles the cherry-pick of <pr> for you."
echo
" Example:"
echo
"
$0
12345 upstream/release-3.14"
exit
2
exit
2
fi
fi
...
@@ -48,6 +52,12 @@ declare -r BRANCH="${2}"
...
@@ -48,6 +52,12 @@ declare -r BRANCH="${2}"
echo
"+++ Updating remotes..."
echo
"+++ Updating remotes..."
git remote update
git remote update
if
!
git log
-n1
--format
=
%H
"
${
BRANCH
}
"
>
/dev/null 2>&1
;
then
echo
"!!! '
${
BRANCH
}
' not found. The second argument should be something like upstream/release-0.21."
echo
" (In particular, it needs to be a valid, existing remote branch that I can 'git checkout'.)"
exit
1
fi
echo
"+++ Downloading patch to /tmp/
${
PULL
}
.patch (in case you need to do this again)"
echo
"+++ Downloading patch to /tmp/
${
PULL
}
.patch (in case you need to do this again)"
curl
-o
"/tmp/
${
PULL
}
.patch"
-sSL
"https://github.com/GoogleCloudPlatform/kubernetes/pull/
${
PULL
}
.patch"
curl
-o
"/tmp/
${
PULL
}
.patch"
-sSL
"https://github.com/GoogleCloudPlatform/kubernetes/pull/
${
PULL
}
.patch"
...
@@ -62,11 +72,11 @@ function return_to_kansas {
...
@@ -62,11 +72,11 @@ function return_to_kansas {
echo
""
echo
""
echo
"+++ Returning you to the
${
STARTINGBRANCH
}
branch and cleaning up."
echo
"+++ Returning you to the
${
STARTINGBRANCH
}
branch and cleaning up."
if
[[
"
${
gitamcleanup
}
"
==
"true"
]]
;
then
if
[[
"
${
gitamcleanup
}
"
==
"true"
]]
;
then
git am
--abort
>
/dev/null
git am
--abort
>
/dev/null
2>&1
||
true
fi
fi
git checkout
-f
"
${
STARTINGBRANCH
}
"
>
/dev/null
git checkout
-f
"
${
STARTINGBRANCH
}
"
>
/dev/null
2>&1
||
true
if
[[
-n
"
${
cleanbranch
}
"
]]
;
then
if
[[
-n
"
${
cleanbranch
}
"
]]
;
then
git branch
-D
"
${
cleanbranch
}
"
>
/dev/null
git branch
-D
"
${
cleanbranch
}
"
>
/dev/null
2>&1
||
true
fi
fi
}
}
trap
return_to_kansas EXIT
trap
return_to_kansas EXIT
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment