Feature #4266
closedDisplay changeset comment on repository diff view.
0%
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
Updated by Anonymous over 10 years ago
- File _changeset.html.erb _changeset.html.erb added
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.
Updated by Anonymous over 10 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.
Updated by Go MAEDA over 10 years ago
+1.
Could you create a patch file in accordance with the instructions described in Patch in order to reproduce your work?
Updated by Anonymous over 10 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.
Updated by Anonymous over 10 years ago
...and here is a patch that adds the "(diff)" link to each changeset on the issue page to provide direct access.
Updated by Go MAEDA over 10 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.
Updated by Anonymous over 10 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.
Updated by Anonymous over 10 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.
Updated by Go MAEDA over 10 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.
Updated by Go MAEDA over 10 years ago
- File with_patch_applied.png with_patch_applied.png added
It is useful. I hope this patch to be adopted.
with patch applied:
Updated by Anonymous over 10 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.
Updated by Go MAEDA over 10 years ago
- File add_diff_link_to_issue_changesets_i18n.diff add_diff_link_to_issue_changesets_i18n.diff added
- File add_diff_link_to_issue_changesets_i18n.png add_diff_link_to_issue_changesets_i18n.png added
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.
Updated by Go MAEDA almost 9 years ago
Updated Jonathan Monahan's add_changeset_comment_to_diff_page.diff to make compatible with the current trunk (r15012).
Updated by Go MAEDA almost 9 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.
Updated by Anonymous almost 9 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,
Updated by Jean-Philippe Lang almost 9 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.