Edgewall Software
Modify

Ticket #7807 (closed enhancement: duplicate)

Opened 3 years ago

Last modified 2 years ago

Add changeset filter to ignore files during diffs

Reported by: hspahr@… Owned by:
Priority: normal Milestone:
Component: version control/changeset view Version: 0.12dev
Severity: normal Keywords: changeset suppress_file_diff
Cc:
Release Notes:
API Changes:

Description

mrenzmann submitted a change for 0.10 which allowed users to add filters to the changeset subsection of the trac.ini file. The enhancement turns out to be perfect for my application, and I thought I could bring the enhancement to the 0.11.2. Hopefully this will help others.

Below is the original enhancement report. Thanks Mike!

I just looked at a changeset where a PDF document got overwritten with a
new, updated version of it. Trac showed me a full textual diff - which
caused my server's CPU to get alarmingly busy for a few moments.

Having uuencoded files in our repository, we did face a similar issue on madwifi.org. The following patches solved the issue for us:

http://projects.otaku42.de/changeset/116
http://projects.otaku42.de/changeset/117

It shouldn't be too hard to adjust these patches to apply cleanly against Trac 0.10.4.

These changes introduce the new parameter "suppress_file_diffs" in the [changeset] section, allowing you to define one or more patterns. Files with a matching name won't be shown in the repository browser, and diffs for changes to such files won't occur in the changeset browser.

For example, on madwifi.org we use the following setting:

[changeset]
suppress_file_diffs = *.uu

To see it in action, have a look at changeset 1711 [1]. That changeset modified many uuencoded files as well as some "normal" source files. The changeset browser still shows which .uu-files have been modified, but the actual diffs for such files are suppressed.

Now try to view the content of such a .uu-file in the browser at [2]; you will only see a message saying that HTML preview has been disabled for this file.

It's probably not the most elegant implementation for such a purpose, but it's been sufficient for our own purposes.

You might want to give the following settings a try:

[changeset]
suppress_file_diffs = *.pdf

Hope this helps.

Bye, Mike

Attachments

suppress_file_diff.patch (1.9 KB) - added by anonymous 3 years ago.

Download all attachments as: .zip

Change History

Changed 3 years ago by anonymous

comment:1 Changed 3 years ago by cboos

  • Component changed from general to version control/changeset view

Wouldn't #2672 also solve this?

i.e. if you add to your TracIni:

[mimeviewer]
mime_map = text/x-uuencode:uu
treat_as_binary = application/pdf, text/x-uuencode

then the corresponding diffs won't be shown.

You also won't be able to view those files in the preview, but that usually goes together.

comment:2 Changed 3 years ago by cboos

  • Milestone set to 0.12

comment:3 Changed 2 years ago by rblank

  • Milestone 0.12 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This is indeed solved with #2672.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from (none). Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.