Lines Matching refs:commit
52 IS_REVERT = re.compile(r'This reverts commit ([0-9a-f]{40})')
103 'git', 'commit', *cmd,
142 # Show commit date, ie. when the commit actually landed
257 async def resolve_nomination(commit: 'Commit', version: str) -> 'Commit':
260 'git', 'log', '--format=%B', '-1', commit.sha,
265 assert p.returncode == 0, f'git log for {commit.sha} failed'
273 # check to see if this fixes another staged commit.
275 commit.because_sha = fixed = await full_sha(m.group(1))
279 commit.nomination_type = NominationType.FIXES
281 commit.nominated = True
282 return commit
287 commit.nominated = True
288 commit.nomination_type = NominationType.CC
289 return commit
295 commit.because_sha = reverted = await full_sha(m.group(1))
299 commit.nomination_type = NominationType.REVERT
301 commit.nominated = True
302 return commit
304 return commit
308 """Determine if any of the undecided commits fix/revert a staged commit.
310 The are still needed if they apply to a commit that is staged for
313 This must be done in order, because a commit 3 might fix commit 2 which
314 fixes commit 1.
319 for commit in reversed(commits):
320 if not commit.nominated and commit.nomination_type is NominationType.FIXES:
321 commit.nominated = commit.because_sha in shas
323 if commit.nominated:
324 shas.add(commit.sha)
326 for commit in commits:
327 if (commit.nomination_type is NominationType.REVERT and
328 commit.because_sha in shas):
330 if oldc.sha == commit.because_sha:
331 # In this case a commit that hasn't yet been applied is
332 # reverted, we don't want to apply that commit at all
335 commit.nominated = False
336 commit.resolution = Resolution.DENOMINATED
337 shas.remove(commit.because_sha)
351 async def inner(commit: 'Commit', version: str,
354 commits[index] = await resolve_nomination(commit, version)
367 for commit in commits:
368 if commit.resolution is Resolution.UNRESOLVED and not commit.nominated:
369 commit.resolution = Resolution.NOTNEEDED