-
Notifications
You must be signed in to change notification settings - Fork 717
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
Add Merge method #942
Comments
Implementing the merge feature in go-git is not an easy task; currently, there is no suitable implementation of the diff3 algorithm in Golang. The few diff3 implementations that exist each have their own problems: nasdf/diff3 relies on github.com/sergi/go-diff just like go-git, but unfortunately, sergi/go-diff is currently erroneous. Meanwhile, epiclabs-io/diff3 is a reimplementation of node-diff3, based on the LCS algorithm; however, it is regrettable that the LGPL 3.0 licensing agreement may not be a good choice. The maintainer of libgit2, Edward Thomson, has separated the diff3 implementation of git into the libgit2/xdiff project. This implementation has better compatibility with git and can be used with cgo or be rewritten in Golang, though this is also a significant undertaking. In summary, implementing the merge functionality in go-git still presents some challenges; beyond the diff3 algorithm, there are many details that need to be addressed. CC: @pjbgf |
Please make it possible to create merge commit without diff3 functionality. Leave the task of filling the commit to the program code. Just need to make a method that creates a new commit based on 2 parent ones and function that will be called for the merge files |
Somehow this project has
fetch
andpull
, but missingmerge
?FWIW,
pull
is afetch
immediately followed bymerge
, so how was thepull
implemented in the first place?For my case:
I am running in-memory bare repo clone. Periodically I need to fetch updates for it and check the state of the file in repository. On bare repo this should be:
git fetch origin master
git merge origin/master master
head -> tree -> file object -> check contents
However in the absence of merge functionality I have to:
.Reference("refs/remotes/origin/HEAD")
instead of just.Head()
The text was updated successfully, but these errors were encountered: