Ignore White space changes

47 views
Skip to first unread message

Kim Rydhof Thor Hansen

unread,
May 5, 2014, 10:01:09 AM5/5/14
to trac-...@googlegroups.com
Hi Trac Users

I don't understand why line 1333 is marked as having changes in ​http://trac.edgewall.org/changeset/12739/trunk/trac/ticket/web_ui.py when "Ignore White space changes" is enabled, is that a bug?

Regards
Kim Hansen

RjOllos

unread,
May 7, 2014, 12:36:40 AM5/7/14
to trac-...@googlegroups.com
I suspect it is probably handled differently because it is part of a block that includes non-whitespace changes. We could dig into the code to try and determine if this was intentional or an oversight, but I'm not bothered too much by the behavior for this particular case. It could be more troubling for the case that a large block of code is indented and wrapped in a conditional statement. There you really want to ignore whitespace so that you can see that the only change is the addition of a single line. I'd be interested to see if this same behavior is reproduced for that case.

Kim Rydhof Thor Hansen

unread,
May 7, 2014, 2:23:34 AM5/7/14
to trac-...@googlegroups.com

This particular case is just the first example of problem I could find on trac.edgewall.org, I noticed the problem when a changeset in my personal Trac installation was 100's of lines long when "git diff -w" only showed about 10 lines after I had reformatted some code.

Kim

Jun Omae

unread,
May 9, 2014, 4:29:00 AM5/9/14
to trac-...@googlegroups.com
On Wed, May 7, 2014 at 1:36 PM, RjOllos <rjo...@gmail.com> wrote:
> I suspect it is probably handled differently because it is part of a block
> that includes non-whitespace changes. We could dig into the code to try and
> determine if this was intentional or an oversight, but I'm not bothered too
> much by the behavior for this particular case. It could be more troubling
> for the case that a large block of code is indented and wrapped in a
> conditional statement. There you really want to ignore whitespace so that
> you can see that the only change is the addition of a single line. I'd be
> interested to see if this same behavior is reproduced for that case.

The same behavior in http://trac.edgewall.org/changeset/10457.
"Ignore space changes" doesn't seem it works in the page.
The changeset almost is indentation changes.

The following page in github works fine.
https://github.com/edgewall/trac/commit/80d83370?w=1 (ignore whitespaces)

Also, I tried to fix the issue. See 2 attached diff files.

--
Jun Omae <jun...@gmail.com> (大前 潤)
diff_ignore_ws_1.0-stable.diff
diff_ignore_ws_0.12-stable.diff

Kim Rydhof Thor Hansen

unread,
May 12, 2014, 2:20:04 AM5/12/14
to trac-...@googlegroups.com

On Friday, May 9, 2014 10:29:00 AM UTC+2, Jun Omae wrote:

Also, I tried to fix the issue. See 2 attached diff files.
 

I just tried your fix on my 0.12 installation and it works perfectly, thanks!

It would be really great to get this fix upstream as it makes reviewing of patches that fixes indenting in e.g. C++ a lot easier.

Regards,
Kim Hansen

Jun Omae

unread,
May 14, 2014, 12:07:33 AM5/14/14
to trac-...@googlegroups.com
Thanks for the feedback! Could you please create a new ticket on
trac.edgewall.org/newticket about the issue?

RjOllos

unread,
Jul 22, 2014, 7:02:05 PM7/22/14
to trac-...@googlegroups.com


Created ticket #11687 for the issue. I'll test out your changes.

http://trac.edgewall.org/ticket/11687
Reply all
Reply to author
Forward
0 new messages