archi-modelrepository-plugin icon indicating copy to clipboard operation
archi-modelrepository-plugin copied to clipboard

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

Open michaelansley opened this issue 5 years ago • 9 comments

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

michaelansley avatar Feb 19 '20 09:02 michaelansley

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

Phillipus avatar Feb 19 '20 09:02 Phillipus

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.

michaelansley avatar Feb 19 '20 14:02 michaelansley

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.

Phillipus avatar Feb 19 '20 15:02 Phillipus

Will this feature be put into roadmap ?

WatchTh1 avatar Feb 22 '20 19:02 WatchTh1

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)

Phillipus avatar Feb 22 '20 22:02 Phillipus

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

eduardobbs avatar Apr 29 '21 19:04 eduardobbs

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?

CamilleDominique avatar Sep 07 '22 09:09 CamilleDominique

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

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

Phillipus avatar Sep 07 '22 09:09 Phillipus

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)

startsevsa avatar Jul 06 '23 08:07 startsevsa