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

Fix initial change listing with statuses #351

Merged

Conversation

yamadapc
Copy link
Contributor

Fix VCS events since listing to include currently untracked files.

Test Plan: cargo test

Created using spr 1.3.5
Copy link

changeset-bot bot commented Feb 20, 2025

⚠️ No Changeset found

Latest commit: d25b9d4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@yamadapc yamadapc requested a review from a team February 20, 2025 23:52
let status = entry.status();
let mut change_type = FileChangeType::Update;
if status.is_wt_deleted() {
change_type = FileChangeType::Delete;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a difference in the way we handle this status type in cache invalidation?
Also, if the files is untracked, do they have all the different statuses?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is, the invalidations are registered against specific file change events (update/create/delete)

@@ -309,15 +309,41 @@ pub fn get_changed_files_from_git(
old_commit: &git2::Commit<'_>,
new_commit: &git2::Commit<'_>,
) -> anyhow::Result<Vec<FileChangeEvent>> {
let mut changed_files = Vec::new();

// list current dirty files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the difference with vcs_list_dirty_files and why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will unify but this is doing slightly different work ;

There's a snapshot side and a start-up side. We actually needed to reconcile the snapshot with the dirty files here and re-hash the contents.

yamadapc added a commit that referenced this pull request Feb 24, 2025
Fix VCS events since listing to include currently untracked files.

Test Plan: cargo test

Pull Request: #351
@yamadapc yamadapc merged commit c7b53bf into main Feb 24, 2025
18 checks passed
@yamadapc yamadapc deleted the spr/yamadapc/fix-initial-change-listing-with-statuses branch February 24, 2025 22:06
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 this pull request may close these issues.

3 participants