Skip to content

Add opt-in text conflict automerge#934

Open
msexxeta wants to merge 1 commit into
opencloud-eu:mainfrom
msexxeta:codex/text-conflict-automerge
Open

Add opt-in text conflict automerge#934
msexxeta wants to merge 1 commit into
opencloud-eu:mainfrom
msexxeta:codex/text-conflict-automerge

Conversation

@msexxeta

@msexxeta msexxeta commented Jun 5, 2026

Copy link
Copy Markdown

Context

Follow-up for https://github.com/orgs/opencloud-eu/discussions/2891.

This adds an opt-in client-side automerge path for text-file sync conflicts. The companion Craft dependency PR is opencloud-eu/craft-blueprints-opencloud#6.

Changes

  • Add a persisted autoMergeTextConflicts setting and checkbox in General Settings.
  • Add localized strings for the new setting across the existing desktop translation catalogs.
  • Add libgit2 discovery/linking for libsync.
  • Add a text conflict automerge helper that:
    • only runs for enabled text-file conflicts with a valid synced base journal record;
    • uses the server versions endpoint for the prior synced base version;
    • performs a three-way merge with libgit2 using Qt text-mode I/O for platform newline handling;
    • falls back to the existing conflicted-copy behavior when merge setup or merge execution fails.
  • Wire the automerge attempt into the conflict download path before the normal conflict-copy fallback.

Verification

  • Enabled the setting in the active local config and confirmed autoMergeTextConflicts=true.
  • Used a logged-in OpenCloud web UI session only as an auth source for WebDAV verification; no discussion post was made.
  • Provoked a real sync conflict on Codex Sync Tests/automerge-webui-20260605-1327.txt:
    • base synced first;
    • local edit changed line 3;
    • remote WebDAV edit changed line 1;
    • client log showed Automatically merged text conflict;
    • no conflicted copy was created for that successful test;
    • local file and authenticated WebDAV GET both returned:
remote line 1
base line 2
local line 3
  • Rebuilt translations with lrelease; updated .qm generation completed successfully.
  • Cleaned the local Craft opencloud/opencloud-desktop build tree and blueprint __pycache__, then rebuilt through Craft with the repo .craft.ini plus workflow override using -i --install-deps --compile --install.
  • CMake configure found required LibGit2 from the Craft prefix.
  • Craft compile completed successfully (450/450), install succeeded, and qmerge succeeded.
  • Verified the qmerged OpenCloudLibSync.dll depends on git2.dll with dumpbin /dependents.

@msexxeta

Copy link
Copy Markdown
Author

I have had this running for a few days now and noticed a memory leak, just fyi. I will investigate and attempt to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant