git-gerrit 2.1.0__tar.gz → 3.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {git_gerrit-2.1.0/git_gerrit.egg-info → git_gerrit-3.2.0}/PKG-INFO +52 -28
  2. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/README.rst +40 -23
  3. git_gerrit-3.2.0/git_gerrit/__init__.py +62 -0
  4. git_gerrit-3.2.0/git_gerrit/__version__.py +1 -0
  5. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/git_gerrit/cli.py +271 -150
  6. git_gerrit-3.2.0/git_gerrit/core.py +529 -0
  7. git_gerrit-3.2.0/git_gerrit/db.py +500 -0
  8. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/git_gerrit/error.py +10 -10
  9. git_gerrit-3.2.0/git_gerrit/git.py +308 -0
  10. git_gerrit-3.2.0/git_gerrit/spinner.py +170 -0
  11. {git_gerrit-2.1.0 → git_gerrit-3.2.0/git_gerrit.egg-info}/PKG-INFO +52 -28
  12. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/git_gerrit.egg-info/SOURCES.txt +10 -4
  13. git_gerrit-3.2.0/git_gerrit.egg-info/entry_points.txt +12 -0
  14. git_gerrit-3.2.0/pyproject.toml +3 -0
  15. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/setup.py +13 -14
  16. git_gerrit-3.2.0/tests/test_cli.py +221 -0
  17. git_gerrit-3.2.0/tests/test_core.py +145 -0
  18. git_gerrit-3.2.0/tests/test_db.py +205 -0
  19. git_gerrit-3.2.0/tests/test_git.py +90 -0
  20. git_gerrit-2.1.0/git_gerrit/__init__.py +0 -581
  21. git_gerrit-2.1.0/git_gerrit/config.py +0 -62
  22. git_gerrit-2.1.0/git_gerrit/unicode.py +0 -74
  23. git_gerrit-2.1.0/git_gerrit.egg-info/entry_points.txt +0 -11
  24. git_gerrit-2.1.0/tests/test_api.py +0 -41
  25. git_gerrit-2.1.0/tests/test_cli.py +0 -55
  26. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/LICENSE.txt +0 -0
  27. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/MANIFEST.in +0 -0
  28. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/git_gerrit.egg-info/dependency_links.txt +0 -0
  29. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/git_gerrit.egg-info/requires.txt +0 -0
  30. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/git_gerrit.egg-info/top_level.txt +0 -0
  31. {git_gerrit-2.1.0 → git_gerrit-3.2.0}/setup.cfg +0 -0
@@ -1,22 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: git_gerrit
3
- Version: 2.1.0
3
+ Version: 3.2.0
4
4
  Summary: Gerrit review system command line tools.
5
5
  Home-page: https://github.com/meffie/git-gerrit
6
6
  Author: Michael Meffie
7
7
  Author-email: mmeffie@sinenomine.net
8
- License: BSD
8
+ License: BSD-2-Clause
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Environment :: Console
11
11
  Classifier: Intended Audience :: Developers
12
- Classifier: License :: OSI Approved :: BSD License
13
12
  Classifier: Operating System :: POSIX
14
- Classifier: Programming Language :: Python :: 2.7
15
13
  Classifier: Programming Language :: Python :: 3
16
14
  Classifier: Topic :: Software Development
17
15
  License-File: LICENSE.txt
18
16
  Requires-Dist: sh
19
17
  Requires-Dist: pygerrit2
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: home-page
23
+ Dynamic: license
24
+ Dynamic: license-file
25
+ Dynamic: requires-dist
26
+ Dynamic: summary
20
27
 
21
28
  git-gerrit
22
29
  ==========
@@ -27,12 +34,12 @@ with the **pygerrit2** package to access the Gerrit REST API.
27
34
 
28
35
  .. _Gerrit code review system: https://www.gerritcodereview.com/
29
36
 
30
- **git-gerrit** is compatible with Python 2 and Python 3.
37
+ **git-gerrit** is requires Python 3.9 or later.
31
38
 
32
39
  Commands
