Patch #28295

Show name changes in diff preview

Added by Gregor Schmidt 7 months ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Attachments
Target version:4.0.0

Description

When previewing uploaded diff/patch files, which contains renames, Redmine will always show the new file name in the diff preview. This can be misleading, since it would not show that the old file was removed.

The attached patch keeps track of the previous file name and shows the additional information in the UI.

!Screen Shot 2018-03-05 at 14.48.00.png!

Please note, this patch was tested with/developed for git's patch files. Also, pure renames (without file modifications) will not be visible -- just like they are today.

0001-Show-renames-in-diff-preview.patch Magnifier (4.35 KB) Gregor Schmidt, 2018-03-05 14:58

Screen Shot 2018-03-05 at 14.48.00.png (8.04 KB) Gregor Schmidt, 2018-03-05 14:58

0001-Show-renames-in-diff-preview.patch Magnifier - updated version (v2) (4.51 KB) Gregor Schmidt, 2018-04-25 10:17

Associated revisions

Revision 17313
Added by Go MAEDA 5 months ago

Show renames in diff preview (#28295).

Patch by Gregor Schmidt.

History

#1 Updated by Gregor Schmidt 7 months ago

#2 Updated by Go MAEDA 6 months ago

  • Target version set to Candidate for next major release

#3 Updated by Go MAEDA 6 months ago

  • Target version changed from Candidate for next major release to 4.1.0

Nice improvement, setting target version to 4.1.0.

#4 Updated by Go MAEDA 6 months ago

  • Status changed from New to Needs feedback
  • Assignee set to Gregor Schmidt

The test RepositoriesGitControllerTest#test_diff_should_show_filenames fails on my environment. Would you look into this?

$ ruby test/functional/repositories_git_controller_test.rb
Run options: --seed 19867

# Running:

.......F

Failure:
RepositoriesGitControllerTest#test_diff_should_show_filenames [test/functional/repositories_git_controller_test.rb:432]:
<sources/watchers_controller.rb> expected but was
<copied_README>..
Expected 0 to be >= 1.

/path/to/gems/ruby/2.3.0/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `method': undefined method `test_diff_should_show_filenames' for class `Minitest::Result' (NameError)
    from /path/to/gems/ruby/2.3.0/gems/railties-5.1.4/lib/rails/test_unit/reporter.rb:70:in `format_rerun_snippet'
Rails version             5.1.4
Ruby version              2.3.3-p222 (x86_64-darwin16)
RubyGems version          2.6.10
Rack version              2.0.4

#5 Updated by Gregor Schmidt 5 months ago

Thank you for taking a look. Unfortunately, I didn't set up the test repositories. That's why I didn't catch the test failure.

Attached you may find an updated patch. Now all tests seem to pass fine.

#6 Updated by Go MAEDA 5 months ago

  • Status changed from Needs feedback to New
  • Assignee deleted (Gregor Schmidt)

Gregor Schmidt wrote:

Attached you may find an updated patch. Now all tests seem to pass fine.

Thanks, I confirmed that it passes all tests.

#7 Updated by Go MAEDA 5 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Committed. Thank you for your contribution.

Also available in: Atom PDF