Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Is fast-forward correct? #3852

Open
aboodman opened this issue Jul 29, 2019 · 0 comments
Open

Is fast-forward correct? #3852

aboodman opened this issue Jul 29, 2019 · 0 comments

Comments

@aboodman
Copy link
Contributor

It doesn't look like it to me.

It's only checking whether the incoming commit is taller than the existing commit. It doesn't check the ancestry at all. So committing x<-y<-z on top of a<-b would succeed. Worse, the ref height takes into account the entire chunk hierarchy including values, not just the commits. So committing something like x on top of a<-b<-c would also work if x contains a chunk hierarchy that is bigger than c's.

https://github.com/attic-labs/noms/blob/master/go/datas/database_common.go#L121

	if ok && newHeadRef.Height() <= currentHeadRef.Height() {
		return ErrMergeNeeded
	}

In order to implement fast-forward correctly, we must know all commits refs that are reachable from a given commit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant