Incrementalist icon indicating copy to clipboard operation
Incrementalist copied to clipboard

Deleted files not being recorded as changes

Open filipesilva-l opened this issue 1 year ago • 5 comments

Hi, congratulations on the amazing project!

I noticed that Incrementalist does not record that a deleted file is a change in a project. I don't know if this can help, but dotnet-affected also has this behavior and there was already some discussion about it in this issue.

I think this is easily reproducible, but if you want, I can try to set up some kind of tests.

Thanks in advance.

filipesilva-l avatar Apr 23 '25 02:04 filipesilva-l

@filipesilva-l a test would be great - I'd recommend copying the structure we use in https://github.com/petabridge/Incrementalist/blob/dev/src/Incrementalist.Tests/Dependencies/EmitDependencyGraphSpecs.cs - that will give you the ability to test both the git diff code AND the dependency resolution analysis code at the same time. The bug could be in either place, but this will hit both.

Aaronontheweb avatar Apr 23 '25 17:04 Aaronontheweb

Hi @Aaronontheweb, how are you?

Sorry for the late response, I've been quite occupied these last few days. But I had some time to fiddle around with the project and I encountered a few difficulties while trying to run it locally. I'll list them here with a few options to make it easier for future contributors, and you can let me know if these changes would be worthwhile:

The first issue is that, in MacOS, the default TMPDIR env var is a symlink, so the tests fail when using the DisposableRepository class because the Libgit2Sharp Repository type follows the symlink and the BasePath doesn't. My suggestion would be to get the initial path from Path.GetTempPath() and then, after constructing the repository, setting the BasePath as the parent of the repoPath.

The second issue is that the tests assumed that the initial branch was "master" and failed when the value was set to another one. We could try to read this value from the config.

Do you think that these are desirable changes?

Regarding the issue, I'll try to work on it this weekend and come back with a test and possibly more information.

filipesilva-l avatar Apr 25 '25 22:04 filipesilva-l

Hi @filipesilva-l - sorry for the delay myself! I think the OS X issues may have been resolved here: https://github.com/petabridge/Incrementalist/pull/422

The second issue is that the tests assumed that the initial branch was "master" and failed when the value was set to another one. We could try to read this value from the config.

You should be able to set the branch name in the incrementalist config during testing - and I believe the DispoableRepository will let you set that too

Aaronontheweb avatar May 12 '25 21:05 Aaronontheweb

Hi @Aaronontheweb, sorry, I've been really busy and I probably won't be able to help to reproduce this in the foreseeable future.

Would you like me to close this issue?

filipesilva-l avatar Jun 03 '25 20:06 filipesilva-l

no problem, we can keep this issue open if it's still a problem - was your issue limited to just Mac OS X?

Aaronontheweb avatar Jun 03 '25 21:06 Aaronontheweb