'bzr diff' produces confusing, seemingly inaccurate diff for weird EOL marker issues
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Some how a file in my branch got the EOL markers messed up for a single line and it caused me all sorts of confusion. 'bzr diff' would show me a very confusing and seemingly inaccurate diff due to a spurious CR (or lack of LF) that caused the next line to overwrite part of the line before moving to the next.
example, bzr diff would show the following:
{% else %}
{% endif %} You're not authorized to access this page.
+I'm sorry. You're not authorized to access this page.
+{% endif %}
When the content of the file as shown in editor was:
{% else %}
I'm sorry. You're not authorized to access this page.
{% endif %}
Piping bzr diff through cat -v shows the following which is much less confusing:
{% else %}
-I'm sorry. You're not authorized to access this page.^M{% endif %}
+I'm sorry. You're not authorized to access this page.
+{% endif %}
Now that the mystery is solved this behavior is understandable but regardless its a horribly confusing and frustrating experience for the user.
tags: | added: check-for-breezy |
As discussed on IRC, the bug was encountered when looking at a loggerhead annotated version of the file.
bzr itself should still deliver the bytes present in the file and leave the interpretation of the ascii control chars to whatever viewer is used.