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

chore: fix git history by unsquashing previous merge commit #13742

Merged
merged 0 commits into from
Mar 23, 2021

Conversation

njlynch
Copy link
Contributor

@njlynch njlynch commented Mar 22, 2021

The forward merge #13414 was erroneously squash-merged, resulting in some defects in the future forward merges. In particular, #13426 was dropped, un-reverting the commit and causing issues. There were also some test changes from #13462 that appeared to be dropped.

This change will need to be force-pushed to be applied. Open to folks telling me this is a Bad Idea and shouldn't be done.

Approach taken:

git fetch origin
git checkout -B v2-main origin/v2-main
# Interactive rebase, preserving merges, on the commit prior to the squashed merge.
git rebase -i --rebase-merges 278fba5df4a3d785e49bdb57ccf88fd34bacacbb 
# In the interactive mode, found the squashed merge commit and marked it as "edit"
# Wipe out the squashed merge commit
git reset --hard HEAD^
# Merge the last commit from the PR #13414
git merge 28e2dde64e88504cf1b06ce8be0b9b678278df07 --no-edit
# Iteratively run `git rebase --continue`, fix merge conflicts, and repeat.

At the end, running git diff origin/v2-main shows that #13426 has been re-picked up and applied correctly, and a few other minor merge conflict changes have been made.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Mar 22, 2021

@njlynch njlynch requested a review from a team March 22, 2021 18:10
@njlynch njlynch self-assigned this Mar 22, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 22, 2021
@njlynch
Copy link
Contributor Author

njlynch commented Mar 22, 2021

Worth noting the diff here is useless, so this PR is more or less just a review of the idea and approach.

You can run git diff origin/v2-main origin/njlynch/force-v2-main-fix to see the diff yourself, or see it in this gist: https://gist.github.com/njlynch/df6a793bea9124952daa042be86dac09

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 381520f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

njlynch added a commit that referenced this pull request Mar 23, 2021
The forward merge #13414 was erroneously squash-merged, resulting in some
defects in the future forward merges. In particular, #13426 was dropped,
un-reverting the commit and causing issues. There were also some test changes
from #13462 that appeared to be dropped.

This PR fixes the issue by just directly applying a patch to v2-main that solves
the difference between the current v2-main and what we'd have if we un-squashed
the squashed merge-commit and replayed all commits after that.

This is an effective duplicate of #13742, except that this is a clean patch that
can be applied, whereas the other is a rebased branch that will need to be
force-pushed to be applied.
@njlynch njlynch added the pr/do-not-merge This PR should not be merged at this time. label Mar 23, 2021
@njlynch
Copy link
Contributor Author

njlynch commented Mar 23, 2021

Current v2-main HEAD is a0b1c3cd174d62eb3efdabc00c700e5dce2fbff3.
Proposed new HEAD is 381520f56249f2ac28f1589b5bd418a5f0781a1e.

@njlynch njlynch merged commit 381520f into v2-main Mar 23, 2021
@njlynch njlynch deleted the njlynch/force-v2-main-fix branch March 23, 2021 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. pr/do-not-merge This PR should not be merged at this time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants