From 0ce892ff26619c1314db4577938c4d4b2bff4cc0 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Sat, 30 Mar 2024 10:26:20 +0100 Subject: [PATCH] docs: explain the strategy equivalent to the cherry-pick defaults --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 44e220e..e999d8a 100644 --- a/README.md +++ b/README.md @@ -74,14 +74,24 @@ By default the tool will try to cherry-pick the single squashed/merged commit in Based on the original pull request, creates a new one containing the backporting to the target branch. Note that most of these information can be overridden with appropriate CLI options or GHA inputs. -#### Default cherry-pick strategy +#### cherry-pick strategy The default cherry-pick strategy is `recursive` with `theirs` option for automatic conflicts resolution. Therefore, by default, all commits are cherry-picked using the following git-equivalent command: ```bash $ git cherry-pick -m 1 --strategy=recursive --strategy-option=theirs ``` -From version `v4.2.0` we made both `strategy` and `strategy-option` fully configurable from CLI or GitHub action, so if users need a specific strategy which differs from the default one please consider using either `--strategy` or `--strategy-option`, or their equivalent GitHub action inputs, more details in [inputs](#inputs) section. +From version `v4.2.0` both can be configured via the `strategy` or `strategy-option` inputs if using the action and the `--strategy` or `--strategy-option` arguments if using the CLI. + +The [default strategy](https://git-scm.com/docs/git-merge#Documentation/git-merge.txt--sltstrategygt) of the `git-cherry-pick` command is different from the defaults of `git-backporting`. +```bash +$ git cherry-pick -m 1 +``` +is the same as: +```bash +$ git cherry-pick -m 1 --strategy=ort --strategy-option=find-renames +``` +If there is a conflict the backport will fail and require manual intervention. > **NOTE**: If there are any conflicts, the tool will block the process and exit signalling the failure as there are still no ways to interactively resolve them. In these cases a manual cherry-pick is needed, or alternatively users could manually resume the process in the cloned repository (here the user will have to resolve the conflicts, push the branch and create the pull request - all manually). @@ -304,4 +314,4 @@ Every change must be submitted through a *GitHub* pull request (PR). Backporting ## License -Git backporting open source project is licensed under the [MIT](./LICENSE) license. \ No newline at end of file +Git backporting open source project is licensed under the [MIT](./LICENSE) license.