Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simcha van Collem
Iris
Commits
e1067d01
Commit
e1067d01
authored
9 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
extractor can now automatically fetch missing new commits
parent
500176fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmark/gitlab-extract.py
+13
-0
13 additions, 0 deletions
benchmark/gitlab-extract.py
with
13 additions
and
0 deletions
benchmark/gitlab-extract.py
+
13
−
0
View file @
e1067d01
...
@@ -3,6 +3,12 @@ import argparse, pprint, subprocess, sys
...
@@ -3,6 +3,12 @@ import argparse, pprint, subprocess, sys
import
requests
import
requests
import
parse_log
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
):
def
first
(
it
):
for
i
in
it
:
for
i
in
it
:
return
i
return
i
...
@@ -32,6 +38,13 @@ parser.add_argument("-c", "--commits",
...
@@ -32,6 +38,13 @@ parser.add_argument("-c", "--commits",
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
log_file
=
sys
.
stdout
if
args
.
file
==
"
-
"
else
open
(
args
.
file
,
"
a
"
)
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
"
)
projects
=
req
(
"
projects
"
)
project
=
first
(
filter
(
lambda
p
:
p
[
'
path_with_namespace
'
]
==
args
.
project
,
projects
.
json
()))
project
=
first
(
filter
(
lambda
p
:
p
[
'
path_with_namespace
'
]
==
args
.
project
,
projects
.
json
()))
...
...
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