archimatetool / archi-modelrepository-plugin

coArchi - a plug-in to share and collaborate on Archi models.
153 stars 52 forks source link

Export Model to Grafico Files Unexpected Behavior #102

Closed VinceAxe closed 4 years ago

VinceAxe commented 5 years ago

Working on some diff feature, I needed to have the Model Changes exported to the Diff Folder --> Thus I call Export Model To Grafico Files function But it appears that a commit is mandatory after a call to this function ... I did not, start switching branches of my model, and it started to get messy ...

I suspect that it is because of the Git Add command called inside the function ...

I tried to think a way around, but I can't use the Reset function, since it hard reset ...

I'm not sure how to deal with all of this, but I was not prepared about that behavior with the Grafico Export (perhaps it's normal, but it needs to be explicite tho)

Phillipus commented 5 years ago

It depends what you are trying to do. Change Branch? You have to commit changes, abort changes, or stash changes (which we don't support in the plugin) before changing branch.

IArchiRepository#exportModelToGraficoFiles() will serialise the model to the xml files. If the model has chnaged since the last time this was called, then git will report that changes have been made and a commit or an abort is required. This method does Stage the files (Add Command) to remove files that only have line endings different.

So, effectively this method saves XML files and does an Add command.