33
40
  ========
34
41
 
35
- .. code-block:: console
42
+ **git-gerrit** commands::
36
43
 
37
44
  git gerrit-checkout Fetch then checkout by gerrit number.
38
45
  git gerrit-cherry-pick Cherry pick from upstream branch by gerrit number to make a new gerrit.
@@ -40,25 +47,42 @@ Commands
40
47
  git gerrit-help List commands.
41
48
  git gerrit-install-hooks Install git hooks to create gerrit change-ids.
42
49
  git gerrit-log Show oneline log with gerrit numbers.
50
+ git gerrit-number Show info for a gerrit change number.
43
51
  git gerrit-query Search gerrit.
52
+ git gerrit-sync Fetch all changes and update the local database.
44
53
  git gerrit-update Update gerrits matching search terms.
45
- git gerrit-unpicked Find gerrit numbers on upstream branch not cherry picked.
46
54
  git gerrit-version Print version and exit.
47
55
 
48
56
  Installation
49
57
  ============
50
58
 
51
59
  .. _pipx: https://pipx.pypa.io/stable/
60
+ .. _uv: https://github.com/astral-sh/uv
61
+
62
+ The recommended way to install **git-gerrit** is with `uv`_ or `pipx`_.
63
+
64
+ To install with ``uv``, run the following as a regular user:
65
+
66
+ .. code-block:: console
67
+
68
+ uv tool install git-gerrit
69
+ uv tool update-shell
70
+
71
+ The ``uv tool update-shell`` command adds the installed commands to your
72
+ shell's PATH. Restart your shell after running ``update-shell``.
52
73
 
53
- Install with `pipx`_::
74
+ To install with ``pipx_``, run the following as a regular user:
54
75
 
55
- $ pipx install git-gerrit
76
+ .. code-block:: console
56
77
 
57
- Be sure your ``PATH`` has been updated to run **pipx** installed commands::
78
+ pipx install git-gerrit
79
+ pipx ensurepath
58
80
 
59
- $ pipx ensurepath
81
+ The ``pipx ensurepath`` command adds the installed commands to your shell's
82
+ PATH. Restart you shell after running ``ensurepath``.
60
83
 
61
- If **pipx** is not available, then install in a project local virtualenv::
84
+ Alternatively, you can install **git-gerrit** directly into a local virtual
85
+ environment with ``pip``::
62
86
 
63
87
  $ cd <my-project-directory>
64
88
  $ python3 -m venv .venv
@@ -66,7 +90,6 @@ If **pipx** is not available, then install in a project local virtualenv::
66
90
  (.venv) $ pip install -U pip setuptools
67
91
  (.venv) $ pip install git-gerrit
68
92
 
69
-
70
93
  Setup
71
94
  =====
72
95
 
@@ -93,6 +116,16 @@ Setup a local OpenAFS git repo::
93
116
  $ git config --local gerrit.project openafs
94
117
  $ git gerrit-install-hooks
95
118
 
119
+ Fetch all of the change commits from the upstream gerrit system to your local
120
+ repository and create the local sqlite database. This is a heavy weight operation
121
+ and is only needed for **git gerrit-log** and **git gerrit-number**::
122
+
123
+ $ git gerrit-sync
124
+ ✔ Fetching changes from https://gerrit.example.com/example
125
+ ✔ Updating local database
126
+ ✔ Scanning commit messages
127
+ Done.
128
+
96
129
  Find open gerrits on the master branch::
97
130
 
98
131
  $ git gerrit-query is:open branch:master
@@ -124,7 +157,7 @@ Find gerrits with subjects containing the term 'debuginfo'::
124
157
 
125
158
  Find the branch names of gerrits with the subject containing the term 'debuginfo'::
126
159
 
127
- $ git gerrit-query --format='{branch:>20s} {_number} {subject}' debuginfo
160
+ $ git gerrit-query --format='{branch:>20s} {number} {subject}' debuginfo
128
161
  master 13030 redhat: Make separate debuginfo for kmods work with recent rpm
