{"id":48509016,"url":"https://github.com/kthompson/jj-mediate","last_synced_at":"2026-04-07T17:01:30.703Z","repository":{"id":335758712,"uuid":"1146766335","full_name":"kthompson/jj-mediate","owner":"kthompson","description":"A port of https://github.com/Peaker/git-mediate/ to C# for use with Jujutsu VCS","archived":false,"fork":false,"pushed_at":"2026-02-09T21:26:40.000Z","size":50,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-10T01:10:37.143Z","etag":null,"topics":["conflict","git","jj","jujutsu","merge","resolution","vcs"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kthompson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-31T16:40:17.000Z","updated_at":"2026-02-01T00:28:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kthompson/jj-mediate","commit_stats":null,"previous_names":["kthompson/jj-resolve"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kthompson/jj-mediate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fjj-mediate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fjj-mediate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fjj-mediate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fjj-mediate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kthompson","download_url":"https://codeload.github.com/kthompson/jj-mediate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kthompson%2Fjj-mediate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31520577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conflict","git","jj","jujutsu","merge","resolution","vcs"],"created_at":"2026-04-07T17:01:29.631Z","updated_at":"2026-04-07T17:01:30.691Z","avatar_url":"https://github.com/kthompson.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jj-mediate\r\n\r\nA port of [git-mediate](https://github.com/Peaker/git-mediate/) to C# for use with [Jujutsu VCS](https://docs.jj-vcs.dev/).\r\n\r\n## What is it?\r\n\r\n`jj-mediate` helps you resolve merge conflicts intelligently. When you have a 3-way merge conflict (showing base, side A, and side B), it can:\r\n\r\n- **Auto-resolve trivial conflicts** where only one side changed\r\n- **Reduce complex conflicts** by removing matching lines from start/end\r\n- **Handle special cases** like indentation differences, line endings, and tabs\r\n\r\n## How it works\r\n\r\nGiven a diff3-style conflict:\r\n```\r\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c Side A\r\nModified by A\r\n||||||| Base\r\nOriginal\r\n======= Side B  \r\nModified by B\r\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e\r\n```\r\n\r\nThe algorithm detects:\r\n- If A == Base → use B (only B changed)\r\n- If B == Base → use A (only A changed)  \r\n- If A == B → use either (both made same change)\r\n\r\nFor complex conflicts, it finds matching prefix/suffix lines and removes them to simplify the conflict.\r\n\r\n## Installation\r\n\r\n### As a .NET Global Tool (Recommended)\r\n\r\n```bash\r\n# Install from NuGet\r\ndotnet tool install -g jj-mediate\r\n\r\n# Update to latest version\r\ndotnet tool update -g jj-mediate\r\n\r\n# Uninstall\r\ndotnet tool uninstall -g jj-mediate\r\n```\r\n\r\n### From Source\r\n\r\n```bash\r\ndotnet build -c Release\r\n# Binary will be in jj-mediate/bin/Release/net10.0/\r\n```\r\n\r\n## Development\r\n\r\n### Quick Start\r\n\r\nThe repository includes PowerShell scripts for common development tasks:\r\n\r\n```bash\r\n# Format code\r\n./format.ps1\r\n\r\n# Check code formatting (lint)\r\n./lint.ps1\r\n\r\n# Build project\r\n./build.ps1\r\n\r\n# Run tests\r\n./test.ps1\r\n\r\n# Run full CI pipeline locally (lint + build + test)\r\n./ci.ps1\r\n```\r\n\r\n**Script Options:**\r\n- `build.ps1 -Configuration Debug` - Build in Debug mode\r\n- `test.ps1 -Verbosity detailed` - Run tests with detailed output\r\n\r\n### Versioning\r\n\r\nThis project uses [Nerdbank.GitVersioning (nbgv)](https://github.com/dotnet/Nerdbank.GitVersioning) for automatic version management based on git history.\r\n\r\n```bash\r\n# Get current version\r\nnbgv get-version\r\n\r\n# Create a new version tag\r\ngit tag v1.0.0\r\ngit push origin v1.0.0\r\n\r\n# Prepare next version\r\nnbgv prepare-release\r\n```\r\n\r\nVersion numbers are automatically calculated from:\r\n- `version.json` base version\r\n- Git commit height\r\n- Git commit hash for pre-release versions\r\n\r\n### Testing\r\n\r\nRun unit tests:\r\n\r\n```bash\r\n# Run all tests\r\ndotnet test\r\n\r\n# Run with detailed output\r\ndotnet test --verbosity normal\r\n\r\n# Run in release mode\r\ndotnet test --configuration Release\r\n```\r\n\r\n### Linting\r\n\r\nThis project uses [CSharpier](https://csharpier.com/) for code formatting.\r\n\r\n```bash\r\n# Check formatting\r\ndotnet csharpier check .\r\n\r\n# Format code\r\ndotnet csharpier format .\r\n```\r\n\r\n### GitHub Actions\r\n\r\nThe project uses a unified CI/CD workflow (`.github/workflows/ci-cd.yml`) with multiple jobs:\r\n\r\n**On every push/PR:**\r\n- **build-and-test** - Builds and runs all tests\r\n- **lint** - Checks code formatting with CSharpier\r\n\r\n**On release:**\r\n- **publish-nuget** - Publishes the tool to NuGet.org (requires `NUGET_API_KEY` secret)\r\n- **publish-binaries** - Creates cross-platform binaries (win-x64, linux-x64, osx-x64, osx-arm64)\r\n- **create-release** - Attaches binary archives to the GitHub Release\r\n\r\nAll jobs use nbgv for automatic version management.\r\n\r\n### Dependabot\r\n\r\nDependabot is configured to automatically check for updates to:\r\n- NuGet packages (weekly)\r\n- GitHub Actions versions (weekly)\r\n\r\n## Usage\r\n\r\n```bash\r\n# Resolve conflicts in current jj repository\r\njj-mediate\r\n\r\n# Resolve specific file\r\njj-mediate path/to/conflicted-file.cs\r\n```\r\n\r\n## Options\r\n\r\n- `--trivial` - Only resolve trivial conflicts (one side changed)\r\n- `--reduce` - Reduce conflicts by removing common prefix/suffix\r\n- `--indentation` - Handle indentation-only differences\r\n- `--added-lines` - Detect lines added by both sides\r\n- `--line-endings` - Normalize line endings (CRLF/LF)\r\n- `--untabify \u003cwidth\u003e` - Expand tabs to spaces\r\n- `--split-markers` - Split conflicts on `~~~~~~~` separators\r\n- `--show-diffs` - Show diffs from base version\r\n- `-e, --editor` - Open editor on remaining conflicts\r\n\r\n## Example\r\n\r\n```bash\r\n$ jj status\r\n...\r\nfile.cs (conflicted)\r\n...\r\n\r\n$ jj-mediate\r\nfile.cs: Successfully resolved 3 conflicts (failed to resolve 1 conflict)\r\n\r\n$ jj status\r\n...\r\nfile.cs (conflicted)  # Still has 1 unresolved conflict\r\n...\r\n```\r\n\r\n## Differences from git-mediate\r\n\r\n- Uses `jj` commands instead of `git` \r\n- Focused on conflict resolution (core algorithm)\r\n- No delete/modify conflict handling (Jujutsu handles this differently)\r\n- Native C# / .NET instead of Haskell\r\n\r\n## License\r\n\r\nGPL-2.0 (same as original git-mediate)\r\n\r\nThis program is free software; you can redistribute it and/or modify\r\nit under the terms of the GNU General Public License as published by\r\nthe Free Software Foundation; version 2 of the License only.\r\n\r\nSee the [LICENSE](LICENSE) file for the complete license text.\r\n\r\n## Credits\r\n\r\nBased on [git-mediate](https://github.com/Peaker/git-mediate/) by Eyal Lotem.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkthompson%2Fjj-mediate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkthompson%2Fjj-mediate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkthompson%2Fjj-mediate/lists"}