Feature #4266

Display changeset comment on repository diff view.

Added by Mischa The Evil almost 8 years ago. Updated almost 2 years ago.

Status:ClosedStart date:2009-11-23
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:SCM
Target version:3.3.0
Resolution:Fixed

Description

To me it seems to be a useful change to include the changeset comment on the repo diff view. This way I have the comment on the changed code and the diff itself in one view. See e.g. changeset r3084. The changeset's diff view at http://www.redmine.org/projects/redmine/repository/revisions/3084/diff shows me the changeset ID and the actual changes as a diff. It doesn't show me the changeset comment, which can be handy IMO.

For directory-diffs which include more changesets I'd say to display only the first comment with a full desciption. The others can maybe displayed as links to prevent breaking the UI.

_changeset.html.erb Magnifier (1.26 KB) Jonathan Monahan, 2014-06-30 13:29

add_changeset_comment_to_diff_page.diff Magnifier (4.25 KB) Jonathan Monahan, 2014-07-01 09:36

add_diff_link_to_issue_changesets.diff Magnifier (1.11 KB) Jonathan Monahan, 2014-07-01 09:39

commit_message_displayed_3_times.png (67.7 KB) Go MAEDA, 2014-07-02 05:52

with_patch_applied.png (71.5 KB) Go MAEDA, 2014-07-05 07:30

add_diff_link_to_issue_changesets_i18n.diff Magnifier - i18n version (1.15 KB) Go MAEDA, 2014-07-06 04:12

add_diff_link_to_issue_changesets_i18n.png (33.9 KB) Go MAEDA, 2014-07-06 04:12

add_changeset_comment_to_diff_page_v2.diff Magnifier - compatible with r15012 (4.06 KB) Go MAEDA, 2016-01-09 08:01


Related issues

Related to Redmine - Feature #3988: Show diff in revision page Reopened 2009-10-07
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

Associated revisions

Revision 15139
Added by Jean-Philippe Lang almost 2 years ago

Adds changeset comments to diff view (#4266).

Patch by Go MAEDA.

Revision 15140
Added by Jean-Philippe Lang almost 2 years ago

Locals are not used in the partial (#4266).

Revision 15141
Added by Jean-Philippe Lang almost 2 years ago

Display the changeset details when the diff is for a single changeset only (#4266).

Revision 15142
Added by Jean-Philippe Lang almost 2 years ago

Adds links to changeset diff on the issue history (#4266).

Revision 15144
Added by Jean-Philippe Lang almost 2 years ago

Tests broken (#4266).

History

#1 Updated by Toshi MARUYAMA over 6 years ago

  • Category changed from UI to SCM

#2 Updated by Jonathan Monahan over 3 years ago

On my local installation I have abstracted part of app/views/repositories/revision.html.erb into a partial called _changeset.html.erb (attached). I could then reference it in both app/views/repositories/revision.html.erb and app/views/repositories/diff.html.erb with

<%= render :partial => 'changeset', :locals => {:repository => @repository, :changeset => @changeset} %>

This is a small change that I recommend because it makes reviewing changes made by other developers much easier.

#3 Updated by Jonathan Monahan over 3 years ago

On a related note, adding the following to app/views/issues/_changesets.html.erb is also helpful: providing a direct link from the changesets on an issue to the diff for each changeset:

        <%= link_to('(diff)',
               :controller => 'repositories',
               :action => 'diff',
               :id     => @issue.project,
               :repository_id => changeset.repository.identifier_param,
               :path   => "",
               :rev    => changeset.identifier) if changeset.filechanges.any? %>

I added this between the link_to_revision and <br /> tag, so you see a "(diff)" link after the "Revision xxxx" link.

#4 Updated by Go MAEDA over 3 years ago

+1.

Could you create a patch file in accordance with the instructions described in Patch in order to reproduce your work?

#5 Updated by Jonathan Monahan over 3 years ago

Here's a patch on http://svn.redmine.org/redmine/branches/2.5-stable that adds the changeset comment to the top of the diff page, the same as the changeset page.

#6 Updated by Jonathan Monahan over 3 years ago

...and here is a patch that adds the "(diff)" link to each changeset on the issue page to provide direct access.

#7 Updated by Go MAEDA over 3 years ago

Thanks for providing the patch.

I applied the patch "add_changeset_comment_to_diff_page.diff" to trunk(r13203) and got the following output. The commit message was displayed 3 times in revision page.

#8 Updated by Jonathan Monahan over 3 years ago

NOTE: my patch was prepared on http://svn.redmine.org/redmine/branches/2.5-stable NOT trunk. Also, you say that r13203 is trunk, but it isn't it is on the 2.4-stable branch.

#9 Updated by Jonathan Monahan over 3 years ago

Sorry, the link to r13203 is to the 2.4-stable branch. I guess you meant that you are up to date on trunk.

I cannot see any difference in revision.html.erb on trunk, 2.4-stable and 2.5-stable. I don't know what the problem is. It is working fine for us - we actually have vanilla 2.5.1 deployed with this patch.

#10 Updated by Go MAEDA over 3 years ago

I applied the patch "add_changeset_comment_to_diff_page.diff" to trunk(r13203) and got the following output. The commit message was displayed 3 times in revision page.

Sorry, it is problem of my environment. I repeated several times applying the patch and 'svn revert'. While doing the work, 'app/views/repositories/_changeset.html.erb' glowed 3 times larger repeating same code 3 times.

Your patch works fine on trunk. Thanks.

#11 Updated by Go MAEDA over 3 years ago

It is useful. I hope this patch to be adopted.

with patch applied:

#12 Updated by Jonathan Monahan over 3 years ago

Glad to hear it works for you Go MAEDA.

I see that you are not relating revisions to Redmine issues, but for anyone else, I recommend applying the other patch (add_diff_link_to_issue_changesets.diff) also, which gives you a direct link to that page from the changesets on the related issues.

#13 Updated by Go MAEDA over 3 years ago

The patch add_diff_link_to_issue_changesets.diff is nice. It reduces some clicks. I updated the patch for i18n(replaced English word 'diff' with :label_diff).

I think you would be better to create a new issue about this because the patch seems introducing another feature.

#14 Updated by Go MAEDA almost 2 years ago

Updated Jonathan Monahan's add_changeset_comment_to_diff_page.diff to make compatible with the current trunk (r15012).

#15 Updated by Go MAEDA almost 2 years ago

  • Target version set to 3.3.0

add_changeset_comment_to_diff_page_v2.diff and add_diff_link_to_issue_changesets_i18n.diff can be applied cleanly to the current trunk.
I wish these are included in next feature release.

#16 Updated by Jonathan Monahan almost 2 years ago

FYI: I've just found a bug in my original patch, and it is still in the latest patch add_diff_link_to_issue_changesets_i18n.diff from Go MAEDA. The link refers to the project of the issue, rather than the project of the changeset:

:id     => @issue.project,

should be changed to
:id     => changeset.repository.project,

#17 Updated by Jean-Philippe Lang almost 2 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Feature added. I've made a few changes so that the changeset details on the diff are displayed when the diff is for a single changeset only. Thanks.

Also available in: Atom PDF