Edgewall Software
Modify

Opened 9 years ago

Last modified 2 years ago

#9172 new enhancement

Trac diff highlighting start and end points

Reported by: c.jones@… Owned by:
Priority: normal Milestone: next-major-releases
Component: version control/changeset view Version: 0.11-stable
Severity: minor Keywords: performance diff
Cc: Branch:
Release Notes:
API Changes:

Description

At the moment the changeset diff viewer correctly shows the difference between two files, however the start and end points are oddly positioned.

So for example this diff view shows the deletion starting at the closing "}" of the previous section:

Orignal start end diff.

In complex code this can be offputting, as it is really the second declaration that has simply been removed (including it's bracketed {…} section). However as the diff catches the closing }, you are then left with a closing } at the end of the diff.

Whilst technically still a correct diff, other systems (such as fisheye) are able to show the diff in a more intuitive way, by highlighting the removed section instead, mockup example:

Mockup of new start end diff

It would be a nice enhancement to change the diff viewer so it is more in line with removing the section rather than clipping the previous closing bracket.

Attachments (2)

diffoddstartend.png (4.3 KB ) - added by c.jones@… 9 years ago.
Orignal start end diff.
diffnewstartend.png (4.3 KB ) - added by c.jones@… 9 years ago.
Mockup of new start end diff

Download all attachments as: .zip

Change History (4)

by c.jones@…, 9 years ago

Attachment: diffoddstartend.png added

Orignal start end diff.

by c.jones@…, 9 years ago

Attachment: diffnewstartend.png added

Mockup of new start end diff

comment:1 by Christian Boos, 9 years ago

Keywords: performance added
Milestone: next-major-0.1X

Well, this is entirely dependent on the underlying diff algorithm used.

Some systems are using the diff output as given by the version control system, we're instead redoing the diffs using the difflib python module. The start/end point can vary according to the exact details of the algorithm, and the difflib perhaps doesn't produce the best looking ones by default.

We could actually switch to getting the diffs directly from the version control system, and only post-process them through our patch renderer. That could be certainly be way faster for some systems (git, mercurial), and git could be configured to produce "nice" diffs the way you probably expected (patience diff).

comment:2 by Peter Suter, 2 years ago

Keywords: diff added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set.
The owner will be changed from (none) to anonymous.

Add Comment


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