Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Iris
Iris
Commits
e1067d01
Commit
e1067d01
authored
Feb 24, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extractor can now automatically fetch missing new commits
parent
500176fd
Pipeline
#134
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
benchmark/gitlab-extract.py
benchmark/gitlab-extract.py
+13
-0
No files found.
benchmark/gitlab-extract.py
View file @
e1067d01
...
...
@@ -3,6 +3,12 @@ import argparse, pprint, subprocess, sys
import
requests
import
parse_log
def
last
(
it
):
r
=
first
(
it
)
# errors out if it is empty
for
i
in
it
:
r
=
i
return
r
def
first
(
it
):
for
i
in
it
:
return
i
...
...
@@ -32,6 +38,13 @@ parser.add_argument("-c", "--commits",
args
=
parser
.
parse_args
()
log_file
=
sys
.
stdout
if
args
.
file
==
"-"
else
open
(
args
.
file
,
"a"
)
# determine commit, if missing
if
args
.
commits
is
None
:
if
args
.
file
==
"-"
:
raise
Exception
(
"If you do not give explicit commits, you have to give a logfile so that we can determine the missing commits."
)
last_result
=
last
(
parse_log
.
parse
(
open
(
args
.
file
,
"r"
),
[]))
args
.
commits
=
"{}..origin/master"
.
format
(
last_result
.
commit
)
projects
=
req
(
"projects"
)
project
=
first
(
filter
(
lambda
p
:
p
[
'path_with_namespace'
]
==
args
.
project
,
projects
.
json
()))
...
...
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