Vote #70624
完了Partial diff comparison should be done on actual code, not on html
0%
説明
Semicolons were mysteriously appearing in code diffs in the repository, but only when viewed in Redmine. Upon investigation, it became clear that this is because the semicolon was not part of the diff, but was just after it. Since part of the line that changed is enclosed in tags, when the change ends in the old and new versions with distinct HTML special chars, the semicolon terminating the special chars is treated as if it hadn't changed.
Observe, in the example below, how > and & should each be treated as a single unit, but is instead handled one char at a time, making it appear that ">" became "&" and that the ";" didn't change.
47 void DoSomething(std::auto_ptr<MyClass> myObj)
47
void DoSomething(const MyClass& myObj)
I suspect this is a result of the fact that the code in the repository is first rendered as html, and then passed to the engine that analyzes where the changes are. This should be done in the opposite order.
journals
I can't reproduce with r6753; could you please attach an example file?
And what about the format of the file downloaded via the "Unified diff" link on the bottom of the page?
Finally, do you have any plugins installed which could interfere?
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
The semicolon does not appear in the unified diff when viewed in Tortoise diff, Notepad++ or Chrome. It also does not appear when I view the diff from our git server. It only appears in html when using Redmine.
Unfortunately, I cannot attach a code sample. The sample in the description above demonstrates the issue clearly. Could you describe the steps by which you attempted to reproduce it?
--------------------------------------------------------------------------------
Indeed, something is wrong with source:/trunk/lib/redmine/unified_diff.rb#L149 and @#line*@ methods.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Fixed in r8876.
--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------
related_issues
relates,Closed,2371,character encoding for attachment file
duplicates,Closed,9440,Escaping issue with inline diff-highlighting in revision diff view