Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backports failing due to missing --mainline option on git cherry-pick #91

Open
Neudrino opened this issue Aug 12, 2022 · 3 comments
Open

Comments

@Neudrino
Copy link

Context

I have been testing the backport action on Neudrino/magma#6 with the run https://github.com/Neudrino/magma/runs/7803925676?check_suite_focus=true.

Problem

The run fails with

Backporting to backport/v1.8 on backport-6-to-backport/v1.8.
  /usr/bin/git switch backport/v1.8
  Switched to a new branch 'backport/v1.8'
  branch 'backport/v1.8' set up to track 'origin/backport/v1.8'.
  /usr/bin/git switch --create backport-6-to-backport/v1.8
  Switched to a new branch 'backport-6-to-backport/v1.8'
  /usr/bin/git cherry-pick -x c2379e2d74ebfe72ca90610dda32aa0a68e44f48
  error: commit c2379e2d74ebfe72ca90610dda32aa0a68e44f48 is a merge but no -m option was given.
  fatal: cherry-pick failed
  /usr/bin/git cherry-pick --abort
  error: no cherry-pick or revert in progress
  fatal: cherry-pick failed
  Error: Error: The process '/usr/bin/git' failed with exit code 128

Expected behaviour

The action should work for merged commits.

Additional information

To me it seems as if
https://github.com/tibdex/backport/blob/main/src/backport.ts#L106
is missing the --mainline 1 option. Interestingly, it is given in the error description correctly:
https://github.com/tibdex/backport/blob/main/src/backport.ts#L167

@tvdeyen
Copy link

tvdeyen commented Aug 15, 2023

@tvdeyen
Copy link

tvdeyen commented Aug 15, 2023

Fun fact: In your error template you use the missing command line option in the example.

`git cherry-pick -x --mainline 1 ${commitSha}`,

Is there a reason why you are not using that in your action as well?

@tvdeyen
Copy link

tvdeyen commented Aug 15, 2023

Switched to https://github.com/sqren/backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants