-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(affected): include not committed changes in --affected
#9133
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused why --affected
and --filter=[main]
go down two different codepaths. Are we defaulting the SCM head for --affected
too early?
You're more experienced in this area of the codebase so stamping to not delay the fix.
crates/turborepo-scm/src/git.rs
Outdated
let output = self | ||
.execute_git_command(&["ls-files", "--others", "--exclude-standard"], pathspec)?; | ||
self.add_files_from_stdout(&mut files, turbo_root, output); | ||
|
||
// Then add files that are in git, but have been modified (but not committed) | ||
let output = self.execute_git_command(&["diff", "--name-only", "HEAD"], pathspec)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if TURBO_SCM_HEAD
is specified and isn't HEAD
? Does this change behavior for SCM filters that specify a full git range like --filter=[commit-1...commit-2]
?
I'm a little confused why we're duplicating the logic from the case where to_commit
isn't specified? It seems like to_commit = None
and include_uncommitted = true
indicate the same thing?
d36e7bc
to
f1f501b
Compare
diffs off of a merge base for `--affected`
f1f501b
to
e1c9c75
Compare
Co-authored-by: Chris Olszewski <[email protected]>
Description
We were including new files that were not checked into git, but not changes to files already in git but not committed.
Testing Instructions
Added more testing to
affected.t
for both new files and existing files with new changes