129
162
  openafs-stable-1_6_x 13029 redhat: Create unique debuginfo packages for kmods
130
163
  openafs-stable-1_6_x 12818 redhat: separate debuginfo package for kmod rpm
@@ -151,18 +184,18 @@ Checkout a gerrit by number::
151
184
 
152
185
  Cherry-pick a gerrit onto the current branch::
153
186
 
154
- $ git gerrit-fetch --no-branch 13001 && git cherry-pick FETCH_HEAD
187
+ $ git gerrit-fetch 13001 && git cherry-pick FETCH_HEAD
155
188
 
156
189
  Show gerrit numbers in the checked out branch in the local git repo::
157
190
 
158
- $ git gerrit-log
191
+ $ git gerrit-log -n3
159
192
  12958 f47cb2d Suppress statement not reached warnings under Solaris Studio
160
193
  12957 306f0f3 afs: squash empty declaration warning
161
194
  12955 e006609 libafs: git ignore build artifacts on Solaris
162
195
 
163
196
  Show gerrit numbers by a revision in the local git repo::
164
197
 
165
- $ git gerrit-log openafs-stable-1_8_0
198
+ $ git gerrit-log -n3 openafs-stable-1_8_0
166
199
  12953 a08327f Update NEWS for 1.8.0 final release
167
200
  12938 acb0e84 afs_pioctl: avoid -Wpointer-sign
168
201
  12950 b73863b LINUX: fix RedHat 7.5 ENOTDIR issues
@@ -176,20 +209,11 @@ Show gerrit numbers by a range of revisions in the local git repo::
176
209
 
177
210
  Show just the gerrit numbers and subjects in the local git repo::
178
211
 
179
- $ git gerrit-log --format='{number}: {subject}'
212
+ $ git gerrit-log -n3 --format='{number}: {subject}'
180
213
  12958: Suppress statement not reached warnings under Solaris Studio
181
214
  12957: afs: squash empty declaration warning
182
215
  12955: libafs: git ignore build artifacts on Solaris
183
216
 
184
- Show the commits on the master branch which have not been cherry-picked on to
185
- the stable branch. (Gerrits may already exists for them.)::
186
-
187
- $ git gerrit-unpicked -u origin/master origin/openafs-stable-1_8_x
188
- 13656 4eeed830fa31b7b8b5487ba619acbc8d30642aaa afscp: Link against opr/roken/hcrypto
189
- 13659 f5f59cd8d336b153e2b762bb7afd16e6ab1b1ee2 util: serverLog using memory after free
190
- 13665 1210a8d6d96db2d84595d35ef81ec5d176de05e8 LINUX: Run the 'sparse' checker if available
191
- ...
192
-
193
217
  Add reviewers to the **foobar** topic::
194
218
 
195
219
  $ git gerrit-update --add-reviewer="ty@example.com" branch:master is:open topic:foobar
@@ -7,12 +7,12 @@ with the **pygerrit2** package to access the Gerrit REST API.
7
7
 
8
8
  .. _Gerrit code review system: https://www.gerritcodereview.com/
9
9
 
10
- **git-gerrit** is compatible with Python 2 and Python 3.
10
+ **git-gerrit** is requires Python 3.9 or later.
11
11
 
12
12
  Commands
13
13
  ========
14
14
 
15
- .. code-block:: console
15
+ **git-gerrit** commands::
16
16
 
17
17
  git gerrit-checkout Fetch then checkout by gerrit number.
18
18
  git gerrit-cherry-pick Cherry pick from upstream branch by gerrit number to make a new gerrit.
@@ -20,25 +20,42 @@ Commands
20
20
  git gerrit-help List commands.
21
21
  git gerrit-install-hooks Install git hooks to create gerrit change-ids.
22
22
  git gerrit-log Show oneline log with gerrit numbers.
23
+ git gerrit-number Show info for a gerrit change number.
23
24
  git gerrit-query Search gerrit.
25
+ git gerrit-sync Fetch all changes and update the local database.
24
26
  git gerrit-update Update gerrits matching search terms.
