Edgewall Software

Ticket #5549 (new defect)

Opened 19 months ago

Last modified 2 months ago

Improve diff message "no files"

Reported by: eblot Owned by: cboos
Priority: normal Milestone: 0.12
Component: version control/changeset view Version: devel
Severity: normal Keywords: patch
Cc:

Description

When a changeset contains only minor modifications (blank line, whitespace changes ...) and the matching "ignore" checkboxes are selected, Trac outputs a confusing message:

(No files)

whereas the actual message should be something like "(No visible changes)", as the changeset does contain files, but the selected diff options lead to an empty diff.

This is confusing especially as Trac conveniently keeps track of the user diff preferences from one diff to another - which implies that a user can get a "(No files)" message as soon as he wants a diff.

Attachments

minimal-hidden_properties-diff-rendering.patch (1.0 KB) - added by cboos 13 months ago.
Show at least Property xyz changed for a change of a hidden property, so that there's at least one file entry in the Files: list.

Change History

  Changed 13 months ago by sid

  • keywords patch added

Simple patch to fix this issue:

  • trac/versioncontrol/templates/changeset.html

     
    135135          <dt class="property location">Location:</dt> 
    136136          <dd class="searchable"><a href="${req.href.browser(location, rev=new_rev)}">$location</a></dd> 
    137137        </py:if> 
    138         <dt class="property files">${files and 'Files:' or '(No files)'}</dt> 
     138        <dt class="property files">${files and 'Files:' or '(No visible changes)'}</dt> 
    139139        <dd class="files"> 
    140140          <div class="legend" id="file-legend" py:if="filestats"> 
    141141            <dl> 

  Changed 13 months ago by cboos

  • milestone set to 0.11.1

  Changed 13 months ago by osimons

Any reason why this cannot just be committed? The new text provides good information, both for whitespace and hidden properties that can make a changset appear completely empty.

  Changed 13 months ago by cboos

  • milestone changed from 0.11.1 to 0.11

That change is fine for me, we can commit it.

  Changed 13 months ago by osimons

Actually, that did not turn out so nice with regards to formatting. There is only room for 1-2 words, so it breaks a line and just looks a bit out of place on the side of the page.

Alternative proposal:

  • trac/versioncontrol/templates/changeset.html

     
    135135          <dt class="property location">Location:</dt> 
    136136          <dd class="searchable"><a href="${req.href.browser(location, rev=new_rev)}">$location</a></dd> 
    137137        </py:if> 
    138         <dt class="property files">${files and 'Files:' or '(No files)'}</dt> 
     138        <dt class="property files">Files:</dt> 
    139139        <dd class="files"> 
     140          <py:if test="not files">No files with visible changes.</py:if> 
    140141          <div class="legend" id="file-legend" py:if="filestats"> 
    141142            <dl> 
    142143              <py:if test="filestats['add']"><dt class="add"></dt><dd>${filestats['add']} added</dd></py:if> 

I basically renders:

Files: No files with visible changes.

That will also give better space for future l10n messages that might need more room.

Only question: Any reason why it should not render correctly being placed inside the <dd> tag? Any circumstance where it will not be alone, or why we can't have just text instead of the ususal lists?

  Changed 13 months ago by cboos

That latest change is better. Still, I think that for "perfect" clarity we should make clear whether the list of files is empty because there's no files in the changeset or no visible change according to the current diff options.

I'm OK for committing the intermediate improvement of comment:5, but maybe leave the ticket open for 0.11.1 as a reminder to implement the above.

  Changed 13 months ago by osimons

When testing this, I found that even property changes rendered as a file. I was not able to think of anything (using Subversion) that could make a change without listing some file - ie. in all circumstances it was diff options that made this list appear.

Perhaps with other versioncontrol systems? Could there be circumstances with full diff that as change is made that has no file references? The versioncontrol code is really not what I know best...

  Changed 13 months ago by cboos

Well, the situations I had in mind for the no files were admittedly corner cases.

The first was when a property change is hidden on purpose ([browser] hide_properties), e.g. r5705.

The second situation was root property change. But in this case we generate a pseudo-"(root)" file entry.

So the only confusing situation would be r5705, as there's no way a change of diff options will make that prop change visible.

I'll attach a patch shortly that would instead render this minimal information about the hidden property change:

  • i18n

    • Property svnmerge-integrated changed

That will give some hint about what's going on in changesets like r5705, while preserving the uncluttered view that hide_properties was meant to provide.

Changed 13 months ago by cboos

Show at least Property xyz changed for a change of a hidden property, so that there's at least one file entry in the Files: list.

  Changed 13 months ago by cboos

Ah, and of course, besides the above corner cases that are now addressed, there's one more situation to think about: changesets restricted on a path outside of the scope of the changeset, e.g. [6334/sandbox]. In this case, it's a legitimate (No files).

follow-up: ↓ 11   Changed 12 months ago by anonymous

are there also changesets that could be empty due to permission settings, ie, you don't have permission to see the changed files?

in reply to: ↑ 10   Changed 11 months ago by osimons

Replying to anonymous:

are there also changesets that could be empty due to permission settings, ie, you don't have permission to see the changed files?

Yes. Both regular permissions, and I Just configured a project today myself where anonymous has CHANGESET_VIEW for seeing changesets in Timeline and reading log messages, but no FILE_VEW permissions to see the changed files. That will actually list (No files.) for all changesets.

follow-up: ↓ 13   Changed 11 months ago by cboos

  • severity changed from minor to normal
  • milestone changed from 0.11 to 0.12

This issue is less trivial than it seemed at first. I think we should keep the (No files) for now and improve that message once with the correct information later on:

  • "(No files)" when this is effectively a changeset without files (i.e. property changes only)
  • "(No files in the restricted scope)" when there are files in the changeset but outside of the restricted path
  • "(No visible changes)" when there should be files but there's no changes to show because of the current diff options
  • more?

in reply to: ↑ 12   Changed 2 months ago by eblot

Replying to cboos:

This issue is less trivial than it seemed at first. I think we should keep the (No files) for now and improve that message once with the correct information later on:

The current implementation is unsettling for the end user.
If a changeset only contains property change(s):

  • the diff view shows "(No files)" - and nothing more, while
  • the changeset view shows the actual property change (with the property name and value)

  Changed 2 months ago by cboos

  • milestone changed from 0.13 to 0.12

Add/Change #5549 (Improve diff message "no files")

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from cboos. Next status will be 'new'
The owner will change from cboos to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.