Contents
Hide ticket changes based on configurable rules
Notice: This plugin is unmaintained and available for adoption.
Description
Tickets can get noisy with lots of changes. This plugin hides a configurable set of changes to reduce this clutter. A button toggles between showing and hiding the changes. See examples below.
SECURITY WARNING: This plugin processes freeform JavaScript/jQuery code from the trac.ini
file. If this is a security concern in your Trac deployment, please do not use this plugin.
Bugs/Feature Requests
Existing bugs and feature requests for HideChangesPlugin are here.
If you have any issues, create a new ticket.
Download
Download the zipped source from here.
Source
You can check out HideChangesPlugin from here using Subversion, or browse the source with Trac.
Installation
- Install the plugin after downloading and unzipping:
cd hidechangesplugin/trunk sudo python setup.py bdist_egg sudo cp dist/TracHideChanges*.egg /your/trac/location/plugins/
See TracPlugins for more installation details and options. You'll likely need to restart Trac's web server after installation.
- Enable the plugin by adding the following to your
trac.ini
file:[components] hidechanges.* = enabled
You can alternatively use the Trac Web Admin GUI to enable any or all rules.
- Create rules in the
[hidechanges]
section oftrac.ini
for which changes to hide. See the configuration options below for details and ideas.
Configuration
You define rules using the rule.<name>
option in the [hidechanges]
section of trac.ini
as freeform JavaScript/jQuery 1.8.7 code. Each rule <name>
must be unique. Each rule (code) must evaluate to either true
or false
. If true
, the change will be hidden. A changediv
jQuery object is available to use within each rule. An example can be helpful to explain this more concretely.
Hide commentless changes
The most common type of changes to want to hide are commentless changes, eg when just a field changes without any comment. Here's how you would configure this rule in trac.ini
:
[hidechanges] rule.commentless = !changediv.find('div.comment').children().length show_button_name = Show commentless changes hide_button_name = Hide commentless changes
The above rule is named commentless
. It checks the change div's comment div for any children. If no children are found (length = 0
), that means the change is commentless. Since the rule needs to evaluate to true
to hide a change, we negate the result with a !
. In this example, we also changed the default button names to make it clear what type of comments are hidden. The button's name changes as the changes are shown or hidden.
Hide changeset changes
To hide changeset changes that are in the Trac 0.12 wiki syntax:
[hidechanges] rule.changeset = changediv.find('p a.changeset').children().length
This changeset
rule checks for an href node with the {{changeset}}} class, this is the wiki syntax for changesets introduced in Trac 0.12. If found, hide the change!
You can combine both/all rules in the [hidechanges]
section of the trac.ini
file as long as the names are unique. You should take care in naming the buttons accordingly, as one set of buttons apply to all hidden changes.
Recent Changes
- 14031 by rjollos on 2014-07-25 11:34:10
-
Changed license to 3-Clause BSD with permission of author. Refs #11832.
- 13991 by rjollos on 2014-06-22 09:47:31
-
1.0.1: Fix indentation and cleanup whitespace using
reindent.py
- 9735 by robguttman on 2011-01-04 17:10:33
-
removing 0.12 branch in favor of trunk.
(more)
Author/Contributors
Author: robguttman
Maintainer: none (needsadoption)
Contributors: