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: an issue with modified files due to lfs #1292

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

baszalmstra
Copy link

This is an attempt to fix #1186 .

I haven't quite figured out the exact issue but it appears that when looking for commits with get_package_diff the repository is left in a modified state due to some weird interaction with lfs files being moved from- or into git lfs that previously weren't or shouldn't. Im not entirely sure.

Anyway, the "fix" that I implemented is to "force" the checkout of a certain commit by adding '-f' to the arguments of git checkout. This fixes the issue that occurs in #1186 but I cant fully comprehend if this has some negative consequences for other parts the execution. Feedback is very welcome.

@MarcoIeni
Copy link
Owner

Im not entirely sure.

Yes, you should be right 👍

This change is a bit too drastic. I prefer to revert manually single files (e.g. Cargo lock here ) instead of doing a force checkout. I'll try to figure out the lfs issue 👍

@MarcoIeni
Copy link
Owner

I wanted to try fix this today, but I didn't get to it :/
If you want to try to fix it, let me know how can I help.

I'm afraid that git checkout -f could bring to user data loss somehow, so I prefer to find a more careful approach

@baszalmstra
Copy link
Author

I would indeed love some help because Im kinda unsure on where to go from here.

Since the problem with git checkout only seems to happens in the checkout_head function I could also add a force_checkout method that is only called there. I assume that since this function is only called after trying to figure out the diffs on a fresh clone of the repository there is very little risk of data loss. Let me know what you think.

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.

Can't checkout to head after calculating diff
2 participants