git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH 00/11] Support customizable label decorations

From
Tor Arne Vestbø <torarnv@gmail.com>
Date
Feb 5, 2009, 01:00 UTC
Message-ID
<1233795618-20249-1-git-send-email-torarnv@gmail.com>

This series adds support for customizable label decorations, which is usefull for hiding selected decorations, or tweaking the format of the decoration text.

Decorations are edited using the new Team->Git->Label Decorations preference page, which is based off similar functionality from the existing CVS and SVN team providers.

Icons can be enabled and disabled individually, and text can be customized by reordering and editing the set of mapped variables. Boolean variables like 'dirty' and 'staged' can be customized by postfixing the variable name with a colon and a selected string that should be insert if the variable evaluates to true.

The two general options control traversal of child and parent elements during decoration. The first, 'Also re-decorate...', controls whether or not ancestor elements of the current decorated elment will also be scheduled for re-recoration. The second, 'Inspect dirty state...', controls whether decoration of container elements such as projects and folders should traverse child elements to decide if the container is dirty.

Disabling these options will improve performance for large trees.

The code should be solid enough for normal use, but I may have missed situations that the code does not handle -- resuling in crash and burn. If so, please let me know.

Known issues are:
  - If a project has a repository more than one level above the
    project directory decorations will fail.
  - When a Java resource is dirty, each parent package in the
    package hierarcy will appear dirty, even when the layout is
    set to 'flat'.

I've sprinkled the code with TODOs where I found possible future improvments. One such improvment is performance, where for example refactoring to use one shared status cache should help.

Tor Arne
PS: This is my first major patch to EGit, so apologies in advance
if I messed up the steps of the submit process in any way :)
Tor Arne Vestbø (11):
  Add support code to handle plugin property changes
  Use Set instead of array to keep track of change listeners
  Add a specialized team exception for Git
  Add new class ExceptionCollector for grouping exceptions
  Add new class SWTUtils with helper-methods for creating controls
  Implement basic customizable label decorations with preferences
  Add binding for name of the current branch
  Add icon decoration for tracked and untracked resources
  Implement decorations of dirty, staged, and conflicting resources
  Don't decorate every single resource on repository change
  Implement label decorations for folders and projects
 org.spearce.egit.core/META-INF/MANIFEST.MF         |    5 +-
 .../src/org/spearce/egit/core/GitException.java    |  168 +++
 .../core/internal/util/ExceptionCollector.java     |  128 +++
 .../spearce/egit/core/project/GitProjectData.java  |   33 +-
 org.spearce.egit.ui/.options                       |    8 +-
 org.spearce.egit.ui/icons/ovr/assumevalid.gif      |  Bin 64 -> 0 bytes
 org.spearce.egit.ui/icons/ovr/conflict.gif         |  Bin 64 -> 164 bytes
 org.spearce.egit.ui/icons/ovr/pending_add.gif      |  Bin 64 -> 0 bytes
 org.spearce.egit.ui/icons/ovr/pending_remove.gif   |  Bin 111 -> 0 bytes
 org.spearce.egit.ui/icons/ovr/shared.gif           |  Bin 106 -> 0 bytes
 org.spearce.egit.ui/icons/ovr/staged.gif           |  Bin 0 -> 114 bytes
 org.spearce.egit.ui/icons/ovr/staged_added.gif     |  Bin 0 -> 114 bytes
 org.spearce.egit.ui/icons/ovr/staged_removed.gif   |  Bin 0 -> 114 bytes
 org.spearce.egit.ui/icons/ovr/untracked.gif        |  Bin 0 -> 79 bytes
 org.spearce.egit.ui/plugin.properties              |    1 +
 org.spearce.egit.ui/plugin.xml                     |   12 +-
 .../src/org/spearce/egit/ui/Activator.java         |   70 ++-
 .../egit/ui/PluginPreferenceInitializer.java       |   13 +
 .../src/org/spearce/egit/ui/UIIcons.java           |   19 +-
 .../src/org/spearce/egit/ui/UIPreferences.java     |   19 +
 .../src/org/spearce/egit/ui/UIText.java            |   87 ++-
 .../src/org/spearce/egit/ui/internal/SWTUtils.java |  595 +++++++++++
 .../egit/ui/internal/actions/BranchAction.java     |    4 +-
 .../egit/ui/internal/actions/Disconnect.java       |    4 +-
 .../egit/ui/internal/actions/ResetAction.java      |    4 +-
 .../decorators/GitLightweightDecorator.java        | 1062 ++++++++++++++++++++
 .../internal/decorators/GitResourceDecorator.java  |  454 ---------
 .../internal/decorators/IDecoratableResource.java  |   93 ++
 .../preferences/GitDecoratorPreferencePage.java    |  911 +++++++++++++++++
 .../src/org/spearce/egit/ui/uitext.properties      |   35 +-
 30 files changed, 3230 insertions(+), 495 deletions(-)
 create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/GitException.java
 create mode 100644 org.spearce.egit.core/src/org/spearce/egit/core/internal/util/ExceptionCollector.java
 delete mode 100644 org.spearce.egit.ui/icons/ovr/assumevalid.gif
 delete mode 100644 org.spearce.egit.ui/icons/ovr/pending_add.gif
 delete mode 100644 org.spearce.egit.ui/icons/ovr/pending_remove.gif
 delete mode 100644 org.spearce.egit.ui/icons/ovr/shared.gif
 create mode 100644 org.spearce.egit.ui/icons/ovr/staged.gif
 create mode 100644 org.spearce.egit.ui/icons/ovr/staged_added.gif
 create mode 100644 org.spearce.egit.ui/icons/ovr/staged_removed.gif
 create mode 100644 org.spearce.egit.ui/icons/ovr/untracked.gif
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/SWTUtils.java
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitLightweightDecorator.java
 delete mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/IDecoratableResource.java
 create mode 100644 org.spearce.egit.ui/src/org/spearce/egit/ui/internal/preferences/GitDecoratorPreferencePage.java
