From 2a2ebce30b885fad74f01b7d7d4d9a4079078151 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 15 Jul 2026 12:11:05 +1000 Subject: [PATCH 1/2] push-merge: add --merge-strategy (bug 2055105) --- lando_cli/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lando_cli/cli.py b/lando_cli/cli.py index 06b84f6..1122e65 100644 --- a/lando_cli/cli.py +++ b/lando_cli/cli.py @@ -693,6 +693,8 @@ def push_tag( @click.option("--lando-repo", help="Lando repo to post changes to.") @click.option("--target-commit", help="Target commit to merge into.") @click.option("--commit-message", help="Commit message for the merge commit.") +# XXX: better validation and default +@click.option("--merge-strategy", help="Merge strategy: ours (default) or theirs") @with_config def push_merge( config: Config, @@ -700,6 +702,7 @@ def push_merge( lando_repo: str, target_commit: str, commit_message: str, + merge_strategy: str | None = None, ): """Push merge actions to the specified repository. @@ -733,7 +736,7 @@ def push_merge( "action": "merge-onto", "commit_message": commit_message, "target": target_commit, - "strategy": None, + "strategy": merge_strategy, } ] else: From d6f591f52884006bb49a66bd261b09017862548e Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Wed, 15 Jul 2026 12:26:44 +1000 Subject: [PATCH 2/2] fixup! push-merge: add --merge-strategy (bug 2055105) --- lando_cli/cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lando_cli/cli.py b/lando_cli/cli.py index 1122e65..6c2111e 100644 --- a/lando_cli/cli.py +++ b/lando_cli/cli.py @@ -419,7 +419,9 @@ def display_tag_actions(actions: list[dict]): click.echo("") -def detect_merge_from_current_head(repo: Path) -> Optional[list[dict]]: +def detect_merge_from_current_head( + repo: Path, merge_strategy: str | None = None +) -> Optional[list[dict]]: """Detect if HEAD is a merge commit and return an action for the merge. If HEAD is a merge commit (a commit with two parents), return an action @@ -455,7 +457,7 @@ def detect_merge_from_current_head(repo: Path) -> Optional[list[dict]]: "action": "merge-onto", "commit_message": commit_message, "target": target, - "strategy": None, + "strategy": merge_strategy, } ] @@ -740,7 +742,7 @@ def push_merge( } ] else: - actions = detect_merge_from_current_head(local_repo) + actions = detect_merge_from_current_head(local_repo, merge_strategy) if not actions: click.echo("Could not create a `merge-onto` action from current HEAD.") return 1