Skip to content

Sync: allow fast-forward on checkout #1449

@josephjclark

Description

@josephjclark

We get an invalid divergence warning right now when trying to fast-forward the local workflow to reflect the app. Here's the deal:

  • I pull the project so it's checked out locally
  • I change something remotely
  • I pull again
  • divergence warning! Because the CLI compares the incoming workflow to the thing expanded on disk, and they are not the same

The problem is that checkout doesn't really understand a fast-forward. It just sees there's a change. It should be quite happy to understand the the local version is just behind the remote one, and do it.

where this gets tricky is that when we fetch from the app, the version history may have been squashed. SO we get one new version from the app which isn't anywhere locally (and so we can't history compare it properly)

So it should be like:

  • When we fetch, we keep the version history and only add new states
  • When we checkout, if the head version of the active workflow is in the history of the incoming workflow, that's a fast forward and we checkout without warning
  • We can prune version histories by finding any local version that is not referenced elsewhere locally

The answer is think is that the local project must keep all local histories it needs, and add new histories from the app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    New Issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions