macgitver / MacGitverModules

DEPRECATED: Modules for MacGitver
5 stars 1 forks source link

Update the models on object changes #97

Closed antis81 closed 9 years ago

antis81 commented 9 years ago

Description

This is the next big step to bring the models in sync' with changes in the Git repository. Those changes can origin from either inside MacGitver or a random application (like i.e. Git CLI).

When a Git repository changes, MacGitver must update its data models to work on the correct data.

For example a new commit, branch, tag, ... was created. MacGtiver has to react and update its data models, which in turn trigger an update on the bound views.

All changes are detected by a central instance - the repository manager MacGitver::repoMan() - which calls signals on a "detected change".

Here is a list of possible events for orientation.

Module "Repository"

Updating the work tree and the index has to go in another PR. Currently MGV does not react to changes in the working tree or index.

Migration of the "Reference View"

Please read dicussion in Redmine

The reference view should be migrated to better integrate RM::RepoMan. Changing this now would make this PR unnecessarily complex.

Other changes / improvements

Reference View

antis81 commented 9 years ago

@scunz Would be nice, if you could verify this change bfd7051.

antis81 commented 9 years ago

@scunz :+1: Some good news: In the current implementation state, the HistoryModel and ReferenceModel both are aware of "reference creation". Thus, independent of the source (inside/outisde MGV), the views will get updated correctly based on the RepoMan events.

When there's light :bulb:, there's also some shadow: Seems like the RM::EventsInterface needs extensions. Currently I don't get a signal when ...

  1. ... HEAD was set (i.e. the active branch changed).
  2. ... a reference was removed
  3. ... an object was created (i.e. a new commit)

:question: Do we need definitions for them? Or is there something I overlooked here?

antis81 commented 9 years ago

I'm somewhat excited of what is available in this PR :+1:. It brings MGV a big step closer to a state, that's "publicly presentable". Well, some heavy weight bugs are still waiting to be fixed (especially memory consumption in the DiffViewer) ... but that's the next big story.

After completing some important things, I'm going to merge soon.

@scunz If you find any time, please help with the "refresh" topic. The most important parts happen in libMacGitverCore. I contribute my local work there as well - you shall see. At least, now we have real consumers for our events.

@BugSniffer If you want to know why I talk confusing stuff sometimes - just look here :smile:.

antis81 commented 9 years ago

@scunz That's the way aha, aha - I like it!! :smile:

Event detection for references is mostly complete. Basically nothing is missing. Just some possible optimizations:

:boat: I'd like to merge soon. As always not everything is implemented.

Other bigger tasks worth a new PR:

antis81 commented 9 years ago

:+1: Migration of "RefItem" works 90% locally! Some topics to be solved, but nothing too bad ... you'll see.

The new feature branch ngf/migrate-refitem is based on this one - which is unusual, but a sane solution for this situation.

This PR must be merged together with PR 22 in libMacGitverCore -> look here

@scunz I'd like to merge this one. Could you do some last review?

@BugSniffer FYI

antis81 commented 9 years ago

@scunz Think we can close this one in favour to #99.