FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/docs/gl_objects/commits.py at master · smitsgit/python-gitlab · GitHub
smitsgit
python-gitlab
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
docs
/
gl_objects
/
commits.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
61 lines (51 loc) · 1.4 KB
Breadcrumbs
python-gitlab
/
docs
/
gl_objects
/
commits.py
Copy path
File metadata and controls
61 lines (51 loc) · 1.4 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# list
commits
=
project
.
commits
.
list
()
# end list
# filter list
commits
=
project
.
commits
.
list
(
ref_name
=
'my_branch'
)
commits
=
project
.
commits
.
list
(
since
=
'2016-01-01T00:00:00Z'
)
# end filter list
# create
# See https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions
# for actions detail
data
=
{
'branch_name'
:
'master'
,
# v3
'branch'
:
'master'
,
# v4
'commit_message'
:
'blah blah blah'
,
'actions'
: [
{
'action'
:
'create'
,
'file_path'
:
'blah'
,
'content'
:
'blah'
}
]
}
commit
=
project
.
commits
.
create
(
data
)
# end create
# get
commit
=
project
.
commits
.
get
(
'e3d5a71b'
)
# end get
# diff
diff
=
commit
.
diff
()
# end diff
# cherry
commit
.
cherry_pick
(
branch
=
'target_branch'
)
# end cherry
# comments list
comments
=
commit
.
comments
.
list
()
# end comments list
# comments create
# Global comment
commit
=
commit
.
comments
.
create
({
'note'
:
'This is a nice comment'
})
# Comment on a line in a file (on the new version of the file)
commit
=
commit
.
comments
.
create
({
'note'
:
'This is another comment'
,
'line'
:
12
,
'line_type'
:
'new'
,
'path'
:
'README.rst'
})
# end comments create
# statuses list
statuses
=
commit
.
statuses
.
list
()
# end statuses list
# statuses set
commit
.
statuses
.
create
({
'state'
:
'success'
})
# end statuses set
Back
|
FazBrowse Home
|
New Git URL