aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-07-22 15:02:30 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-07-22 15:02:30 -0400
commit11e7e77db0f92864a3e203e5e824c4d5f6de5f77 (patch)
treeace87fe6eed9e36e489e5eb6a3dfd3517463f438
parentd952f4b20bc1e805223e2aaf62ae69cb1d41fbea (diff)
downloadb4-11e7e77db0f92864a3e203e5e824c4d5f6de5f77.tar.gz
ez: bail on unknown cover letter strategy
We currently only support "commit" and "branch-description" strategies. Two more may be implemented in the future, but I need to figure out if commit reordering can be done with git-filter-repo or not. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/ez.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/b4/ez.py b/b4/ez.py
index 35bb622..3ffc4a3 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -348,6 +348,11 @@ def store_cover(content: str, tracking: dict, new: bool = False) -> None:
logger.info('Updated branch description and tracking info.')
+# Valid cover letter strategies:
+# 'commit': in a commit at the start of the series : implemented
+# 'branch-description': in the branch description : implemented
+# 'tip-commit': in a commit at the tip of the branch : TODO
+# 'tag': in an annotated tag at the tip of the branch : TODO
def get_cover_strategy(branch: Optional[str] = None) -> str:
if branch is None:
branch = b4.git_get_current_branch()
@@ -359,7 +364,11 @@ def get_cover_strategy(branch: Optional[str] = None) -> str:
config = b4.get_main_config()
strategy = config.get('ez-cover-strategy', 'commit')
- return strategy
+ if strategy in {'commit', 'branch-description'}:
+ return strategy
+
+ logger.critical('CRITICAL: unknown ez-cover-strategy: %s', strategy)
+ sys.exit(1)
def is_ez_branch() -> bool: