html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/4218#issuecomment-1100945568,https://api.github.com/repos/pydata/xarray/issues/4218,1100945568,IC_kwDOAMm_X85Bnxig,5635139,2022-04-17T20:34:32Z,2022-04-17T20:34:32Z,MEMBER,"> As long as you don't force push (which is disabled), I think the preferred option for dealing with accidentally pushed changes is to push a ""revert"" commit generated from `git revert` I think that's the right approach, so closing. Feel free to reopen though","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-1100938839,https://api.github.com/repos/pydata/xarray/issues/4218,1100938839,IC_kwDOAMm_X85Bnv5X,26384082,2022-04-17T19:43:45Z,2022-04-17T19:43:45Z,NONE,"In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the `stale` label; otherwise it will be marked as closed automatically ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657275143,https://api.github.com/repos/pydata/xarray/issues/4218,657275143,MDEyOklzc3VlQ29tbWVudDY1NzI3NTE0Mw==,14808389,2020-07-12T21:06:38Z,2020-07-12T21:07:33Z,MEMBER,"this was actually not that dangerous since everyone who synced the git history (i.e. at least @max-sixty) before that accident had a full ""backup"" of the commit history. Would it make sense to add a section for ""people with commit access"" to `contributing.rst`? I imagine this could be useful as a reference and for new maintainers...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657273886,https://api.github.com/repos/pydata/xarray/issues/4218,657273886,MDEyOklzc3VlQ29tbWVudDY1NzI3Mzg4Ng==,6815844,2020-07-12T20:55:53Z,2020-07-12T20:55:53Z,MEMBER,"> I think the preferred option for dealing with accidentally pushed changes is to push a ""revert"" commit generated from git revert OK, understood. > but as long as we keep the master branch protected, it's always possible always possible to move forward by reverting changes -- there is no way to lose work. Then, probably the most dangarous part was when I unprotected the master branch. I was afraid of messing up the commit history, but it is much better than losing entire commit history...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657261588,https://api.github.com/repos/pydata/xarray/issues/4218,657261588,MDEyOklzc3VlQ29tbWVudDY1NzI2MTU4OA==,1217238,2020-07-12T18:59:08Z,2020-07-12T18:59:08Z,MEMBER,"But anyways, this is not a big deal at all! Git makes it very easy to mess things up, but as long as we keep the master branch protected, it's always possible always possible to move forward by reverting changes -- there is no way to lose work.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657261331,https://api.github.com/repos/pydata/xarray/issues/4218,657261331,MDEyOklzc3VlQ29tbWVudDY1NzI2MTMzMQ==,1217238,2020-07-12T18:56:53Z,2020-07-12T18:56:53Z,MEMBER,"As long as you don't force push (which is disabled), I think the preferred option for dealing with accidentally pushed changes is to push a ""revert"" commit generated from `git revert`","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657258662,https://api.github.com/repos/pydata/xarray/issues/4218,657258662,MDEyOklzc3VlQ29tbWVudDY1NzI1ODY2Mg==,5635139,2020-07-12T18:30:40Z,2020-07-12T18:30:40Z,MEMBER,"It looks like @keewis isn't in https://github.com/orgs/pydata/teams/xarray/members so he couldn't change the permissions, can we change that? I think only @shoyer can add people to that team. Me and @jhamman seem to be in both that team and added to https://github.com/pydata/xarray/settings/access, which seems redundant (though not causing any bad outcomes either)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657258596,https://api.github.com/repos/pydata/xarray/issues/4218,657258596,MDEyOklzc3VlQ29tbWVudDY1NzI1ODU5Ng==,5635139,2020-07-12T18:30:07Z,2020-07-12T18:30:07Z,MEMBER,"No stress @fujiisoup ! Glad this worked out. We could disable push access and then people can manually re-enable when necessary. But no strong view.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657210253,https://api.github.com/repos/pydata/xarray/issues/4218,657210253,MDEyOklzc3VlQ29tbWVudDY1NzIxMDI1Mw==,14808389,2020-07-12T11:39:58Z,2020-07-12T13:23:34Z,MEMBER,"you could try to undo that by: getting the hash of the latest commit (7bf9df9d75c40bcbf2dd28c47204529a76561a3f right now), then calling ```sh git reset git push -f ``` Since I've been afraid of that mistake as well, I added a git hook that makes git refuse to push to `master` and `stable` on the main repository (use `--no-verify` to override it): ```bash $ cat .git/hooks/pre-push #!/usr/bin/env bash protected_remotes=""origin"" protected_branches=""master stable"" isin() { local list=""$1"" local substring=""$2"" for element in $list do [[ ""$element"" == ""$substring"" ]] && return 0; done return -1; } readonly() { remote=""$1"" branch=""$2"" if isin ""$protected_remotes"" ""$remote"" && isin ""$protected_branches"" ""$branch"" then return 0; else return -1; fi } remote=""$1"" IFS="" "" while read local_ref local_sha remote_ref remote_sha do branch=""$(echo $remote_ref | sed 's#^refs/heads/##g')"" if readonly ""$remote"" ""$branch"" then echo ""cannot push to $remote/$branch: protected branch. Use --no-verify to override this."" exit -1 fi done ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657215217,https://api.github.com/repos/pydata/xarray/issues/4218,657215217,MDEyOklzc3VlQ29tbWVudDY1NzIxNTIxNw==,6815844,2020-07-12T12:26:41Z,2020-07-12T12:26:41Z,MEMBER,"OK, thanks. > So I think either a pre-push hook or git config branch.master.pushRemote no_push (but then you also can't push to your own master anymore) are the best way forward Agreed. I'll use your pre-push hook. Thanks @keewis .","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657213126,https://api.github.com/repos/pydata/xarray/issues/4218,657213126,MDEyOklzc3VlQ29tbWVudDY1NzIxMzEyNg==,14808389,2020-07-12T12:07:49Z,2020-07-12T12:10:35Z,MEMBER,"see this [SO question](https://stackoverflow.com/questions/46146491/prevent-pushing-to-master-on-github). However, I don't think we should try that since there are a few cases where you still need to push without a PR (releasing, mainly). So I think either a pre-push hook or `git config branch.master.pushRemote no_push` (but then you also can't push to your own master anymore) are the best way forward","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657212192,https://api.github.com/repos/pydata/xarray/issues/4218,657212192,MDEyOklzc3VlQ29tbWVudDY1NzIxMjE5Mg==,6815844,2020-07-12T11:59:11Z,2020-07-12T11:59:11Z,MEMBER,"BTW, is it possible to disallow direct push to master on github? Maybe we only need to *merge* PRs and but not *push*.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657211959,https://api.github.com/repos/pydata/xarray/issues/4218,657211959,MDEyOklzc3VlQ29tbWVudDY1NzIxMTk1OQ==,6815844,2020-07-12T11:56:34Z,2020-07-12T11:56:34Z,MEMBER,"OK. Done. Thanks. I'll use your script. Thanks. And sorry again for my mistake.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657211714,https://api.github.com/repos/pydata/xarray/issues/4218,657211714,MDEyOklzc3VlQ29tbWVudDY1NzIxMTcxNA==,14808389,2020-07-12T11:54:41Z,2020-07-12T11:54:41Z,MEMBER,"oh, yeah. Then someone with the appropriate permissions (you? or maybe @shoyer?) has to temporarily remove the branch protection (settings on github), force push, and then add back the branch protection.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657211712,https://api.github.com/repos/pydata/xarray/issues/4218,657211712,MDEyOklzc3VlQ29tbWVudDY1NzIxMTcxMg==,6815844,2020-07-12T11:54:40Z,2020-07-12T11:54:40Z,MEMBER,"Maybe I can unprotect the master, but I'm hesitating this action...","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009 https://github.com/pydata/xarray/issues/4218#issuecomment-657211365,https://api.github.com/repos/pydata/xarray/issues/4218,657211365,MDEyOklzc3VlQ29tbWVudDY1NzIxMTM2NQ==,6815844,2020-07-12T11:51:31Z,2020-07-12T11:51:31Z,MEMBER,"Thanks. but it looks the master is protected and I cannot force push. ``` Total 0 (delta 0), reused 0 (delta 0) remote: error: GH006: Protected branch update failed for refs/heads/master. remote: error: Cannot force-push to this protected branch To https://github.com/pydata/xarray.git ! [remote rejected] master -> master (protected branch hook declined) error: failed to push some refs to 'https://github.com/pydata/xarray.git' ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,655382009