Skip to content

Only discard the files changes inside the lane #4820

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

Merged
merged 5 commits into from
Sep 5, 2024

Conversation

estib-vega
Copy link
Contributor

@estib-vega estib-vega commented Sep 3, 2024

Problem

When using the file context menu inside a given lane to discard the changes, all changes to that file across all lanes are discarded.
This is either weird or unexpected behavior.

Solution

Only discard the changes inside the lane that the context menu was opened from.

Issues

This fixes issue #4137

When using the file context menu inside a given lane to discard the changes, only the changes to that file inside the lane should be discarded.
Any other changes to that same file that live in other lanes are kept
Copy link

vercel bot commented Sep 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 4, 2024 0:28am

claims: filtered_ownership_claims,
}
})
.context("failed to determin ownership to unapply")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

typo!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops!
Fixed :)

It also tries to use `Vec<PathBuf>` in the tauri interface, which is
still to be validated.
Copy link
Collaborator

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks so much for all your recent work here (making missing projects deletable was great!).

I took the liberty to edit the rust-side of things so that it's idiomatic and less wasteful. However, I also tried something new which is to pass Vec<PathBuf> from the frontend to the backend directly. In the frontend, this means that a string-array should be passed and I think it should convert to Vec<PathBuf> automatically. However, I didn't try it as I didn't adjust the frontend code.

It would be great if it could work like this, but if not, Vec<String> will be fine, and a conversion to Vec<PathBuf> in the backend.

Thanks again!

@estib-vega
Copy link
Contributor Author

Hey @Byron! Your improvements are more than welcome haha.
I try to adjust the FE code accordingly and give it a go.

Thanks!

@mtsgrd mtsgrd added the e2e-testing End-to-end testing related things label Sep 4, 2024
@mtsgrd
Copy link
Contributor

mtsgrd commented Sep 4, 2024

I added an e2e testing label here as a reminder this might be a good thing to cover.

Copy link
Contributor

@ndom91 ndom91 left a comment

Choose a reason for hiding this comment

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

LGTM 🥳

@estib-vega estib-vega merged commit 000bddb into master Sep 5, 2024
16 checks passed
@estib-vega estib-vega deleted the unapply-only-hunks-from-lane branch September 5, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e-testing End-to-end testing related things @gitbutler/desktop rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants