Bug 183625 - Unversioned files should be shown last in the commit dialog
Summary: Unversioned files should be shown last in the commit dialog
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: vcs (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2009-02-07 23:11 UTC by Thomas McGuire
Modified: 2016-02-01 23:16 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas McGuire 2009-02-07 23:11:09 UTC
Version:            (using KDE 4.2.0)
OS:                Linux
Installed from:    Compiled From Sources

in the commit dialog, KDevelop shows both modified versioned files and all unversioned files.
Modified versioned files should be shown first in the list.
Also, an option to hide unversioned files would also be nice.
Comment 1 Andreas Pakulat 2009-02-08 00:54:10 UTC
Hmm, I'm not sure how useful that is, after all the reason why unversioned files show up in the dialog in the first place is so you can check wether you've forgot to add any of them to the VCS (yes I know there's no support yet to actually do that in kdevelop).

IMHO having the entries sorted by the path and alphabetically is best, I'm also planning on having them arranged according to their path in a tree structure.

So can you please elaborate a bit why you'd like to separate already-versioned and unversioned files like that?
Comment 2 Thomas McGuire 2009-02-08 13:51:52 UTC
Most of the time, the unversioned files are things which I want to keep unversioned, and I was just too lazy to add to svn:ignore.

When I tried the commit dialog, I actually had to scroll down to find the file that I really modified, because I had so many unversioned files before that.

Since checking in modified files is much more common than checking in new files, I think listing the versioned files first makes more sense.

The sort order would then be:
1. versioned/unversioned
2. alphabetically/by path
Comment 3 Kevin Funk 2016-02-01 23:16:15 UTC
Git commit a9f2f45554a618d69dee65f1b16f4d6ef1a4eea0 by Kevin Funk, on behalf of Artur Puzio.
Committed on 01/02/2016 at 23:15.
Pushed by kfunk into branch '5.0'.

Vcs: Fix sorting of files in the commit dialog

Summary:
This fixes [[ https://bugs.kde.org/show_bug.cgi?id=183625 | Bug 183625 ]]
In the commit dialog files whern't sorted. They are showed using VcsFileCHangesModel. I overloaded `operator <` of `VcsStatusInfoItem` to sort them. The sorting rules are:
1. versioned files before uneversioned
2. alphabetically (by path)

Details:
Added possibility to access the state of file in `VcsFileChangesModel` (not used in the end)
Introduced `enum ColumnsRoles` in `VcsFileChangesModel`: `{ PathColumn = 0, StatusColumn = 1 }` (not used in the end)
Overloaded `operator <` of `VcsStatusInfoItem` to compare according to the rules
Used `QSortFilterProxyModel` in patchreviewtoolview to sort the list of changed files

Test Plan: Manually testing revealed no problems.
Reviewers: kfunk

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D862

M  +5    -1    plugins/patchreview/patchreviewtoolview.cpp
M  +3    -0    plugins/patchreview/patchreviewtoolview.h
M  +20   -1    vcs/models/vcsfilechangesmodel.cpp
M  +15   -1    vcs/models/vcsfilechangesmodel.h

http://commits.kde.org/kdevplatform/a9f2f45554a618d69dee65f1b16f4d6ef1a4eea0