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

no-squash: true cherry-picks commits in the wrong order #114

Closed
earl-warren opened this issue Apr 1, 2024 · 2 comments · Fixed by #115
Closed

no-squash: true cherry-picks commits in the wrong order #114

earl-warren opened this issue Apr 1, 2024 · 2 comments · Fixed by #115
Labels
bug Something isn't working

Comments

@earl-warren
Copy link
Contributor

It applies the latest commit first intead of the last, which can lead to conflicts when two commits modify the same file.

To Reproduce
Steps to reproduce the behavior:

  1. create a PR with two commits that modify the same line in a file
  2. have git-backport try a backport with no-squash
  3. see that it fails with a conflict

Expected behavior
It applies the commits in the right order instead and does not confict

Additional context

https://codeberg.org/forgejo/forgejo/actions/runs/10410#jobstep-5-31 is an example where that happened. Manually applying the same commits in the right order do not lead to conflicts.

@earl-warren earl-warren added the bug Something isn't working label Apr 1, 2024
@earl-warren
Copy link
Contributor Author

I'll work on a fix now.

earl-warren added a commit to earl-warren/git-backporting that referenced this issue Apr 1, 2024
earl-warren added a commit to earl-warren/git-backporting that referenced this issue Apr 1, 2024
earl-warren added a commit to earl-warren/git-backporting that referenced this issue Apr 1, 2024
earl-warren added a commit to earl-warren/git-backporting that referenced this issue Apr 1, 2024
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue Apr 1, 2024
@lampajr
Copy link
Member

lampajr commented Apr 2, 2024

Good catch, I can confirm that commits are applied in the wrong order (LIFO workflow) whereas the correct order should follow FIFO mechanism.

earl-warren added a commit to earl-warren/git-backporting that referenced this issue Apr 2, 2024
lampajr pushed a commit that referenced this issue Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants