{"id":22615731,"url":"https://github.com/polyvariant/scala-git-markers","last_synced_at":"2025-08-05T17:32:12.057Z","repository":{"id":65509689,"uuid":"564011746","full_name":"polyvariant/scala-git-markers","owner":"polyvariant","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-09T20:36:06.000Z","size":12,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-05-25T23:42:16.035Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/polyvariant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-09T20:02:15.000Z","updated_at":"2022-12-07T03:26:27.000Z","dependencies_parsed_at":"2023-01-26T17:31:21.249Z","dependency_job_id":null,"html_url":"https://github.com/polyvariant/scala-git-markers","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fscala-git-markers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fscala-git-markers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fscala-git-markers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polyvariant%2Fscala-git-markers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polyvariant","download_url":"https://codeload.github.com/polyvariant/scala-git-markers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228779141,"owners_count":17971086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-08T19:09:14.553Z","updated_at":"2024-12-08T19:09:15.475Z","avatar_url":"https://github.com/polyvariant.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scala-git-markers\n\nThe worst Scala library you've seen.\n\n## What is this???\n\nThis is a realization of a cursed idea based on [this tweet](https://twitter.com/kubukoz/status/1590135952886075393) and [this video](https://www.youtube.com/watch?v=rSk_mea4U1E).\n\n## Usage\n\nIn sbt:\n\n```scala\nlibraryDependencies += \"org.polyvariant\" %% \"scala-git-markers\" % \"0.1.0\"\n// For Scala.js, Scala Native\nlibraryDependencies += \"org.polyvariant\" %%% \"scala-git-markers\" % \"0.1.0\"\n```\n\n```scala\nimport org.polyvariant.gitmarkers._\n```\n\nNow, whenever you see git's conflict markers, for example:\n\n```scala\nval example = (\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD\n\"foo\"\n=======\n\"baz\"\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e bar\n)\n```\n\nyou **might** be able to compile your code! Just make sure you define a value for the second ref you're merging (in this case, `bar`):\n\n```scala\nval bar = \"bar\"\n```\n\nnow you can do this:\n\n```scala\nexample.describe\n//   Found conflict:\n// - First ref: HEAD\n//   Value: foo\n// - Second ref: bar\n//   Value: baz\n```\n\n## How does this work???\n\nScala allows you to define symbolic methods. Additionally, you can add extension methods.\nThe video linked above explains this in more detail.\n\nThe desugared form of the conflict above looks similar to this:\n\n```scala\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c.HEAD(\"foo\".=======(\"baz\".\u003e\u003e\u003e\u003e\u003e\u003e\u003e(bar)))\n```\n\nthe rest is done by this library.\n\n## Limitations\n\nThis will only work in certain situations, most likely: whenever the conflict encapsulates a simple:\n\n- parameter of a function, or\n- expression in parentheses, or\n- free-standing expression/statement in Scala 3 or under `-Xsource:3` in Scala 2.13.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyvariant%2Fscala-git-markers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolyvariant%2Fscala-git-markers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolyvariant%2Fscala-git-markers/lists"}