25
- git gerrit-unpicked Find gerrit numbers on upstream branch not cherry picked.
26
27
  git gerrit-version Print version and exit.
27
28
 
28
29
  Installation
29
30
  ============
30
31
 
31
32
  .. _pipx: https://pipx.pypa.io/stable/
33
+ .. _uv: https://github.com/astral-sh/uv
34
+
35
+ The recommended way to install **git-gerrit** is with `uv`_ or `pipx`_.
36
+
37
+ To install with ``uv``, run the following as a regular user:
38
+
39
+ .. code-block:: console
40
+
41
+ uv tool install git-gerrit
42
+ uv tool update-shell
43
+
44
+ The ``uv tool update-shell`` command adds the installed commands to your
45
+ shell's PATH. Restart your shell after running ``update-shell``.
32
46
 
33
- Install with `pipx`_::
47
+ To install with ``pipx_``, run the following as a regular user:
34
48
 
35
- $ pipx install git-gerrit
49
+ .. code-block:: console
36
50
 
37
- Be sure your ``PATH`` has been updated to run **pipx** installed commands::
51
+ pipx install git-gerrit
52
+ pipx ensurepath
38
53
 
39
- $ pipx ensurepath
54
+ The ``pipx ensurepath`` command adds the installed commands to your shell's
55
+ PATH. Restart you shell after running ``ensurepath``.
40
56
 
41
- If **pipx** is not available, then install in a project local virtualenv::
57
+ Alternatively, you can install **git-gerrit** directly into a local virtual
58
+ environment with ``pip``::
42
59
 
43
60
  $ cd <my-project-directory>
44
61
  $ python3 -m venv .venv
@@ -46,7 +63,6 @@ If **pipx** is not available, then install in a project local virtualenv::
46
63
  (.venv) $ pip install -U pip setuptools
47
64
  (.venv) $ pip install git-gerrit
48
65
 
49
-
50
66
  Setup
51
67
  =====
52
68
 
@@ -73,6 +89,16 @@ Setup a local OpenAFS git repo::
73
89
  $ git config --local gerrit.project openafs
74
90
  $ git gerrit-install-hooks
75
91
 
92
+ Fetch all of the change commits from the upstream gerrit system to your local
93
+ repository and create the local sqlite database. This is a heavy weight operation
94
+ and is only needed for **git gerrit-log** and **git gerrit-number**::
95
+
96
+ $ git gerrit-sync
97
+ ✔ Fetching changes from https://gerrit.example.com/example
98
+ ✔ Updating local database
99
+ ✔ Scanning commit messages
100
+ Done.
101
+
76
102
  Find open gerrits on the master branch::
77
103
 
78
104
  $ git gerrit-query is:open branch:master
@@ -104,7 +130,7 @@ Find gerrits with subjects containing the term 'debuginfo'::
104
130
 
105
131
  Find the branch names of gerrits with the subject containing the term 'debuginfo'::
106
132
 
107
- $ git gerrit-query --format='{branch:>20s} {_number} {subject}' debuginfo
133
+ $ git gerrit-query --format='{branch:>20s} {number} {subject}' debuginfo
108
134
  master 13030 redhat: Make separate debuginfo for kmods work with recent rpm
109
135
  openafs-stable-1_6_x 13029 redhat: Create unique debuginfo packages for kmods
110
136
  openafs-stable-1_6_x 12818 redhat: separate debuginfo package for kmod rpm
@@ -131,18 +157,18 @@ Checkout a gerrit by number::
131
157
 
132
158
  Cherry-pick a gerrit onto the current branch::
133
159
 
134
- $ git gerrit-fetch --no-branch 13001 && git cherry-pick FETCH_HEAD
160
+ $ git gerrit-fetch 13001 && git cherry-pick FETCH_HEAD
135
161
 
136
162
  Show gerrit numbers in the checked out branch in the local git repo::
137
163
 
138
- $ git gerrit-log
164
+ $ git gerrit-log -n3
139
165
  12958 f47cb2d Suppress statement not reached warnings under Solaris Studio
