archimatetool / archi-modelrepository-plugin

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

[Feature Request] Compare current model to most recent (or other) commit #123

Open michaelansley opened 4 years ago

michaelansley commented 4 years ago

Hi,

I'd like to propose a new feature, which allows a user to compare the current model (assumed to have changed since the last commit) to the last commit, or potentially some other commit.

Such a function could be accessed by a simple menu item on the Collaboration menu, or context menu item for the Change History UI.

Implementation could be similar to the diff management UI.

Regards, Michael

Phillipus commented 4 years ago

@jbsarrodie and I discussed this recently to at least show some diff when doing a commit.

michaelansley commented 4 years ago

Great! I often find myself wondering what, exactly, I'm about to commit when I, for example, switch branches. Or wondering what exactly I'm committing, compared to what I think I'm committing. Given that I'm usually working on three or four different aspects of the model at any one time, I can easily do work in the wrong branch, especially if it is small changes to demonstrate something to a colleague.

Phillipus commented 4 years ago

Yes, indeed. We discussed this same thing and it did seem essential to want to see what changed in the same way as when you do a merge conflict.

WatchTh1 commented 4 years ago

Will this feature be put into roadmap ?

Phillipus commented 4 years ago

Will this feature be put into roadmap ?

Yes. But don't know when I will work on it (I'm working on a lot of stuff)

eduardobbs commented 3 years ago

Hi, if it helps I've created a JArchi script and a batch that does the job for me on Windows. This is the content of the JArchi script:

exec("GitCompare.bat");
console.log("GitK will open, the comparison will also be available on Archi under the Scripts Manager tab: 'GitCompareRESULT.diff' file");

And this is the content of the batch file:

cd instance\model-repository\MyGitRepoXYZ
git show > jarchi-scripts\Architecture\GitCompareRESULT.diff
gitk &

I use a portable version and my repository folder resides on a relative path to Archi, but you could set it up differently, here is my folder structure: image

Besides opening the GITK tool, which is interactive, it also saves the differences to the file below under your Scripts Manager tab: image

So, as an alternative to GITK, you can right-click on it and then click on edit. It should open the tool you selected on the Edit-->Preferences-->Scripting menu: image

In my case the batch file makes a call to the Visual Studio Code IDE:

@echo off
REM cls

set vsCodePath="C:\Users\%username%\AppData\Local\Programs\Microsoft VS Code\Code.exe"

IF EXIST %vsCodePath% (
    %vsCodePath% %*
) ELSE (
    notepad %*
)

This is the result on the VS Code IDE: image

CamilleDominique commented 1 year ago

Hi all, For me the issue is not only to know in advance what are the differences between current local save and last commit on an xml point of view. An xml diff would be nice already but in reality not really useful if there are a lot of differences and hundreds of xml files have been changed. Something even more useful would be to sort the differences by views and provide visual comparison to the user. That is a personal idea, not sure how feasible it is though.

Has this feature request been included in 2022/2023 roadmap?

Phillipus commented 1 year ago

Has this feature request been included in 2022/2023 roadmap?

It's something we're looking at for coArchi version 2.

startsevsa commented 1 year ago

Has this feature request been included in 2022/2023 roadmap?

It's something we're looking at for coArchi version 2.

Maybe start from parsing the result of the git ls-files -m command ? At first time get the list of names of changed objects (or highlight them in a objects tree)