dulwich-users team mailing list archive
-
dulwich-users team
-
Mailing list archive
-
Message #00518
Re: Using dulwich for merges and conflict detection
On Tue, Jun 7, 2011 at 3:53 PM, Jelmer Vernooij <jelmer@xxxxxxxxx> wrote:
> r = Repo("/path/to/repo")
> c = r[some_commit_id]
> print c.committer
> print c.author
> print c.message
> root_tree = r[c.tree]
> (where root Tree is a tree object)
>
> As dulwich doesn't include any merge infrastructure, your merge
> algorithm will have to take it from there.
>
Ok, so my merge algo compares head tree vs new commit tree to see if its
clean or do any merge changes if necessary.
I assume that if merges are clean I'm just going to need to point the base
ref to the last commit, the rest of the commits are already in order and
have parents[] ok.
But, If I have to merge, or change parents, I assume the sha of the commit
should change, how would this be handled? Say that I take the commit, I
modify the tree object of the commit and then I want to put it somewhere
else, so I modify commits parents[] as well, now I would need to calculate
the new sha1 and push it into the store with add_object(), do I need to push
the modified tree as well or it goes inside the Commit?
Thanks
Arkaitz
Follow ups
References