How to remove configuration files for deleted devices

There was a previous (now closed) issue (How to remove a host ? · Issue #580 · ytti/oxidized · GitHub) which this closely related to but I’m not sure if this is a bug or I’m doing something wrong, or it’s expected behaviour.

My view on deleting the configurations of removed devices is it should be OK as everything’s in a git repository so, if we want to find out about something that was removed a year or so ago, we can just check out an old branch. In my case, I want to remove old files as I have a script which checks through the backups to look for things like IP addresses actively referenced in the current configuration of devices so having old configurations for defunct devices lying about means these continue to be counted as “in use”. Ignoring that side of things, however…

To remove the configurations, currently I’m trying:

  1. Stop Oxidized (by pkill .config/oxidized/pid).
  2. Clone the bare repository directly from .config/oxidized/configs.git.
  3. git rm the devices I no longer require.
  4. git commit this and then git push it back to the bare repository.
  5. Restart Oxidized.

This looks fine up until Oxidized finds the next changed device configuration and creates a new commit for it, then all the deleted device files come back.

This process looks the same as what @davromaniak was suggesting in the above issue but it’s not working for me. What am I doing wrong? This is more of a support message but I’m unclear how I can remove these files, even manually?