Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

#7807 closed enhancement (duplicate)

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: Branch:
Release Notes:
API Changes:
Internal 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 (1)

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

Download all attachments as: .zip

Change History (4)

by anonymous, 16 years ago

Attachment: suppress_file_diff.patch added

comment:1 by Christian Boos, 15 years ago

Component: generalversion 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 by Christian Boos, 15 years ago

Milestone: 0.12

comment:3 by Remy Blank, 15 years ago

Milestone: 0.12
Resolution: duplicate
Status: newclosed

This is indeed solved with #2672.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.