question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Backport commits in PR instead of merge commit

See original GitHub issue

Currently when one runs

backport --pr 123

it seems that the tool searches for the merge commit that merged PR 123 into the master branch and then (I assume) it backports that merge commit.

This approach has two drawbacks:

  1. It’s only possible to backport PRs that have already been merged
  2. It (presumably) does not allow for an easy way to backport the individual commits of a PR

To 1): We have a few CI runs that take a while to complete and sometimes I already know that I want to backport a PR before these checks have completed (and thus before we have merged the PR). In that case it’d be nice if I could already create the backport PR in order to give its checks a bit of a headstart so I don’t have to wait that long for them to complete after having merged the original PR.

To 2): We don’t backport merge commits. Instead we cherry-pick the commits of a particular PR on the backport branch and then create a PR from that. It would be nice if there was an easy way to automate this process using the backport tool. (If that is already possible, please let me know how)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Krzmbrzlcommented, Mar 22, 2022

Sorry for not having gotten back to you earlier. Just wanted to let you know that this now seems to work like charm 👍

1reaction
sqrencommented, Feb 16, 2022

I’ve published a beta version of backport that will allow you to backport all the commits in the PR instead of the merge commit:

npm install backport@7.2.0-beta.1

Please try it out and let me know how it goes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I backport a commit in git? - Stack Overflow
I like how the linked post explains adding multiple commits that may conflict. Merge feature A with Bug fix B together, prior to...
Read more >
From zero to hero on backporting pull requests - Quarkus
... team starts backporting commits from pull requests that were merged in the master branch. How do they know which pull request to...
Read more >
Backporting - ownCloud Documentation
The merge commit includes all PR sub commits to be backported. With that, no individual sub commit backporting is necessary. The following example...
Read more >
Backport process - gists · GitHub
Backport process · Identify the change to backport. · Find the corresponding merge to master and inspect the pull request. · Create a...
Read more >
What is the difference between a merge commit & a squash?
This merge commit combines the parent commits located directly after the most recent common commit on both the current branch and the branch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found