Skip to content

fix(graph): Gracefully handle squash-merges #80

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

Merged
merged 11 commits into from
Oct 8, 2021
Merged

fix(graph): Gracefully handle squash-merges #80

merged 11 commits into from
Oct 8, 2021

Conversation

epage
Copy link
Collaborator

@epage epage commented Oct 8, 2021

Before, when doing a git-stack --pull, we'd rebase the merged branch
onto master. git would the automatically detect the commit is merged
and drop it. We'd then associate the branch name with the same commit
master points to and have to delete it manually.

This tries to detect that case so we can automatically delete the stale
branch on behalf of users.

This does not help if your branch is behind master because those extra
commits will impact how we are detecting this case (tree id).

This is a spiritual revert of 80f5158,
re-implementing 892117b to handle all
of our changes and with a little more experience and context.

This is a part of #28.

epage added 8 commits October 8, 2021 12:52
So it looks like tree ID is the same if the file contents are exactly
the same but the commit metadata is different.  This is rare but useful.
Before, when doing a `git-stack --pull`, we'd rebase the merged branch
onto master.  `git` would the automatically detect the commit is merged
and drop it.  We'd then associate the branch name with the same commit
master points to and have to delete it manually.

This tries to detect that case so we can automatically delete the stale
branch on behalf of users.

This does not help if your branch is behind master because those extra
commits will impact how we are detecting this case (tree id).

This is a spiritual revert of 80f5158,
re-implementing 892117b to handle all
of our changes and with a little more experience and context.

This is a part of #28.
@epage epage merged commit 0e7dc42 into main Oct 8, 2021
@epage epage deleted the squash branch October 8, 2021 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant