Hello and thanks for reading,
I've a Redis pull request that no longer applies because, for example, one line where there was a < b
is now a > b
,
otherwise the patch would apply cleanly.
if I try to cherry pick the commit and resolve the conflicts, it works, it's just a lot of useless work editing the conflicting code to merge properly and there is even the risk of making mistakes.
An alternative is to:
- Modify back the source code to
a < b
with a commit called FOO. - Apply the pull request commit cleanly with cherry pick.
- Revert to
a > b
and amend the commit to make the change.
However this way I've the spurious commit FOO. If I rebase with rebase -i
and squash the commit, the PR author name is removed from the history, which is very unfortunate. Is there a better alternative? Thanks in advance.
It's not super elegant, but maybe you can use the
GIT_AUTHOR_X
env variables to set the authorship?Starting with the series of commits you've described (revert, cherry pick, revert-the-revert), I think this does it:
This leaves the
pr
branch with one commit in it, and it's marked as being authored by the original committer.