Skip to content

[Bug?]: Changes to files with special characters in the name cause false positives in yarn workspaces list --since #6804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
colatkinson opened this issue May 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@colatkinson
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

When a changed file has certain special characters in the name, yarn workspaces list --since will claim the root workspace has changes rather than the actual affected workspace.

When changed files contain certain special characters (e.g. "), git diff --name-only includes quotes around file names. To my understanding this is the command Yarn uses under the hood for this command. It seems this could be avoided by either:

  1. Unquoting these file names when they are present.
  2. Using git diff --name-only -z to get results as NUL-separated rather than newline-separated.

To reproduce

I've attached a git repo bundled with git bundle:
example.bundle.gz

  1. gunzip example.bundle.gz && git clone example.bundle.gz && cd example
  2. git checkout quoted && YARN_CHANGESET_BASE_REFS=master yarn workspaces list --recursive --since --json -v. Note that it shows changes in the root workspace.
  3. git checkout unquoted && YARN_CHANGESET_BASE_REFS=master yarn workspaces list --recursive --since --json -v. Note that it shows changes in the sample workspace.

In both cases, the only change is the addition of a new file in the workspace dir. In the quoted branch that file's name contains a ", whereas in the unquoted branch it does not.

Environment

System:
    OS: Linux 6.12 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (16) x64 AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
  Binaries:
    Node: 20.19.2 - /tmp/xfs-d5277bfe/node
    Yarn: 4.9.1 - /tmp/xfs-d5277bfe/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.19.2/bin/npm

Additional context

No response

@colatkinson colatkinson added the bug Something isn't working label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant