xtuml + git = Classes with attribute amnesia. How to restore.

homepage Forums BridgePoint/xtUML Usage and Training xtuml + git = Classes with attribute amnesia. How to restore.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1240
    sfinnie
    Participant

    Lest anyone have the same palpitations I had today, a story with a happy ending…

    TL;DR is: there seems to be way for the editor to get out of sync with the underlying .xtuml files. This can happen if, for example, you use git for version control, create a branch and then revert to master.

    The result is: the model can appear to lose attributes for classes on a diagram.
    The solution is: close the model editing canvas, refresh the project & re-open the editor canvas.

    That’s it. If anyone has a better explanation/solution I’d be grateful if you’d post. Thanks.

    And now the full story…

    I spent several hours modelling, assiduously checking into git at regular intervals. Wanted to do some refactoring so created a branch after making sure everything was committed. Tried changes on the branch but they didn’t work. Thought “oh well, that’s what branches are for” and switched back to master. Opened up the model and… approx one third of classes had lost all attributes. Cue palpitations.

    Looked at the underlying .xtuml files and they still seemed to include the missing attributes. Selected the model in Model Explorer & did a ‘refresh’ – at which point all classes disappeared from diagram, leaving only relationships. Had a few more palpitations then closed the model canvas.

    Re-opened the canvas and, joy of joys, all restored. Large sigh of relief.

    #1241
    keithbrown
    Keymaster

    Thank you for pointing out the workaround you found.

    What version of EGit are you using? The next version of xtUML Editor will include EGit 2.3. If you are not on 2.3, I suggest you upgrade to that version now (Use “Help > Install New Software…” and point at this p2 repository: http://download.eclipse.org/egit/updates-2.3).

    Regards,
    Keith

    #1243
    sfinnie
    Participant

    Hi Keith

    I don’t use EGit, I use msysgit on the command line (v1.8.4), Windows XP.

    – S.

    #1247
    cort
    Keymaster

    Scott,

    You point out a general issue. It is possible to get the memory model in xtUML out of sync with the persisted files. There are a few ways to do this. All of them involve “changing the files out from under the editor”. You can accomplish this with git, SVN, vi and notepad. :)

    In the field we see this mostly in the same way you did. Different CM systems (and even different packagings of the same CM system) follow differing conventions with regard to change sets. You happened to run into git’s conventions on keeping “superset” files around when switching branches from your command line.

    I recommend maintaining the faith in your CM system. And we recommend git, because of its popularity, growing adoption and distributed nature. Just expect a few more heart palpitations over the weeks/months of learning the subtleties. I in right where you are.

    Kind Regards,
    Cort

    #1249
    sfinnie
    Participant

    Hi Cort, thanks for the post. Will trust git to “do the right thing” and believe…!

    – S.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.