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

Update local stage to have same base as remote #5

Open
dankox opened this issue Dec 30, 2019 · 2 comments
Open

Update local stage to have same base as remote #5

dankox opened this issue Dec 30, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dankox
Copy link
Owner

dankox commented Dec 30, 2019

Update to local stage, commit, push, to have the same base (rsha1/bsha1) as remote stage.

Main reason for it is that there is a problem when merge is done on stage/index which has several commits on the same file, the base version will be incorrect (it could have previous version which was committed but not pushed and is not common with remote).

This will change commits more to a stage area or save than git-like commits. Will make it easier for merging different stages too.

Proposed solution:
When commit is done, only lsha1 is updated.
If merge was executed before (MERGE exists), base sha1 will be updated only if index from MERGE has the same stage name as local stage. This guarantee that when merge from different stage (e.g.: production with base level 100) is done, it won't copy the base from it.

Base sha1 on remote and local should be the same. If changed on remote, it will be updated during merge/commit.

Push confirms the fingerprints and afterwards check differences between local and remote stage lsha1. Different ones are pushed.

@dankox dankox self-assigned this Dec 30, 2019
@dankox dankox added the enhancement New feature or request label Dec 30, 2019
@dankox
Copy link
Owner Author

dankox commented Dec 31, 2019

@dankox
Copy link
Owner Author

dankox commented Jan 30, 2020

New proposal is, to have base sha1 in local stage being the same as last sha1 in remote stage (for the same stage). This way the three way merge will have better precision and will not cause same changes appear in both local and remote version.

For every commit, only last sha1 is updated.
When push is done, base sha1 will be updated to reflect remote last sha1 (basically, moving last sha1 into base sha1 on local and updating last sha1 on remote).

For merge between different stages, remote base sha1 will be taken as a base for 3-way merge.

TL;DR base sha1 in local stage is updated only for push, or commit-merge (commit when MERGE file exists).

Note: still need to think about edge cases, like when you have file on local and element on remote is totally removed and new version is created from different base. need some sync mechanic.

@dankox dankox added this to the version 0.5 milestone Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant