Feature #3988

Show diff in revision page

Added by Martin Bagge about 8 years ago. Updated about 4 years ago.

Status:ReopenedStart date:2009-10-07
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-
Resolution:

Description

In the revision browser it would be good to have the diff for the current revision. Trac does this and it is a really nice way to get a overview of the changes involved.
See the diffrences between these two links (not the same files but point proven):

The diff view that is accessible in Redmine today could be moved one step up (so I do not have to click the link). Maybe the best way would be to implement the feature as a option for the project to choose, the default view inline could also be chooseable here. Some projects might not want this because of the time it could take to generate the diffes if not cached. (I am sorry if this issue is addressed elsewhere, please direct me there in that case...)


mbagge@mbagge-1:~/redmine$ ruby script/about
About your application's environment
Ruby version              1.8.7 (x86_64-linux)
RubyGems version          1.3.4
Rails version             2.1.2
Active Record version     2.1.2
Action Pack version       2.1.2
Active Resource version   2.1.2
Action Mailer version     2.1.2
Active Support version    2.1.2
Application root          /home/mbagge/redmine
Environment               development
Database adapter          mysql

About your Redmine plugins
Scrumdashboard plugin          1.2
Redmine Repo Pygments plugin   0.0.2
Redmine Bugcloud plugin        0.0.2.1
Redmine Backlogs plugin        0.0.1

I am using SVN 0.8-stable btw.


Related issues

Related to Redmine - Feature #4266: Display changeset comment on repository diff view. Closed 2009-11-23
Related to Redmine - Feature #2762: Hide list of changed files on revision page Closed 2009-02-16
Related to Redmine - Feature #2372: Ideas for the Revisions page New 2008-12-22
Related to Redmine - Feature #1443: Making the Repository module as nice as the Trac one New 2008-06-13
Related to Redmine - Feature #6352: Showing diff of structural changes in repository New 2010-09-10
Duplicates Redmine - Feature #7139: Highlight changes inside diff lines Closed 2010-12-20

History

#1 Updated by Eric Davis about 8 years ago

  • Category set to SCM
  • Status changed from New to 7
  • Assignee set to Eric Davis

+1 I think providing the diff view on the revision view would be a nice improvement. That way the code can be reviewed along with the comment's about the revision. I'll take a look at implementing this.

#2 Updated by Jean-Philippe Lang about 8 years ago

This should include an on/off application setting. With #4015, we will be able to override at project level.

#3 Updated by Mischa The Evil almost 8 years ago

@ Eric: I've related the issue we've briefly discussed over IRC (#4266) to this issue.

#4 Updated by Eric Davis almost 7 years ago

  • Assignee deleted (Eric Davis)

#5 Updated by Sven M over 6 years ago

For me it's a very big disadvantage compared to Trac. I'd love to see this in redmine!

#6 Updated by random tao over 6 years ago

i think it's also related to #6352

#7 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from 7 to Closed
  • Resolution set to Duplicate

This issue feature is implemented in #7139.

#8 Updated by Martin Bagge over 6 years ago

  • Status changed from Closed to Reopened

what?
no this is not solved at all.

Path: .
URL: svn://rubyforge.org/var/svn/redmine/trunk
Repository Root: svn://rubyforge.org/var/svn/redmine
Repository UUID: e93f8b46-1217-0410-a6f0-8f06a7374b81
Revision: 5246
Node Kind: directory
Schedule: normal
Last Changed Author: jplang
Last Changed Rev: 5246
Last Changed Date: 2011-03-28 23:45:30 +0200 (Mon, 28 Mar 2011)

according to the issue you linked it was fixed in r5094 - however it is not. The issue you refer to is about showing the diff as bold not showing the actual diff at the revision information page.

#9 Updated by Toshi MARUYAMA over 6 years ago

  • Resolution deleted (Duplicate)

#10 Updated by Toshi MARUYAMA over 6 years ago

  • Subject changed from Show diff inline with revision to Show diff in revision page

#11 Updated by Christian Jennewein over 6 years ago

+1 from me too.

This is the very last feature that makes us keep TRAC parallel to Redmine. Would be great to have the changeset overview in Redmine too.

#12 Updated by Philipp Schüttlöffel over 5 years ago

I made a solution which works good for me, maybe someone is interrestet.

  • /app/controller/repositories_controller.rb:220 add the following lines:
    def revision
    +     @diff_type = 'inline'
    +     @cache_key = "repositories/diff/#{@repository.id}/" +
    +                           Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}-#{current_language}")
    +     @diff = @repository.diff(@path, @rev, @rev_to)
    
  • /app/views/repositories/revision.html.erb:92 add the following lines:
    <div class="changeset-changes">
    <%= render_changeset_changes %>
    </div>
    
    +<h3>Changes</h3>
    +<% cache(@cache_key) do -%>
    +<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
    +<% end -%>
    
    <% end %>
    

#13 Updated by yac yac about 5 years ago

+1

#14 Updated by cam lafit about 5 years ago

Hi

Thanks for your diff.
Work nicely.

Is it possible to create it as a plugin ? Should be better to maintain redmine (and update step)

Thanks

#15 Updated by Sylvain UTARD about 4 years ago

+1

Also available in: Atom PDF