How to add files directly to upload directory

Currently I keep all of my projects in a unique directory on my workstation as shown in the example below.

fabrication/
├── benchy
│ ├── benchy.jpg
│ ├── benchy_notes.md
│ ├── models
│ │ └── benchy.stl
│ └── slices
│ ├── benchyabs.gcode
│ └── benchy.gcode
├── deathray
│ └── slices
│ └── deathwray.gcode
└── project1
├── slices
└── thingamabob.gcode

Each of those directories is also an individual git repo I would like to automatically send gcode files to octoprint while maintaining the same directory structure but only sending the gcode files. There are various tools for accomplishing this, I chose syncthing since I already use it. It is configured as a one way sync and only sends *.gcode files to my octopi's /home/pi/.octoprint/uploads/ directory. This works as far as the file transfer goes but it bypasses whatever validation is taking place when you upload from the web ui so when I go to start a print I get the following error

Attention

Layer indicator not found in file: 'SF-CK2MNT/CCR10S.gcode'
Check layer pattern in DisplayLayerProgress-Settings and reupload the file!

If I upload the same file through the web interface I do not get the error

The Octoprint-gitfiles plugin seems like it would work except for it is designed to have all of your in one repo. In the example shown below I suppose I could have the fabrication directory be a repo but than I would need to setup repos inside of a repo which I think is possible using git sub modules but seems like it would add to much complexity. The other option would be send files to the watched folder but unless I am misunderstanding something that is going to move the *.gcode files to the uploads directory without preserving the parent directory. So my my questions are

  1. Is it ok to ignore the error message and run the print job anyways?
  2. Is there possibly a different plugin that I am overlooking that can solve this problem?

I'm the author of OctoPrint-GitFiles, for what it's worth. Why not do a git init in your fabrication folder and just have it do its thing?

The basic git behavior is to preserve the folder structure. My example does this since it includes a PLA subfolder and files under this. As seen on my printer, it would then be:

  • gitfiles
    • PLA
      • 5milCamRing.gcode
      • etc

Don't copy sideways into the uploads folder; you won't end up with an analysis step which writes to the appropriate meta data file. This is likely what your plugin was complaining about.