Skip to content
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

--filter=[HEAD^1] works but --filter=[HEAD^N] returns error #1157

Closed
sppatel opened this issue Apr 29, 2022 · 1 comment · Fixed by #1194
Closed

--filter=[HEAD^1] works but --filter=[HEAD^N] returns error #1157

sppatel opened this issue Apr 29, 2022 · 1 comment · Fixed by #1194
Assignees

Comments

@sppatel
Copy link
Contributor

sppatel commented Apr 29, 2022

What version of Turborepo are you using?

1.1.5

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac

Describe the Bug

npx turbo run test --filter='[HEAD^1]' --dry=json | jq '.packages' works but going past HEAD^1 always returns an error.

npx turbo run test --filter='[HEAD^2]' --dry=json | jq '.packages'
unable to check diff vs. HEAD^2: exit status 128

If i choose a particular commit in the past that works...

npx turbo run test --filter='[b2cbc9dd2]' --dry=json | jq '.packages'

Expected Behavior

Support HEAD^N references to filter.

To Reproduce

  1. clone any repo w/ turbo support (including this repo)
  2. run a dry run with a filter using HEAD^5
@gsoltis gsoltis self-assigned this May 4, 2022
@gsoltis
Copy link
Contributor

gsoltis commented May 5, 2022

well, today I learned about ^ vs ~

My guess is that you don't have a merge commit when you are using ^2, so the commit you're trying to reference doesn't exist.

That being said, turbo should probably produce a better error message.

@kodiakhq kodiakhq bot closed this as completed in #1194 May 5, 2022
kodiakhq bot pushed a commit that referenced this issue May 5, 2022
 * Delete a lot of unused git integration code
 * Don't crash in git integration code, return an error instead (remove `log.Fatalf` instances)
 * Provide a more helpful error message when the user supplies a non-existent commit

Fixes #1157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants