diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-07-22 15:02:30 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2022-07-22 15:02:30 -0400 |
commit | 11e7e77db0f92864a3e203e5e824c4d5f6de5f77 (patch) | |
tree | ace87fe6eed9e36e489e5eb6a3dfd3517463f438 | |
parent | d952f4b20bc1e805223e2aaf62ae69cb1d41fbea (diff) | |
download | b4-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.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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: |