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

[EGIT PATCH v2 00/12] Support customizable label decorations

From
Tor Arne Vestbø <torarnv@gmail.com>
Date
Feb 11, 2009, 18:40 UTC
Message-ID
<1234377614-23798-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.

Changes in v2:
  - Fixed layout issues in preference dialog
  - Icons replaced to match established conventions
  - 'Assume unchanged' icon is back
  - Added tooltips in the preference dialog
  - 'Added and dirty' is now decorated appropriately
  - Refactored container decorations. Now shares code path with
    files for more accurate results, and to allow inheritance

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, 'Maximum number of levels...', controls how deep the container decoration algorithm will recurse when trying to determine the state (dirty, staged, etc.) of a container.

Tweaking these options will improve performance for large trees.

The code should work fairly well for most usecases, but I may have missed cases where the decorations will fail misserably. 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 package in the package
    hierarcy will appear dirty, also when the layout is set
    to 'flat', which can be confusing.

These are on my list for features to add on top of these series, but I consider them non-blocking. This also goes for online help, which will be added when things stabilize some more.

I've also 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
Tor Arne Vestbø (12):
  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 icon and text decorations of various resource states
  Don't decorate every single resource on repository change
  Expose the underlying resource entries in ContainerTreeIterator
  Implement label decorations for folders and projects
 org.spearce.egit.core/META-INF/MANIFEST.MF         |    5 +-
 .../spearce/egit/core/ContainerTreeIterator.java   |   23 +-
 .../src/org/spearce/egit/core/GitException.java    |  168 ++++
 .../core/internal/util/ExceptionCollector.java     |  128 +++
 .../spearce/egit/core/project/GitProjectData.java  |   40 +-
 org.spearce.egit.ui/icons/ovr/assume_valid.gif     |  Bin 0 -> 85 bytes
 org.spearce.egit.ui/icons/ovr/assumevalid.gif      |  Bin 64 -> 0 bytes
 org.spearce.egit.ui/icons/ovr/conflict.gif         |  Bin 64 -> 194 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 -> 169 bytes
 org.spearce.egit.ui/icons/ovr/staged_removed.gif   |  Bin 0 -> 176 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         |   68 ++
 .../egit/ui/PluginPreferenceInitializer.java       |   15 +
 .../src/org/spearce/egit/ui/UIIcons.java           |   21 +-
 .../src/org/spearce/egit/ui/UIPreferences.java     |   21 +
 .../src/org/spearce/egit/ui/UIText.java            |   99 ++-
 .../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/DecoratableResourceAdapter.java     |  391 ++++++++
 .../decorators/GitLightweightDecorator.java        |  653 ++++++++++++++
 .../internal/decorators/GitResourceDecorator.java  |  454 ----------
 .../internal/decorators/IDecoratableResource.java  |  100 ++
 .../preferences/GitDecoratorPreferencePage.java    |  949 ++++++++++++++++++++
 .../src/org/spearce/egit/ui/uitext.properties      |   38 +-
 .../src/org/spearce/jgit/treewalk/TreeWalk.java    |    9 +
 33 files changed, 3310 insertions(+), 492 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
 create mode 100644 org.spearce.egit.ui/icons/ovr/assume_valid.gif
 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/DecoratableResourceAdapter.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 21 in “Support customizable label decorations”
  1. 00/12 Support customizable label decorationsTor Arne Vestbø, Feb 11, 2009
  2. 01/12 Add support code to handle plugin property changesTor Arne Vestbø, Feb 11, 2009
  3. 02/12 Use Set instead of array to keep track of change listenersTor Arne Vestbø, Feb 11, 2009
  4. 03/12 Add a specialized team exception for GitTor Arne Vestbø, Feb 11, 2009
  5. 04/12 Add new class ExceptionCollector for grouping exceptionsTor Arne Vestbø, Feb 11, 2009
  6. 05/12 Add new class SWTUtils with helper-methods for creating controlsTor Arne Vestbø, Feb 11, 2009
  7. 06/12 Implement basic customizable label decorations with preferencesTor Arne Vestbø, Feb 11, 2009
  8. 07/12 Add binding for name of the current branchTor Arne Vestbø, Feb 11, 2009
  9. 08/12 Add icon decoration for tracked and untracked resourcesTor Arne Vestbø, Feb 11, 2009
  10. 09/12 Implement icon and text decorations of various resource statesTor Arne Vestbø, Feb 11, 2009
  11. 10/12 Don't decorate every single resource on repository changeTor Arne Vestbø, Feb 11, 2009
  12. 11/12 Expose the underlying resource entries in ContainerTreeIteratorTor Arne Vestbø, Feb 11, 2009
  13. 12/12 Implement label decorations for folders and projectsTor Arne Vestbø, Feb 11, 2009
  14. Robin RosenbergFeb 12, 2009
  15. Robin RosenbergFeb 11, 2009
  16. 08/12 Add icon decoration for tracked and untracked resourcesTor Arne Vestbø, Feb 11, 2009
  17. Robin RosenbergFeb 16, 2009
  18. Tor Arne VestbøFeb 16, 2009
  19. Robin RosenbergFeb 17, 2009
  20. 13/12 Add new file tree iterator that can adapt into a ContainerTreeIteratorTor Arne Vestbø, Feb 17, 2009
  21. 14/12 Allow project decorations regardless of repository root locationTor Arne Vestbø, Feb 17, 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.