プロジェクト

全般

プロフィール

Vote #70624

完了

Partial diff comparison should be done on actual code, not on html

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
SCM_3
対象バージョン:
開始日:
2011/08/29
期日:
進捗率:

0%

予定工数:
category_id:
3
version_id:
42
issue_org_id:
9143
author_id:
38993
assigned_to_id:
1
comments:
9
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
38
ステータス-->[Closed]

説明

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 "&gt" became "&amp" and that the ";" didn't change.

 
  47 
   
   
    
void DoSomething(std::auto_ptr<MyClass>; myObj)




47

void DoSomething(const MyClass&amp; 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

Admin Redmine さんが3年以上前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョン1.3.2_42 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0