140
166
  12957 306f0f3 afs: squash empty declaration warning
141
167
  12955 e006609 libafs: git ignore build artifacts on Solaris
142
168
 
143
169
  Show gerrit numbers by a revision in the local git repo::
144
170
 
145
- $ git gerrit-log openafs-stable-1_8_0
171
+ $ git gerrit-log -n3 openafs-stable-1_8_0
146
172
  12953 a08327f Update NEWS for 1.8.0 final release
147
173
  12938 acb0e84 afs_pioctl: avoid -Wpointer-sign
148
174
  12950 b73863b LINUX: fix RedHat 7.5 ENOTDIR issues
@@ -156,20 +182,11 @@ Show gerrit numbers by a range of revisions in the local git repo::
156
182
 
157
183
  Show just the gerrit numbers and subjects in the local git repo::
158
184
 
159
- $ git gerrit-log --format='{number}: {subject}'
185
+ $ git gerrit-log -n3 --format='{number}: {subject}'
160
186
  12958: Suppress statement not reached warnings under Solaris Studio
161
187
  12957: afs: squash empty declaration warning
162
188
  12955: libafs: git ignore build artifacts on Solaris
163
189
 
164
- Show the commits on the master branch which have not been cherry-picked on to
165
- the stable branch. (Gerrits may already exists for them.)::
166
-
167
- $ git gerrit-unpicked -u origin/master origin/openafs-stable-1_8_x
168
- 13656 4eeed830fa31b7b8b5487ba619acbc8d30642aaa afscp: Link against opr/roken/hcrypto
169
- 13659 f5f59cd8d336b153e2b762bb7afd16e6ab1b1ee2 util: serverLog using memory after free
170
- 13665 1210a8d6d96db2d84595d35ef81ec5d176de05e8 LINUX: Run the 'sparse' checker if available
171
- ...
172
-
173
190
  Add reviewers to the **foobar** topic::
174
191
 
175
192
  $ git gerrit-update --add-reviewer="ty@example.com" branch:master is:open topic:foobar
@@ -0,0 +1,62 @@
1
+ # Copyright (c) 2018-2024 Sine Nomine Associates
2
+ #
3
+ # Redistribution and use in source and binary forms, with or without
4
+ # modification, are permitted provided that the following conditions are met:
5
+ #
6
+ # 1. Redistributions of source code must retain the above copyright notice, this
7
+ # list of conditions and the following disclaimer.
8
+ #
9
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ # this list of conditions and the following disclaimer in the documentation
11
+ # and/or other materials provided with the distribution.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14
+ # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15
+ # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16
+ # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17
+ # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20
+
21
+ """
22
+ Git helpers for the Gerrit code review system, with an emphasis on the Gerrit
23
+ old-style numeric identifiers.
24
+ """
25
+
26
+ from git_gerrit.__version__ import VERSION
27
+ from git_gerrit.git import Git
28
+ from git_gerrit.error import (
29
+ GitGerritError,
30
+ GitGerritConfigError,
31
+ GitGerritFormatError,
32
+ GitGerritNotFoundError,
33
+ )
34
+ from git_gerrit.core import (
35
+ CHANGE_FIELDS,
36
+ LOG_FIELDS,
37
+ cherry_pick,
38
+ fetch,
39
+ get_current_change,
40
+ log,
41
+ query,
42
+ sync,
43
+ update,
44
+ )
45
+
46
+ _hush_linter = [
47
+ VERSION,
48
+ CHANGE_FIELDS,
49
+ LOG_FIELDS,
50
+ Git,
51
+ GitGerritError,
52
+ GitGerritConfigError,
53
+ GitGerritFormatError,
54
+ GitGerritNotFoundError,
55
+ cherry_pick,
56
+ fetch,
57
+ get_current_change,
58
+ log,
59
+ query,
60
+ sync,
61
+ update,
62
+ ]
@@ -0,0 +1 @@
1
+ VERSION = "3.2.0"