jelmer / dulwich

Pure-Python Git implementation
https://www.dulwich.io/
Other
2.06k stars 395 forks source link

pocelain does not merge updates into working trees #452

Open Salamafet opened 8 years ago

Salamafet commented 8 years ago

When a file is removed from repository, the dulwich.pull command does not remove the file from local storage.

When I add a file in repository, the file is correctly downloaded.

I have try with admin right but doesn't work.

jelmer commented 8 years ago

On Mon, Sep 05, 2016 at 06:49:26AM -0700, Stéphane wrote:

When a file is removed from repository, the dulwich.pull command does not remove the file from local storage.

When I add a file in repository, the file is correctly downloaded.

I have try with admin right but doesn't work.

Dulwich currently doesn't do any merging, including merges that affect the working tree.

sheluchin commented 5 years ago

Dulwich currently doesn't do any merging, including merges that affect the working tree.

@jelmer Is this still the case?

jelmer commented 5 years ago

Yes, this limitation still exists. I'm keen to get this fixed before 0.20.

On 23 January 2019 15:51:13 GMT, Alex Sheluchin notifications@github.com wrote:

Dulwich currently doesn't do any merging, including merges that affect the working tree. @jelmer Is this still the case?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dulwich/dulwich/issues/452#issuecomment-456853995

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

laneb commented 5 years ago

"Merge" here refers to the update to WD+index after a clean merge, checkout, etc., correct? I.e. the WD+index reflected tree T0 and we want to update WD+index to reflect T1. I think this operation can be implemented naively as

  1. Assert index matches T0
  2. Assert T1 contains no blob at the same path as an untracked file in WD
  3. Remove all files tracked in T0 from WD
  4. Write all files tracked in T1 to WD
  5. Rebuild index from T1

@jelmer Does that seem correct? Not sure what the gotchas here are.

jelmer commented 5 years ago

No, it refers to a three-way merge. You're describing a fast-forward operation, which would also be useful to implement but is different.

laneb commented 5 years ago

Oh duh 🤦‍♂️Yes I was only considering the fast-forward scenario. Makes sense that WD cannot be updated until after 3-way merge. Once that's complete and the ref is updated to point to the merge commit, the operation I described can be applied.

jelmer commented 5 years ago

The merge has to be applied in the working directory, rather than as a commit. This is because there can be conflicts.

On 22 February 2019 01:39:15 GMT-08:00, Lane Barlow notifications@github.com wrote:

Oh duh 🤦‍♂️Yes I was only considering the fast-forward scenario. Makes sense that WD cannot be updated until after 3-way merge. Once that's complete and the ref is updated to point to the merge commit, the operation I can be applied. >

-- > You are receiving this because you were mentioned.> Reply to this email directly or view it on GitHub:> https://github.com/dulwich/dulwich/issues/452#issuecomment-466336106

kevinhendricks commented 2 years ago

Is there any update on this? Would it help in any way to take the Sigil dulwich repo with its preliminary merge code from about 2 years ago and update it to current dulwich? Is there anything I can do to help get basic merge working the way you want?