Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3549 closed enhancement (fixed)

Shorter description of files in a changeset

Reported by: s.lipnevich@… Owned by: Christian Boos
Priority: lowest Milestone: 0.11
Component: version control/changeset view Version:
Severity: normal Keywords:
Cc: intgr@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

To make changeset file list more organized, Trac may calculate the longest common path for all files and list filenames relative to this path. Presently (using r3607 as an example):

Files: branches/debian-dev/sid/debian/changelog
       branches/debian-dev/sid/debian/control

Proposed:

Location: branches/debian-dev/sid/debian
Files:    changelog
          control

Attachments (0)

Change History (11)

comment:1 by Christian Boos, 18 years ago

Milestone: 0.11
Owner: changed from Jonas Borgström to Christian Boos

That was already requested for the Timeline (#3274), but the same code could be reused to implement this.

    location = os.path.dirname(os.path.commonprefix(files))

The idea is quite interesting, as I also have the need to deal with very deep repository structures at times…

comment:2 by Emmanuel Blot, 18 years ago

This should be implemented as an optional feature (i.e. with a config option in trac.ini)

comment:3 by anonymous, 18 years ago

Cc: intgr@… added

comment:4 by Christian Boos, 18 years ago

Ok, what about:

[changeset]
show_common_location = yes

comment:5 by Emmanuel Blot, 18 years ago

I'm not really good at picking option names, it's up to you ;-)

in reply to:  1 ; comment:6 by Matthew Good, 18 years ago

Replying to cboos:

    location = os.path.dirname(os.path.commonprefix(files))

Note that "commonprefix" works on sequences, which can lead to undesired behavior when using strings:

>>> files = ['trunk/trac/env.py', 'trunk/templates/index.cs']
>>> os.path.commonprefix(files)
'trunk/t'

So, it's usually best to split the strings on path separators, then join them back:

>>> '/'.join(os.path.commonprefix([f.split('/') for f in files]))
'trunk'

Replying to eblot:

This should be implemented as an optional feature (i.e. with a config option in trac.ini)

Why? I prefer not to make every UI change an option. Every option just makes trac.ini and its documentation larger and more confusing. I don't really see a particular reason not to display the base path of the changes.

in reply to:  6 comment:7 by Emmanuel Blot, 18 years ago

Replying to mgood:

Why? I prefer not to make every UI change an option. Every option just makes trac.ini and its documentation larger and more confusing. I don't really see a particular reason not to display the base path of the changes.

Because it would prevent from copy&pasting from the browser to a SVN client or an editor, for example. The added value for small changesets (i.e. a couple of changed files) isn't worth it, IMHO.

in reply to:  6 comment:8 by Christian Boos, 18 years ago

Thanks matt, I thought about that (that's why I did a os.path.dirname on the result), but the way you suggested is better as it copes with the case the common prefix itself is in the list (like this would happen for an addition or a prop change on the top dir).

As for the configurability of this, I also think it's a bit overkill. And even for the reason explained by manu, I think it's more something that the user should be able to tweak according to his own preferences, rather than the preference of the site administrator. Btw, we have a lot of little issues like that where it would actually be better to leave the ultimate decision up to the user (i.e. fetch the info from the session, and have a UI for managing this in the user Settings page).

comment:9 by Emmanuel Blot, 18 years ago

I have not thought about a per-session settings but you're absolutely right Christian, this would be a better option than a per-server setting. I still hope however that this new feature will not be implemented without a way to disable it (per-user setting would be nice)

comment:10 by Christopher Lenz, 18 years ago

For the record, I agree with Matt that we shouldn't add options unless it's really necessary. Options mean a lot of overhead: users need to learn about them, they need to be documented, you need to test changes with both paths (option enabled and disabled), etc.

In this particular case, I don't see any good reason why someone would not want to proposed behavior.

comment:11 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

So I think I have now a nice implementation for this one, see r4676.

For the use case mentioned by eblot (be able to copy the full entry), that's still possible when going on the diff section corresponding to each entry, as the path is still displayed in full in the diff heading.

If really there's strong pressure for making it possible to disable the feature, we can still add that option later, but first… try it out!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.