Skip to content

Git rebase during pull #115

@frothga

Description

@frothga

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions