aboutsummaryrefslogtreecommitdiff
path: root/b4/__init__.py
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-07-27 14:37:03 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-07-27 14:37:03 -0400
commit9e95d523c9b936ecda8ac842dc520b54d1706ff2 (patch)
tree8e80139b1f576124c056909f95535c96b45ebbc3 /b4/__init__.py
parent81e45945580d7c97dc22e798b2a9d73ffb61214c (diff)
downloadb4-9e95d523c9b936ecda8ac842dc520b54d1706ff2.tar.gz
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 <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/__init__.py')
-rw-r--r--b4/__init__.py6
1 files changed, 6 insertions, 0 deletions
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}')