chrisjbillington / git-nautilus-icons

A nautilus Python extension to overlay icons on files in git repositories
BSD 2-Clause "Simplified" License
43 stars 4 forks source link

The icon does not update after the git status changes before restarting my computer. #19

Closed sierxue closed 3 years ago

sierxue commented 3 years ago

My system is Ubuntu 20.04, using nautilus.

After git status changes, the icon does not update until I restart the computer.

chrisjbillington commented 3 years ago

Thanks for reporting the issue.

Quoting from the README:

Nautilus/nemo/caja doesn't always ask the extension for new icons when a file changes on disk or its git status othewise changes, so displayed icons can be out of date. Press F5 to force a refresh.

Nautilus doesn't know if files have changed, and its caching seems a bit aggressive so it sometimes doesn't ask the extension for new icons for a long time. Does refreshing work?

sierxue commented 3 years ago

Great appreciations for your quick response! Refreshing does work.

To be more specific in my case, only when the git status changes from not clean to clean, the icon does not update until I restart the computer.

chrisjbillington commented 3 years ago

Good to hear refreshing works.

I have previously considered invalidating the icons to force Nautilus to ask for them again, but on the other hand calling git status on large repositories is slow and it can be a real drag to have it happening constantly.

But perhaps invalidating them after ~5 minutes would be a good compromise.

I might also investigate in what circumstances Nautilus doesn't ask the extension for new icons - it really should do so if the files modified time has changed, so this could be considered a bug and if so I'll report it upstream. If that worked properly there'd be no need for a refresh or invalidation.

Strange that the behaviour changes depending on the specific status - I don't have an explanation for that!