Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4585df83
Commit
4585df83
authored
Oct 24, 2018
by
James Lopez
Committed by
Robert Speicher
Oct 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix secpick to use EE and guess branch name
parent
605e952e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
bin/secpick
bin/secpick
+10
-4
No files found.
bin/secpick
View file @
4585df83
...
...
@@ -15,7 +15,7 @@ parser = OptionParser.new do |opts|
options
[
:version
]
=
version
&
.
tr
(
'.'
,
'-'
)
end
opts
.
on
(
'-b'
,
'--branch security-fix-branch'
,
'Original branch name'
)
do
|
branch
|
opts
.
on
(
'-b'
,
'--branch security-fix-branch'
,
'Original branch name
(optional, defaults to current)
'
)
do
|
branch
|
options
[
:branch
]
=
branch
end
...
...
@@ -32,15 +32,21 @@ end
parser
.
parse!
options
[
:branch
]
||=
`git rev-parse --abbrev-ref HEAD`
abort
(
"Missing options. Use
#{
$0
}
--help to see the list of options available"
.
red
)
if
options
.
values
.
include?
(
nil
)
abort
(
"Wrong version format
#{
options
[
:version
].
bold
}
"
.
red
)
unless
options
[
:version
]
=~
/\A\d*\-\d*\Z/
branch
=
"
#{
options
[
:branch
]
}
-
#{
options
[
:version
]
}
"
ee
=
File
.
exist?
(
'./CHANGELOG-EE.md'
)
original_branch
=
options
[
:branch
].
strip
branch
=
"
#{
original_branch
}
-
#{
options
[
:version
]
}
"
branch
.
prepend
(
"
#{
BRANCH_PREFIX
}
-"
)
unless
branch
.
start_with?
(
"
#{
BRANCH_PREFIX
}
-"
)
branch
=
branch
.
freeze
stable_branch
=
"
#{
BRANCH_PREFIX
}
-
#{
options
[
:version
]
}
"
.
freeze
stable_branch
=
"
#{
BRANCH_PREFIX
}
-
#{
options
[
:version
]
}
"
.
tap
do
|
name
|
name
<<
"-ee"
if
ee
end
.
freeze
command
=
"git fetch
#{
REMOTE
}
#{
stable_branch
}
&& git checkout
#{
stable_branch
}
&& git pull
#{
REMOTE
}
#{
stable_branch
}
&& git checkout -B
#{
branch
}
&& git cherry-pick
#{
options
[
:sha
]
}
&& git push
#{
REMOTE
}
#{
branch
}
"
command
=
"git fetch
#{
REMOTE
}
#{
stable_branch
}
&& git checkout
#{
stable_branch
}
&& git pull
#{
REMOTE
}
#{
stable_branch
}
&& git checkout -B
#{
branch
}
&& git cherry-pick
#{
options
[
:sha
]
}
&& git push
#{
REMOTE
}
#{
branch
}
&& git checkout
#{
original_branch
}
"
_stdin
,
stdout
,
stderr
=
Open3
.
popen3
(
command
)
...
...
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