{"action":"created","issue":{"url":"https://api.github.com/repos/git-up/GitUp/issues/25","labels_url":"https://api.github.com/repos/git-up/GitUp/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/git-up/GitUp/issues/25/comments","events_url":"https://api.github.com/repos/git-up/GitUp/issues/25/events","html_url":"https://github.com/git-up/GitUp/pull/25","id":120760666,"number":25,"title":"Safer remote operations","user":{"login":"tomaz","id":77294,"avatar_url":"https://avatars.githubusercontent.com/u/77294?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaz","html_url":"https://github.com/tomaz","followers_url":"https://api.github.com/users/tomaz/followers","following_url":"https://api.github.com/users/tomaz/following{/other_user}","gists_url":"https://api.github.com/users/tomaz/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaz/subscriptions","organizations_url":"https://api.github.com/users/tomaz/orgs","repos_url":"https://api.github.com/users/tomaz/repos","events_url":"https://api.github.com/users/tomaz/events{/privacy}","received_events_url":"https://api.github.com/users/tomaz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/git-up/GitUp/labels/enhancement","name":"enhancement","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-12-07T12:07:53Z","updated_at":"2015-12-08T21:54:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/git-up/GitUp/pulls/25","html_url":"https://github.com/git-up/GitUp/pull/25","diff_url":"https://github.com/git-up/GitUp/pull/25.diff","patch_url":"https://github.com/git-up/GitUp/pull/25.patch"},"body":"I find it too easy to accidentally break remote (force push, delete branches etc.). This PR adds small tweak for such alerts so that confirm button is not marked as default. Instead user needs to either use mouse or tab+space to confirm, so gets more time to make sure that's what they want. This is off by default, so existing users are not affected, needs to be explicitly enabled.\r\n\r\nChanges:\r\n\r\n- Added `kGIAlertType_Danger` type which is used for potential data loss changes (mainly remote).\r\n- Added `GIViewControllerUserDefaultKey_SaferRemoteConfirmations` user default which enables/disabled this behavior (default = false).\r\n- Added preferences UI in advanced settings that changes above user default.\r\n\r\nAs far as UI change goes, it's convenient but can remain hidden preference with no UI as far as I'm concerned, set by handling `defaults` in Terminal - it's not something that will be tweaked daily. That's why I split PR into 2 commits; if UI change is not desired, I can remove last one, but having an option for preventing too easy data loss on remote is something I find crucial...\r\n\r\nThe reasoning behind this is: all GitUp alerts are confirmable simply by pressing enter. While all dangerous operations are guarded behind additional alert and use stop icon to differentiate, the behavior is still the same - just press enter to confirm. This behavior makes GitUp different from git command line - all \"force\" operations need to be explicitly invoked by user (by adding `--force` flag for example). Thus it's too easy to accidentally hit enter as a matter of habit when alert appears. This is additionally dangerous when user is expecting there will be 2 alerts, but there's only one. For example delete remote branch when there's no local counterpart - GitUp shows local and remote branches together at the top of the view, using the same font and color, the only difference is presence of slash symbol for remotes, and it's not as pronounced in angled as it would be in horizontal text (I find this aspect better with https://github.com/git-up/GitUp/pull/23)."},"comment":{"url":"https://api.github.com/repos/git-up/GitUp/issues/comments/163030139","html_url":"https://github.com/git-up/GitUp/pull/25#issuecomment-163030139","issue_url":"https://api.github.com/repos/git-up/GitUp/issues/25","id":163030139,"user":{"login":"tomaz","id":77294,"avatar_url":"https://avatars.githubusercontent.com/u/77294?v=3","gravatar_id":"","url":"https://api.github.com/users/tomaz","html_url":"https://github.com/tomaz","followers_url":"https://api.github.com/users/tomaz/followers","following_url":"https://api.github.com/users/tomaz/following{/other_user}","gists_url":"https://api.github.com/users/tomaz/gists{/gist_id}","starred_url":"https://api.github.com/users/tomaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomaz/subscriptions","organizations_url":"https://api.github.com/users/tomaz/orgs","repos_url":"https://api.github.com/users/tomaz/repos","events_url":"https://api.github.com/users/tomaz/events{/privacy}","received_events_url":"https://api.github.com/users/tomaz/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T21:54:07Z","updated_at":"2015-12-08T21:54:07Z","body":"Yes, had to resize the window, otherwise text wouldn't fit... Above suggestion is better and would fit 500pt, but still feels hard to grasp - had to read it couple times to \"get it\" and I'm the one working on the feature, so I can imagine it'll be an issue for others... (granted, I'm not native English speaker and it's been a long day here, so am not at the best :)\r\n\r\nI try to keep checkboxes in preferences short, and instead add smaller explanation label below - similar to \"Use simple mode\" option on general pane. Unless you're sure about it, I'd sleep it over and see if I can find an alternative. Feel free to update here if you get other solutions.\r\n\r\nSorry for indentation, Xcode \"fixed\" couple lines on my behalf... Can't change preferences though, need to keep 4 char tabs for all of my client work. Feels too cumbersome to switch between settings as I switch between projects."}}