I've spent a fair amount of time trying to fix this issue and have yet
to come up with a clean solution or find any posts regarding this. I
wanted to post and get peoples thoughts on what to do and if I should
be submitting a bug for this.

The problem I am having regards differences in tabs (4 spaces) and how
the review board diff viewer displays them. Before I go any further,
here is a small example of a code change that generates this issue:

Original Code:

1a.    do this;
2a.    then this;
3a.    then another thing;

Modified Code:

1b.    if(some condition to make sure executing is safe)
2b.    {
3b.        do this;
4b.        then this;
5b.        then another thing;
6b.    }

When the Diff Viewer opens this, everything gets a little hairy (just
to be clear, my team uses perforce and runs the rbtools post-
review.exe to create new reviews with the diffs). The viewer does not
figure out that the spacing has changed on all of the lines inside the
if statement and just label the if statement and its brackets as being
new. Some lines on the inside of the function are marked as yellow (as
spacing changes) and a majority of the change is labeled as removed in
the original file and new code in the modified file. In addition to
the changes not being labeled properly, code gets mismatched as well.
Using the above example, it might say line 1a is deleted and match up
lines 2a and 3b saying there was only a spacing change (yellow

This issue varies per situation as I have seen some diffs show the
entire function as removed and added again, and other times there are
different chucks that it properly recognized as simply spacing changes
with some mismatching here and there. It proves to be very annoying
and time consuming for someone to review these types of changes and it
would be awesome to figure out a way to fix this.

I dove into the diff tool that post-review.exe uses (Windows GNUTools
diff.exe version 2.7.8) and tried to run the diff using -b. The
reviewboard diff viewer gets the proper changes (it only displays the
if statement and its brackets). Its possible this might be a
limitation of the GNUTools diff tool. This however was not a good
solution for my team as the people reviewing need to make sure that
code standards are being followed regarding spacing.

If anyone has any thoughts on this, help would be greatly appreciated.

-Matt T

Want to help the Review Board project? Donate today at 
Happy user? Let us know at http://www.reviewboard.org/users/
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to