Bug 298804 - Context menu option 'Format files' is dangerous
Summary: Context menu option 'Format files' is dangerous
Status: RESOLVED DUPLICATE of bug 343895
Alias: None
Product: kdevelop
Classification: Applications
Component: file tree (show other bugs)
Version: git master
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-25 11:58 UTC by Romek
Modified: 2017-01-06 09:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Romek 2012-04-25 11:58:57 UTC
In project view there is an option to format files pointed by cursor. However, there is no confirmation dialog before action, so it is very easy to format all files of project with one click. Moreover, there is no information about what files has been formatted and no option for revert. 
So you can basically click on format files by accident and even don't notice all files has been formatted.

My story is, that when I wanted to commit changes done in few files I have been very surprised that all files in project has changed.
It is just my guess that I have accidentally clicked on format files while wanted to chose 'Find files'.

Reproducible: Always

Actual Results:  
Files formatted. No info about that. No option to undo.

Expected Results:  
Confirmation dialog before action.

Displayed status with info what files has been changed and possibility to do undo in some/all files.

Until those dialogs are ready I would recommend to move that option from project context menu to some more safe place like Edit menu.
Comment 1 Milian Wolff 2012-04-25 12:11:27 UTC
undo won't be implemented, use a VCS for that. a little dialog to warn the user about the action should be implemented though, agreed.
Comment 2 Romek 2012-04-26 07:56:23 UTC
Thank you for agreeing on warn dialog.

Unfortunately VCS cannot be always used easily to revert changes. In my case, formatting options caused some code to be eg. surrounded by {}. Such change cannot be easily filtered out by telling diff to ignore whitespace changes. So, I would opt for making an option for creating a diff (patch) before executing formatting, and then have an option to revert changes and apply the diff.  
However I understand this is quite complicated, and there are more important things to be changed prior to this.
Comment 3 Kevin Funk 2017-01-06 09:29:55 UTC
*** This bug has been marked as a duplicate of bug 343895 ***