Next: Tor Arne Vestbø
Message 1 of 31 in “Support customizable label decorations”
  1. 00/11 Support customizable label decorationsTor Arne Vestbø, Feb 5, 2009
  2. 01/11 Add support code to handle plugin property changesTor Arne Vestbø, Feb 5, 2009
  3. 02/11 Use Set instead of array to keep track of change listenersTor Arne Vestbø, Feb 5, 2009
  4. 03/11 Add a specialized team exception for GitTor Arne Vestbø, Feb 5, 2009
  5. 04/11 Add new class ExceptionCollector for grouping exceptionsTor Arne Vestbø, Feb 5, 2009
  6. 05/11 Add new class SWTUtils with helper-methods for creating controlsTor Arne Vestbø, Feb 5, 2009
  7. 06/11 Implement basic customizable label decorations with preferencesTor Arne Vestbø, Feb 5, 2009
  8. 07/11 Add binding for name of the current branchTor Arne Vestbø, Feb 5, 2009
  9. 08/11 Add icon decoration for tracked and untracked resourcesTor Arne Vestbø, Feb 5, 2009
  10. 09/11 Implement decorations of dirty, staged, and conflicting resourcesTor Arne Vestbø, Feb 5, 2009
  11. 10/11 Don't decorate every single resource on repository changeTor Arne Vestbø, Feb 5, 2009
  12. 11/11 Implement label decorations for folders and projectsTor Arne Vestbø, Feb 5, 2009
  13. Robin RosenbergFeb 5, 2009
  14. Tor Arne VestbøFeb 5, 2009
  15. Tor Arne VestbøFeb 5, 2009
  16. Robin RosenbergFeb 5, 2009
  17. Tor Arne VestbøFeb 5, 2009
  18. Robin RosenbergFeb 5, 2009
  19. Shawn O. PearceFeb 5, 2009
  20. Tor Arne VestbøFeb 5, 2009
  21. 02/11 Use Set instead of array to keep track of change listenersTor Arne Vestbø, Feb 5, 2009
  22. Shawn O. PearceFeb 5, 2009
  23. Tor Arne VestbøFeb 5, 2009
  24. Shawn O. PearceFeb 5, 2009
  25. Add support code to handle plugin property changesTor Arne Vestbø, Feb 5, 2009
  26. Tor Arne VestbøFeb 5, 2009
  27. Shawn O. PearceFeb 5, 2009
  28. Tor Arne VestbøFeb 5, 2009
  29. Robin RosenbergFeb 5, 2009
  30. Tor Arne VestbøFeb 5, 2009
  31. Robin RosenbergFeb 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.