Canonical Project File Format?

Are you missing a feature? Request its implementation here.
DaveW
Posts: 6
Joined: Wed Feb 10, 2021 8:15 pm

Canonical Project File Format?

Post by DaveW »

My team and I are using Oxygen XML Editor 24.0 with the Git plugin to manage version control. Often the project file, [project].xpr, changes in response to an author adding, removing, or changing content. This creates conflicts that have to be merged in our Git repo. The problem is, there doesn't seem to be any order to how the project file is written out each time it's regenerated. This makes it impossible to merge the conflicts manually. We can't leave the project file out of the Git repo, because it would quickly become out of date.

Can the project file be written in such a way that changes to it don't cause conflicts in Git? Failing that, could it be written in a canonical format that puts elements in the same order each time so that merge changes are manageable?

I'd be happy if you told me I'm missing something, but I've looked in the doc and the forum several times and can't find a solution to this problem.

Dave
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Canonical Project File Format?

Post by Radu »

Hi Dave,
In the Oxygen Preferences->"Project Level Settings" page you can uncheck about 5 settings which are usually stored at project level, then commit the modified project.xpr.
These 5 settings are usually the ones which make the xpr more volatile to change, if you have another use case maybe you can tell me what exactly appears modified in the XPR on your side when users are editing.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
DaveW
Posts: 6
Joined: Wed Feb 10, 2021 8:15 pm

Re: Canonical Project File Format?

Post by DaveW »

Radu,

Thanks, I think this will help. What happens when you uncheck those boxes? Do the items get saved at the global level?

Some of those things should be saved at the project level (in our case), but for the moment it will be much easier to, for example, set the transformation scenarios every time rather than deal with the Git project file issue. This is still a bug with using Oxygen and Git together, IMO. The project settings are just too important not to be able to modify them and save them with the project.

Dave
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Canonical Project File Format?

Post by Radu »

Hi Dave,
Thanks, I think this will help. What happens when you uncheck those boxes? Do the items get saved at the global level?
Yes. They get saved in Oxygen global settings file (located in the user home folder).
Some of those things should be saved at the project level (in our case), but for the moment it will be much easier to, for example, set the transformation scenarios every time rather than deal with the Git project file issue.
Whenever you create a transformation scenario you can choose in the transformation scenario edit dialog if it gets saved at global or project level.

In the Preferences->"Project Level Settings" page there is a setting named "Allow transformation scenario associations to be saved at project level". These associations allow Oxygen to remember that for a certain XML document a certain transformation scenario was applied in the past, thus to re-run the same transformation scenario when clicking the "Apply Transformation Scenario" toolbar button.
This is still a bug with using Oxygen and Git together, IMO. The project settings are just too important not to be able to modify them and save them with the project.
I'm afraid I do not understand this remark. So some actions that you take in Oxygen (for example changing settings in the Preferences dialog when that particular preferences page is saved at Project level) will modify the project XPR file which is good because maybe you want to share those changes with everybody else. It's indeed important not to have the XPR modified too frequently, especially if the end user does not alter any settings in the Preferences dialog and this is why the "Project Level Settings" preferences page allows you more granular control.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
DaveW
Posts: 6
Joined: Wed Feb 10, 2021 8:15 pm

Re: Canonical Project File Format?

Post by DaveW »

Radu,

Sorry, my comment is misleading. The ability to save settings at a project level is not a problem; in fact, it's a necessary feature. The problem is that the file contents seem to be arbitrarily rearranged anytime a setting is changed or a file is added. It's very difficult to maintain this file in Git.

Dave
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Canonical Project File Format?

Post by Radu »

Hi Dave,

The contents of the XPR should not arbitrary re-arrange but it should change whenever project-specific settings are modified by the user's actions in Oxygen.
When this happens again for you can you double click the XPR in the Git client you are using to see the differences and maybe post a screenshot with them or describe what was changed? Maybe it's something we could fix on our side.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply