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

Git rebase during pull #115

Open
frothga opened this issue Feb 20, 2021 · 0 comments
Open

Git rebase during pull #115

frothga opened this issue Feb 20, 2021 · 0 comments

Comments

@frothga
Copy link
Collaborator

frothga commented Feb 20, 2021

Currently, the code sets the rebase flag when doing a pull. However, replaying commits using git's own machinery could produce incorrect results. It would be better to replay the commits using special knowledge of our data structure. This would only become an issue if the user creates commits while offline, since the system tries to prevent a branch from forming while online. That is, pulls will generally be fast-forward.

Instead of pull, the procedure would be:

save stash
fetch master
LCA = merge-base (HEAD, master)
local = HEAD  # "local" is a temporary reference to remember HEAD
checkout master  # HEAD moved to master
for LCA...local   # This could be empty, in which case it is a fast-forward
  replay commit using n2a diff, and using working tree to assemble
apply stash
dead branch can be garbage collected later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant