Visual Diff/Compare support

+3 votes
asked Apr 23, 2015 in Wanted features by peter.loborg (360 points)
To support inspecting changes in the generated UML view it would be beneficiary if PlantUML can swap between using two alternative skins based on diff markings in the PlantUML source.

That way the same diagrams can be generated as before - but where added/removed parts will becolored specially to describe the diff. A review can now be held in the resulting view rather than the source code view.

An alternative to using different skins is to change background color for areas where content is added (one color) and removed (another color) or simply changed (a third color). This cannot be better than waht the diff tool produces - it is only a request for the possibility to render the graph with diff markings in it in a usable way.

1 Answer

0 votes
answered Apr 24, 2015 by plantuml (295,000 points)
selected May 4, 2015 by peter.loborg
 
Best answer

Intereting idea, but the implementation could be difficult...

Maybe we could start by something very simple. Could you give a minimum example ?
Taking example from http://en.wikipedia.org/wiki/Diff_utility , we understand that you would like PlantUML
to be able to have as input:

@startuml
0a1,6
> This is an important
> notice! It should
> therefore be located at
> the beginning of this
> document!
>
8,14c14
< compress the size of the
< changes.
<
< This paragraph contains
< text that is outdated.
< It will be deleted in the
< near future.
---
> compress anything.
17c17
< check this dokument. On
---
> check this document. On
24a25,28
>
> This paragraph contains
> important new additions
> to this document.
@enduml


Except that the text would be UML source.
Is this what you are talking about ?

commented Apr 28, 2015 by peter.loborg (360 points)
Here is a minimum example using your standard sequence and a vanila instalation of Git on my windows laptop.

If I start of with one of the examples from your web site:
<pre>
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
</pre>
...and then add a REF box and some arguments to one of the messages and ask Git about the difference the following is returned:
<pre>
@@ -1,7 +1,8 @@
 @startuml
 Alice -> Bob: Authentication Request
+ref over Bob : init
 Bob --> Alice: Authentication Response
 
-Alice -> Bob: Another authentication Request
+Alice -> Bob: Another authentication Request(some argument)
 Alice <-- Bob: another authentication Response
 @enduml
</pre>
It is similar to your example, but with a different diff header and different add/delete markers. Perhaps these can be configurable?
commented May 5, 2015 by plantuml (295,000 points)
Ok, we will then focus on git syntax and on sequence diagram first.

However, even if we like the idea, the implementation will not be that easy to do.

We are currently deeply redesigning the architecture for sequence diagram (see http://plantuml.sourceforge.net/teoz.html ).
We have to finish this refactoring before being able to add such new features. So thanks to be patient (at least several month...).

Regards,
...