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

When cherry-pick conflict cannot be resolved #97

Closed
Yaminyam opened this issue Feb 22, 2024 · 2 comments
Closed

When cherry-pick conflict cannot be resolved #97

Yaminyam opened this issue Feb 22, 2024 · 2 comments
Labels
question Further information is requested

Comments

@Yaminyam
Copy link

It seems that there are cases where the conflict cannot be resolved with git cherry-pick -m 1 --strategy=recursive --strategy-option=theirs.
What I have experienced is that in the case of a commit that modifies a file that does not yet exist in the branch to be backported, a conflict occurs even with the theirs option.
How do you behave or handle these cases?

@lampajr
Copy link
Member

lampajr commented Feb 23, 2024

Hi @Yaminyam, thanks for raising this question!

The limitation of this tool actually matches the limitation of the cherry-pick git command when talking about conflicts resolution, I tried to make the toolt as configurable and flexible [1] as possible such that you can set the merge strategy that fits better your use case (from those listed in the git documentation [2]).

Given that, if you are in a situation where an automated conflict resolution cannot be applied the only way I can see it is to consider that as an outlier, i.e., in such cases we were used to manually create the cherry-picked pull/merge request.

So my suggestion is to use the default merge strategy that works better for most of your use cases and change it for those cases where that was not good enough (or use the manual/raw approach to cherry-pick that commit(s)).

I hope I have fully answered your question, if not feel free to add more details 🚀

[1] https://github.com/kiegroup/git-backporting?tab=readme-ov-file#default-cherry-pick-strategy
[2] https://git-scm.com/docs/git-cherry-pick#Documentation/git-cherry-pick.txt---strategyltstrategygt

@lampajr lampajr added the question Further information is requested label Feb 23, 2024
@Yaminyam
Copy link
Author

Thank you for your kind reply.
I am also implementing backport automation, and I asked this question because I thought you would be familiar with it because I have experienced related problems.
If cherry-pick fails, I'm thinking of handling it manually by leaving a comment in the original pr.

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

No branches or pull requests

2 participants