Project

General

Profile

Actions

Feature #4266

closed

Display changeset comment on repository diff view.

Added by Mischa The Evil over 14 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Category:
SCM
Target version:
Start date:
2009-11-23
Due date:
% Done:

0%

Estimated time:
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.


Files


Related issues

Related to Redmine - Feature #3988: Show diff in revision pageReopened2009-10-07

Actions
Related to Redmine - Feature #2372: Ideas for the Revisions page New2008-12-22

Actions
Related to Redmine - Feature #1443: Making the Repository module as nice as the Trac oneNew2008-06-13

Actions
Actions #1

Updated by Toshi MARUYAMA almost 13 years ago

  • Category changed from UI to SCM
Actions #2

Updated by Anonymous over 9 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.

Actions #3

Updated by Anonymous over 9 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.

Actions #4

Updated by Go MAEDA over 9 years ago

+1.

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

Actions #5

Updated by Anonymous over 9 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.

Actions #6

Updated by Anonymous over 9 years ago

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

Actions #7

Updated by Go MAEDA over 9 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.

Actions #8

Updated by Anonymous over 9 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.

Actions #9

Updated by Anonymous over 9 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.

Actions #10

Updated by Go MAEDA over 9 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.

Actions #11

Updated by Go MAEDA over 9 years ago

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

with patch applied:

Actions #12

Updated by Anonymous over 9 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.

Actions #13

Updated by Go MAEDA over 9 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.

Actions #14

Updated by Go MAEDA about 8 years ago

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

Actions #15

Updated by Go MAEDA about 8 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.

Actions #16

Updated by Anonymous about 8 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,

Actions #17

Updated by Jean-Philippe Lang about 8 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.

Actions

Also available in: Atom PDF