Class peagen.plugins.vcs.git_vcs.GitVCS
peagen.plugins.vcs.git_vcs.GitVCS
GitVCS(
path=".",
*,
remote_url=None,
mirror_git_url=None,
mirror_git_token=None,
owner=None,
remotes=None,
)
Lightweight wrapper around :class:git.Repo
.
Source code in peagen/plugins/vcs/git_vcs.py
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
mirror_git_url
instance-attribute
mirror_git_url = mirror_git_url
mirror_git_token
instance-attribute
mirror_git_token = mirror_git_token
owner
instance-attribute
owner = owner
repo
instance-attribute
repo = clone_from(remote_url, p)
create_branch
create_branch(name, base_ref='HEAD', *, checkout=False)
Create name at base_ref and optionally check it out.
Source code in peagen/plugins/vcs/git_vcs.py
98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
switch
switch(branch)
Switch to branch.
Source code in peagen/plugins/vcs/git_vcs.py
112 113 114 115 116 |
|
fan_out
fan_out(base_ref, branches)
Create many branches at base_ref
.
Source code in peagen/plugins/vcs/git_vcs.py
118 119 120 121 |
|
fetch
fetch(ref, *, remote='origin', checkout=True)
Fetch ref
from *remote`` and optionally check it out.
Returns a tuple of (commit, updated)
where commit
is the new
HEAD SHA and updated
indicates if the commit changed.
Source code in peagen/plugins/vcs/git_vcs.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
push
push(ref, *, remote='origin', gateway_url=None)
Push ref
to remote.
If the DEPLOY_KEY_SECRET
environment variable is set, the
deploy key will be fetched from gateway_url
and used for
authentication.
Source code in peagen/plugins/vcs/git_vcs.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
push_with_secret
push_with_secret(
ref,
secret_name,
*,
remote="origin",
gateway_url="http://localhost:8000/rpc",
)
Push ref
using an encrypted deploy key secret.
Source code in peagen/plugins/vcs/git_vcs.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
|
has_remote
has_remote(name='origin')
Return True
if name
is a configured remote.
Source code in peagen/plugins/vcs/git_vcs.py
253 254 255 |
|
configure_remote
configure_remote(url, *, name='origin')
Add or update a remote called name
with url
.
Source code in peagen/plugins/vcs/git_vcs.py
257 258 259 260 261 262 263 264 265 266 267 268 269 |
|
require_remote
require_remote(name='origin')
Raise :class:GitRemoteMissingError
if name
is not configured.
Source code in peagen/plugins/vcs/git_vcs.py
271 272 273 274 275 276 |
|
checkout
checkout(ref)
Check out ref (branch or commit).
Source code in peagen/plugins/vcs/git_vcs.py
278 279 280 |
|
commit
commit(paths, message)
Source code in peagen/plugins/vcs/git_vcs.py
283 284 285 286 287 288 289 290 291 292 293 294 |
|
fan_in
fan_in(refs, message)
Source code in peagen/plugins/vcs/git_vcs.py
296 297 298 299 300 |
|
merge_ours
merge_ours(ref, message)
Merge ref
using the ours
strategy and commit.
Source code in peagen/plugins/vcs/git_vcs.py
302 303 304 305 |
|
tag
tag(name)
Source code in peagen/plugins/vcs/git_vcs.py
307 308 |
|
promote
promote(src_ref, dest_branch)
Source code in peagen/plugins/vcs/git_vcs.py
310 311 312 313 314 |
|
fast_import_json_ref
fast_import_json_ref(ref, data, *, message='key audit')
Create a commit at ref
containing data
as audit.json
.
Source code in peagen/plugins/vcs/git_vcs.py
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
|
record_key_audit
record_key_audit(ciphertext, user_fpr, gateway_fp)
Record a key audit commit for ciphertext
.
Parameters
ciphertext: Encrypted secret bytes used to derive the audit ref. user_fpr: Fingerprint of the submitting user's key. gateway_fp: Gateway public key fingerprint.
Returns
str The new commit SHA.
Source code in peagen/plugins/vcs/git_vcs.py
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
blob_oid
blob_oid(path, *, ref='HEAD')
Return the object ID for path
at ref
.
Source code in peagen/plugins/vcs/git_vcs.py
374 375 376 |
|
object_type
object_type(oid)
Return the git object type for oid
.
Source code in peagen/plugins/vcs/git_vcs.py
379 380 381 |
|
object_size
object_size(oid)
Return the size of oid
in bytes.
Source code in peagen/plugins/vcs/git_vcs.py
383 384 385 |
|
object_pretty
object_pretty(oid)
Return the pretty-printed content for oid
.
Source code in peagen/plugins/vcs/git_vcs.py
387 388 389 |
|
clean_reset
clean_reset()
Source code in peagen/plugins/vcs/git_vcs.py
392 393 394 |
|