berry icon indicating copy to clipboard operation
berry copied to clipboard

[Bug?]: `yarn install` conflict resolution does not in non-git repositories

Open proyectoramirez opened this issue 1 year ago • 2 comments

Self-service

  • [ ] I'd be willing to implement a fix

Describe the bug

Running yarn install to resolve conflicts works in non-git repositories (in my case, mercurial) works in yarn 3. When updating to yarn 4, this stops working, since after #5046 yarn relies on git commands to resolve conflicts.

Some ideas:

  • Reintroduce the old behavior as a fallback
  • Attempt to use hg when git is unavailable
  • Document that this feature is intended to require a git repo

To reproduce

yarn install on a mercurial repository with conflicts in yarn.lock

Environment

System:
    OS: macOS 14.4.1
    CPU: (16) arm64 Apple M3 Max
  Binaries:
    Node: 18.19.0
    Yarn: 3.6.0
    npm: 10.2.3

Additional context

No response

proyectoramirez avatar Jun 13 '24 18:06 proyectoramirez

We don't plan to support non-git repositories in places where CVS are integrated. We used to consider having some level of indirection which would eventually allow implementing actions for different CVS, but noone actually needed that in the past four years and it'd be too large of a work to be worthwhile.

Reintroduce the old behavior as a fallback

I don't think this would be possible; our philosophy is to do the good thing by default and report an error if we can't do it (rather than do something unsafe or let you go into an unmaintained codepath).

arcanis avatar Jun 13 '24 22:06 arcanis

Noted! I understand how focusing on git repos is probably the more impactful solution (as opposed to maintaining an abstraction). I also agree that sending the user to unsafe behaviors is not ideal.

Short of supporting hg, I would suggest providing clearer guidance to the user on what to do when they hit a git-only workflow. I would also support #5787, which asks for including this functionality in the yarn docs.

proyectoramirez avatar Jun 18 '24 15:06 proyectoramirez

Hi! 👋

It seems like this issue as been marked as probably resolved, or missing important information blocking its progression. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it.

yarnbot avatar Jul 18 '24 16:07 yarnbot