Repository navigation
Dealing with yarn.lock conflicts #10007
|
Has anyone come up with a clean way of dealing with yarn.lock conflicts? Yarn itself tries to resolve the conflict using git commit data, but that obviously doesn't work with jj conflict markets (and I don't want to switch to git ones as they're just not as nice IMO). This leads to |
Replies: 1 comment 1 reply
|
The git-commit-data part is Yarn Berry's auto-merge: it reads the commit IDs from the conflict markers and asks git for both versions of the lockfile. Even if you switch to git-style markers ( What works for me is to not merge the lockfile at all: resolve jj resolve --tool :ours yarn.lock
yarn install
[aliases]
yarn-lock = ["util", "exec", "--", "sh", "-c", "jj resolve --tool :ours yarn.lock && yarn install"]Then |
The git-commit-data part is Yarn Berry's auto-merge: it reads the commit IDs from the conflict markers and asks git for both versions of the lockfile. Even if you switch to git-style markers (
--config ui.conflict-marker-style=git), it fails withYN0083: Git returned an error when trying to find the commits pertaining to the conflict, since there's no git merge in progress. (Yarn 1 does accept git-style markers, but not jj's default ones.)What works for me is to not merge the lockfile at all: resolve
package.jsonfirst, then take either side ofyarn.lockand let yarn regenerate it:yarn installadds whatever the other side introduced, since i…