We have one Git repository which contains a number of folders, one for each service. One of these folders is for Node-RED.
The Projects feature is very useful, especially the node diffs that show the changes to a Flow at a higher level of abstraction than a textual diff. When creating a Project, Node-RED also wants to create a Git repo at the level of the project. This doesn't work so well with our desired git pattern of having one 'monorepo'.
I have tried removing the
.git/ folder from inside the project, and letting Node-RED pick up the Git repository several levels higher up. The Node-RED history panel picks up this git history, but no longer shows the visual diffs for changes to a Flow, it falls back to a text diff of the JSON.
I've looked at the diff code a little bit, and I think I can see why.
At line 1726 it checks if the file in the commit is the flow file. When you change the root of the git repository, this line compares
One way to fix this without risking breaking other code would be to introduce a new key in the options which contains the canonicalised path of the project, relative to the git root, (this may be different to the