#changesets merge

1 messages ยท Page 1 of 1 (latest)

flat belfry
#

IMO we never want file-level granularity - once we have chunk-level granularity, PREFER_OURS and PREFER_THEIRS just indicate how conflicts are resolved, not which changed file we select, and if there are no conflicts that's perfectly valid

#

Side question: is creating an empty git repo necessary? I remember playing with git apply and git diff and they also work just fine out-of-repo

#

Not 100% sure I interpreted the original message right so elaborating: I guess what I'm saying is onConflict to me means individual change conflicts, not file conflicts, which is I guess what it meant before. thinkies Basically it feels wrong to have an API that will lose changes from the inputs - they should either be merged cleanly, or leave merge conflicts, or the call should error (if no other option provided)

mighty patio
#

I quite like the file-level granularity, especially when applied on generators. The thing is you can have two changes on a same file that can be applied without conflict but the resulting file might be bad. So for generators I like to fail if a file is touched by multiple changesets. But I can be wrong.
One solution we just discussed is to remove the file level granularity except for fail, so to have the following strategies:

  • leave conflict markers
  • prefer ours / prefer theirs
  • fail
  • fail early (that's the one that will fail if a file is modified in both changesets)
#

--ours and --theirs require --3way that requires to have access to the blobs, so a git repo. At least that's my understanding

#

that would look like this:

  | Strategy               | Pre-check         | Git flags | Modify/Delete                                       | Binary conflict |
  |------------------------|-------------------|-----------|-----------------------------------------------------|-----------------|
  | FAIL_EARLY             | Fail if conflicts | N/A       | N/A                                                 | N/A             |
  | FAIL                   | No                | None      | Fail                                                | Fail            |
  | LEAVE_CONFLICT_MARKERS | No                | None      | Keep modified                                       | Fail            |
  | PREFER_OURS            | No                | -X ours   | Delete (our removal) or keep (our modification)     | Auto-resolved   |
  | PREFER_THEIRS          | No                | -X theirs | Delete (their removal) or keep (their modification) | Auto-resolved   |
flat belfry
flat belfry
#

thinking on FAIL_EARLY - I don't have a good handle on how often that'll come up, but it seems like a reasonable knob notsureif

#

like you're specifically saying even if there are no conflicts, because you're worried about "semantic" conflicts etc?

mighty patio
#

side question: does that make sense to use gitutil.GitCLI to run git commands instead of exec.Command?

mighty patio
flat belfry
mighty patio
hot vapor
mighty patio
#

If you have some cycle I'd love to have your feedback on the actual version @flat belfry
I think it covers a lot of different cases, but it ended up effectively with something more complex than I expected at the beginning

flat belfry