fork-dev / Tracker

Bug and issue tracker for Fork for Mac
493 stars 12 forks source link

[Feature Request] Allow configuring of file rename threshold #2125

Open Stannieman opened 1 month ago

Stannieman commented 1 month ago

Hello!

By default git diff considers a file as renamed/moved if more than 50% of the contents are the same, otherwise it will show as a removed and a new file. This threshold can be changed by passing the -M parameter.

Assuming Fork uses git diff to visualize changes, would it be possible to make this value configurable?

Reason: Sometimes when refactoring I get situations where tracking changes gets hard due to files not showing as rename. While I might be "doing git wrong", temporarily changing the threshold would help a lot.

DanPristupov commented 1 month ago

Making rename threshold configurable is difficult.

Sometimes when refactoring I get situations where tracking changes gets hard due to files not showing as rename.

The problem might be caused by bug in Fork when a partial chunk stage changes the file status to from 'renamed' to 'modified'. There is an issue for this: https://github.com/fork-dev/Tracker/issues/1872.

The file will show the correct 'renamed' status after full refresh (Cmd+R or activate some other application and return back to Fork). This can be used as a workaround.

Stannieman commented 1 month ago

It's not the bug, it's really the files that have changed enough. In VS Code you can configure this and then it will be detected as move. But it's not like it happens every day and I can use VS Code as workaround, so it's not a big issue.