[coArchi] : quick method to search when something has been deleted

Started by jsimoncello, December 02, 2024, 09:15:24 AM

Previous topic - Next topic

jsimoncello

Hi everyone

just want to share method to search in model history a commit where a given concept or view has been deleted. I have been managing large models since a long time now, with a lot of architects working on them and more often than not someone come to see me because "xxx is not in my model anymore !" First thing to check is when (and by who) concept has been deleted, and discuss with its author, you can do that with archi change history alone,  but it is slow with large models. The quickest method I have found is :

- in "change history" panel, find a old commit when the deleted concept/view still exists, choose to"Extract Model From This Commit"
- On extracted model, get the internal id of the concept. Use a jarchi script like this :
selection.each(function (o) {
    console.log(o.type, ";", o.name, ";", o.id, ";")

});

launch a git command line client in local repository, replace "id-b33245b366f04550b111146f32efbbf" with the id of your concept
$ git log --name-status | grep "^D.*id-b33245b366f04550b111146f32efbbf5"
Result :
D       model/diagrams/ArchimateDiagramModel_id-b33245b366f04550b111146f32efbbf5.xml
D       model/diagrams/id-7acacee9b7814412ab9ff64b1750598a/id-8ba294aa7776444db30208d14ebe3a19/ArchimateDiagramModel_id-b33245b366f04550b111146f32efbbf5.xml
here the first line is my deleted view (second line is - not sure about that- a link to this view in another view), copy the full path and execute this command :

$ git log --diff-filter=D -- model/diagrams/ArchimateDiagramModel_id-b33245b366f04550b111146f32efbbf5.xml
It returns something like this with commit id, author and date :
commit c0bb7bda62368671d508ea6306ebe1be3ade45d3
Author: MARTIN JEAN
Date:   Thu Nov 28 09:50:09 2024 +0100

 lorem ipsum



Hope this helps