Opened 15 years ago
Last modified 8 years ago
#9172 new enhancement
Trac diff highlighting start and end points
Reported by: | 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: | |||
Internal 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:
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:
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)
Change History (4)
by , 15 years ago
Attachment: | diffoddstartend.png added |
---|
comment:1 by , 14 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 , 8 years ago
Keywords: | diff added |
---|
Orignal start end diff.