529: Whitespace not ignored

veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
July 2, 2008
There is a bug in myersdiff.py in function _gen_diff_codes(self, lines).
The "temp" is never assigned to "line".

Change from:
                # We still want to show lines that contain only whitespace.
                if temp != "":
                    line = temp

To:

                # We still want to show lines that contain only whitespace.
                if temp != "":
                    line = temp

                line = temp
#1 veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
sorry, ignore this. I had made some changes to the code which caused my problems.
chipx86
#2 chipx86
  • +UserError
#3 veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
But, what is the reason for:

                # We still want to show lines that contain only whitespace.
                if temp != "":
                    line = temp

?

This will show "empty"/"space diff only" lines as yellow. That might not always be
desirable. 

It should also be an option if you want to do left strip only (as it is now), or both
left and right strip, i.e., switch between

 if self.ignore_space:
                temp = line.lstrip()

and 

 if self.ignore_space:
                temp = line.strip()

#4 veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Example of whitespace-only lines shown as different => confusing if there are a lot
of other changes as well.
chipx86
#5 chipx86
You're saying any lines containing only whitespace show up as that? That's certainly
not happening in any install I've seen. Maybe I don't understand.
#6 veste*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Yes, whitespace only. Using trunk version of reviewboard, svn diff.