Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] Logical model support in EGit

Hi all,

I am currently working on the integration with EGit and the model providers from Eclipse Team. The basic need is that some actions executed on the repository content need to be aware of logical models provided by the model provider(s) and retrieve multiple files instead of a single one.

Indeed, there are times when a "physical" file is part of a bigger picture. For example, an html file depends on its associated CSS file to be properly rendered, a split zip file depends on the presence of all of its fragments to be opened, a java file requires all of its imports in order to be compiled... For most of these, it is "harmless" (sort of) to ignore the "whole picture" and consider only a single file when applying actions. Java, for one, will still allow you to open the erroneous file and edit its "import" section to remove the parts that were not properly updated. An html file with wrong links will still be openable in a browser, even though it will be missing the rendering layed out in its CSS file. For others, the "bigger picture" will be broken if we only consider a single file. The zip file will be corrupted and totally unusable if I replace one of its fragments by an older version from the git history.

The model providers API is designed to tackle such needs and allow third-party plugins to provide their own logic to resolve the logical model, from a given "starting point" resource. The starting point is usually the resource selected in the workspace for an action (such as "replace", "compare", "commit" ...). In my case, the logic I am contributing to Team is aimed at resolving EMF models. One model depends on its fragments as well as all of its referenced resources to be present, lest it be corrupted and unloadable (you may want to look at http://wiki.eclipse.org/EMF_Compare/Logical_Model for an in-depth description of the use case).

Benjamin Muskalla had worked back in the end of 2011 to make the "Replace With" action aware of model providers (through https://bugs.eclipse.org/bugs/show_bug.cgi?id=354932). The "commit" action still ignores them (trying to commit a file that is part of a model *should* prompt the user to commit the rest of the logical model). My priority though is to get all of the "comparison" actions to properly call the Team APIs (see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=354474). Some improvements towards this have been made through bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=393225 and the "compare with > reference" action now properly calls the model providers for additional input. However, all of the remaining actions are still ignoring this API :
  • Compare With Menu
    • Commit
    • Git Index with HEAD
    • HEAD Revision
    • Previous Revision
    • Branch, Tag or Reference << as outlined above, this one is actually working thanks to bug 354932
    • Git Index
  • History View
    • double-click a commit
    • right-click > compare with workspace
    • double-click a file (bottom-right pane)
    • right-click a file > compare with version in ancestor
    • right-click a file > compare with version in workspace
  • Commit Viewer
    • double-click a file
    • right-click a file > compare with version in ancestor
    • right-click a file > compare with version in workspace
  • Git Staging view
    • double-click a file (staged or unstaged)

We'd like to know if the EGit team has any plans to make all of these actions support extensions to the model providers, and how we could best contribute to this effort.

We also meet some problems in other parts of EGit. We do not have an explicit dependency on EGit, JGit, CVS, Subversive .... or any other Team Provider. We target "Team" as a whole and are independent from the actual provider that's behind a given project (we don't even care whether there _is_ a Team provider in the first place). As such, we are querying the file history and revisions through the Team APIs (IFileRevision, IFileHistoryProvider, ...) and we need EGit to properly fill all information even when used through this "proxy". We've started looking at what's missing and providing patches (https://bugs.eclipse.org/bugs/show_bug.cgi?id=398982), please let us know if there are things we can do to make these contributions better.

Laurent Goubet
Obeo
begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr";>Obeo</a>
email;internet:laurent.goubet@xxxxxxx
url:http://www.obeo.fr
version:2.1
end:vcard


Back to the top