gitbutlerapp / gitbutler

The GitButler version control client, backed by Git, powered by Tauri/Rust/Svelte
https://gitbutler.com
Other
13.4k stars 530 forks source link

Gitbutler wants to delete force delete files from repo #5651

Open andre-s8 opened 3 days ago

andre-s8 commented 3 days ago

Version

0.13.16 (20241121.082346)

Operating System

macOS

Distribution Method

dmg (Apple Silicon)

Describe the issue

Whenever I start up gitbutler, it want always want to delete 2 specific files I do not know why it wants to delete these files but its just 2 icon files.

How to reproduce

https://github.com/user-attachments/assets/fc6c0427-4c91-4378-957f-24ede981f0bf

Expected behavior

The file should have been deleted in the first place

Relevant log output

No response

Byron commented 3 days ago

Thanks a lot for reporting and for the video!

Discarding the files also doesn't work and I have a feeling that these files have been removed from the index and the working tree, and this is what it picks up. Then, when discarding files, it might just try to remove it from disk and that does nothing as the file isn't there in the first place.

Could you check with git status if these files indeed show up as deleted from the index? The reason I am asking is that when trying this, it worked for me. However, during my tests I always saw the 'locked' symbol, which I don't see in the video - maybe that's related.

Thanks for your help.

Edit: Maybe you could start GitButler from the terminal as well using /Applications/GitButler.app/Contents/MacOS/gitbutler-tauri - that way logs are easily extractable in case errors show up.

andre-s8 commented 1 day ago

Hi @Byron thanks for helping me out. I tried to restore the files when I run git status it does appear.

However when I try to restore them it appears in my commit as deleted again.

image
andre-s8 commented 1 day ago

After delete this .git folder and initialising it again I am still getting this bug. its very weird.

Byron commented 1 day ago

It is very strange indeed.

Even if I locally remove a file from the worktree, and then discard that change in the GitButler UI, I have the expected effect as the file is restored, similar to what git restore <file> would do.

I thought for a moment that the files might be ignored, but when I do that the changes don't show up at all, I created #5662 for this.

Maybe these files have .gitattributes assigned to them that somehow have an effect on this?

andre-s8 commented 1 day ago

There is no git attributes for the files, I even tried manually cloning using gitbutler ui but it gives me the same story, it wants to delete the files, I didn't even start typing or anything.

image
andre-s8 commented 1 day ago

@Byron I do have logs I can provide, however I am wary to share them because it may contain organisational data.

andre-s8 commented 1 day ago

@Byron seems to be with the reset_files and reset_files:create_nsapshot handle:recalculate_everything or something.

Byron commented 1 day ago

Thanks for taking a look! If ERROR shows up in the logs, that would definitely mean something. Strangely, git status also shows them as deleted, because they are - at least this is what I understood from the picture. And restoring them even with Git doesn't actually do anything, right?

If so, it's somewhat unrelated to GitButler it seems, but maybe the redacted version of ERROR messages can be shared here to shed some light.

andre-s8 commented 1 day ago

Restoring the files does does not help, gitbutler will mark them as deleted for some reason and would want to add it to the commit. the files do exists I have check the repo on our production branch and we do use them.

There no errors just INFO logs.

Byron commented 21 hours ago

I see… unfortunately it remains a mystery what's happening here.

Only one more thing - could you confirm that git status also shows them as deleted? And after restoring them with Git, git status is clean? If that's the case, it's the question how they get deleted again - right now it feels like going into GitButler is all it takes to get them deleted somehow.