librenms-plugins / Weathermap

MIT License
64 stars 51 forks source link

Case-Sensitivity Causes Git Grief #8

Closed supertylerc closed 6 years ago

supertylerc commented 9 years ago

On platforms that are not case-sensitive (Windows, Mac OS X), cloning this repository causes significant grief. The filesystem (and therefore git) will view Weathermap.php and weathermap.php as the same file, and when cloning, you will get only one of those files. Then you'll see some nonsense about having untracked files, and it's an all-around mess. Here's an example:

 ❯ git status                                                                                                                                                                                                                                                                                                                                                    [14:33:30]
On branch master
Your branch is up-to-date with 'origin/master'.
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:   weathermap.php

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

This is from a fresh clone of this repository on OS X. More details on the craziness:

 ❯ git diff | wc -l                                                                                                                                                                                                                                                                                                                                              [14:34:18]
     341
 ❯ wc -l Weathermap.php                                                                                                                                                                                                                                                                                                                                          [14:34:42]
      12 Weathermap.php
 ❯ wc -l weathermap.php                                                                                                                                                                                                                                                                                                                                          [14:34:44]
      12 weathermap.php

The only work-around, for OS X at least, is to create a new partition that is case-sensitive. For Windows, I'm not sure of a potential workaround (if any exists). On Linux, this obviously isn't a problem.

Would it be possible to rename the files such that there is more that is different about them than just the case?

laf commented 9 years ago

This is a little bit of a hang up with the plugin system and trying to get the weathermap into it.

The reason (from memory) is that weathermap.php exists already, I could try and rename that to something else and see if it works. Otherwise if I rename Weathermap.php then I'd have to rename the repo for it as the files are included based on the initial folder name. I could possibly also update the plugin system to call a config.php page which tells it what files to then.

I'll have a think / play.