gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

File rename detection does not match git

Open cbjeukendrup opened this issue 1 month ago • 1 comments

Version

0.17.6 / nightly

Operating System

macOS

Distribution Method

dmg (Mac OS - Apple Silicon)

Describe the issue

I've encountered a couple of cases now where GitButler's file rename detection does not seem to match Git:

  • When a file is moved and there are small changes to it, GitButler (often or always?) does not detect it as a rename but rather as a deletion + addition.
  • In https://github.com/gitbutlerapp/gitbutler/pull/10883/commits/ef41b9fc5246bbe322a37d73f891c55927a44dbb, I had deleted FolderContextMenu and FileContextMenu, and created ChangedFilesContextMenu; the diff from FileContextMenu to ChangedFilesContextMenu was significantly smaller than from FolderContextMenu to ChangedFilesContextMenu, and thus Git(Hub) detects it as a rename from FileContextMenu to ChangedFilesContextMenu. But GitButler, back then, detected it as a rename from FolderContextMenu (and a deletion of FileContextMenu).

The first case might suggest it has something to do with a threshold that's set too high by GitButler, but given the second case, that does not seem true.

How to reproduce (Optional)

No response

Expected behavior (Optional)

No response

Relevant log output (Optional)


cbjeukendrup avatar Nov 16 '25 15:11 cbjeukendrup

Thanks for sharing, along with a commit to try out more subtle cases where the gitoxide implementation of rename tracking disagrees with Git.

This is a known issue, and gitoxide doesn't implemented any of the finesse that Git uses to get better results. But it's nothing that couldn't happen, and I hope one day it will.

Byron avatar Nov 16 '25 19:11 Byron