Git on windows complaining about .telegram files in dsmr binding

In my 2.5.x development branch on windows, git thinks that the .telegram files under bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal have changed, even though they have not. This is because the line endings are different.

$ git status
On branch lutronleap
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/Iskra_AM550.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/Landis_Gyr_E350.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/Landis_Gyr_ZCF110.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/Sagemcom_XS210.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/ace4000.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/dsmr_40.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/dsmr_42.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/dsmr_50.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/flu5.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/smarty.telegram
        modified:   org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/unregistered_meter.telegram

no changes added to commit (use "git add" and/or "git commit -a")

I have core.autocrlf=true, which should normally prevent this sort of problem, but it looks like someone recently made the following change, which I suspect has broken it:

--- a/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/.gitattributes
+++ b/bundles/org.openhab.binding.dsmr/src/test/resources/org/openhab/binding/dsmr/internal/.gitattributes
@@ -1,2 +1,2 @@
 # Always keep the CRLF line endings because the CRC depends on it.
-*.telegram binary
+*.telegram text eol=crlf

Is there any way to work around this? It’s difficult to do anything with these “changed” files in the mix.

Yes. Make sure your branch is up-to-date. This was already fixed. https://github.com/openhab/openhab-addons/pull/8433 (edit: fixed link to correct commit)

Thanks! Did the fix make it in to the archived openhab2-addons repository? I think I had just done a pull from there, so I could rebase my dev branch on the latest 2.5.x branch there and then move the changes to a new repo cloned from openhab-addons in my new 3.0 dev environment.

Anyway, I was able to work around it by doing something like editing the .gitattributes file, doing another checkout, then adding it to .gitignore, and doing a stash to clear the deck of changes.

Yes it did: https://github.com/openhab/openhab2-addons/commit/7578fb21be99222fe68565834b28c9119bb4be7d

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.