From 9e95d523c9b936ecda8ac842dc520b54d1706ff2 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 27 Jul 2022 14:37:03 -0400 Subject: ez: implement tip-commit strategy First go at implementing the tip-commit strategy. It shares a lot with the 'commit' strategy, but there are gotchas for situations where the cover letter commit is suddenly not the tip commit any more (rebase, new commits, etc). Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'b4/__init__.py') diff --git a/b4/__init__.py b/b4/__init__.py index 2a6da91..e2ed881 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -2432,13 +2432,19 @@ def git_range_to_patches(gitdir: Optional[str], start: str, end: str, seriests: Optional[int] = None, mailfrom: Optional[Tuple[str, str]] = None, extrahdrs: Optional[List[Tuple[str, str]]] = None, + ignore_commits: Optional[Set[str]] = None, thread: bool = False, keepdate: bool = False) -> List[Tuple[str, email.message.Message]]: patches = list() commits = git_get_command_lines(gitdir, ['rev-list', '--reverse', f'{start}..{end}']) if not commits: raise RuntimeError(f'Could not run rev-list {start}..{end}') + if ignore_commits is None: + ignore_commits = set() for commit in commits: + if commit in ignore_commits: + logger.debug('Ignoring commit %s', commit) + continue ecode, out = git_run_command(gitdir, ['show', '--format=email', '--encoding=utf-8', commit], decode=False) if ecode > 0: raise RuntimeError(f'Could not get a patch out of {commit}') -- cgit v1.2.3