From 0b5ae3ccbfa36104477c17d6455ea9a0625cfc75 Mon Sep 17 00:00:00 2001 From: Robert O'Connor Date: Wed, 16 May 2018 16:57:02 -0400 Subject: [PATCH] Remove magit-gh-pulls as magithub is so much better! --- CHANGELOG.develop | 4 +-- CONTRIBUTING.org | 34 ++++++++--------------- layers/+source-control/github/README.org | 18 ------------ layers/+source-control/github/funcs.el | 6 ---- layers/+source-control/github/packages.el | 16 ----------- 5 files changed, 13 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.develop b/CHANGELOG.develop index 15c81918f..c18e0a91e 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -1153,13 +1153,13 @@ Benner and Paweł Siudak): - Add package =magithub=, it is enabled by default in offline mode. - Remove package =github-browse-file= which has been replaced by =browse-at-remote= in =version-control= layer + - Remove package =magit-gh-pulls= as it was deprecated in favor of =magithub= + and =forge= (thanks to Robby O'Connor ) - Key bindings: - For Evil style users, the key-binding to pull commits is now on ~p~ instead of ~F~ which is taken by the new package =forge= - Add ~g r~ evilified binding to gist-list-mode (thanks to Jean-Sebastien A. Beaudry) - - Fix ~#~ key binding in =magit-status= for the =magit-gh-pulls= dispatch - popup (thanks to Diego Berrocal) - Replace =evilified-state-evilify= by =evilified-state-evilify-map= (thanks to Sylvain Benner) - Make magithub offline by default (thanks to Miciah Masters) diff --git a/CONTRIBUTING.org b/CONTRIBUTING.org index 685d7d167..1a75d7bb9 100644 --- a/CONTRIBUTING.org +++ b/CONTRIBUTING.org @@ -270,30 +270,18 @@ changes, your review is very valuable in these cases as well! ** Using Magit to quickly test PRs It is possible to manage PRs directly inside the Magit status buffer ~SPC g s~. First add the =github= layer to your dotfile which will pull the package -=magit-gh-pulls=. Since we have a high number of PRs in Spacemacs you also need -to set the variable =magit-gh-pulls-pull-detail-limit= to a higher number, it -is recommended to set it to something like 200. +=forge=. Once installed you need to set it up with a [[GitHub personal access +token][https://magit.vc/manual/ghub/Getting-Started.html#Getting-Started]] after +which you can execute ~M-x forge-pull~. It will fetch all the PRs which may take +a few seconds as we have lot of PRs. Note also that all your Magit actions will +get some additional delay due to the refresh of the PRs list. -#+BEGIN_SRC elisp - (setq-default dotspacemacs-configuration-layers - '((github :variables magit-gh-pulls-pull-detail-limit 200))) -#+END_SRC - -You can also set the variable in your =dotspacemacs/user-init= function. - -Now you are all set open the Magit status buffer of your =.emacs.d= repository -and press ~#g~. It will fetch all the PRs which may take a few seconds as we -have lot of PRs. Note also that all your Magit actions will get some additional -delay due to the refresh of the PRs list. - -Search for the line of the PR you are interested in and press ~#f~ to actually -fetch its commits. - -From here you have several possibilities: -- you can select all the commits of a PR and do ~AA RET~ to cherry-pick them - on top of your current branche, -- you can create a branch pointing on the PR branch HEAD using ~#b~, -- you can merge the PR branch with ~#m~. +Now, from the magit status buffer you can: +- checkout a PR with ~b y~ and searching it by name or ID +- donate all commits to develop by doing ~A d~ and selecting your current branch + first and the develop branch second +- switch to the develop branch by pressing ~b b~ and selecting it +- delete the PR branch and remote by doing ~b x~ and selecting it * Additional information ** Testing diff --git a/layers/+source-control/github/README.org b/layers/+source-control/github/README.org index e52a2cd83..b9e462b7f 100644 --- a/layers/+source-control/github/README.org +++ b/layers/+source-control/github/README.org @@ -11,7 +11,6 @@ - [[#hub-configuration][Hub configuration]] - [[#magithub-configuration][Magithub configuration]] - [[#key-bindings][Key bindings]] - - [[#magit-gh-pulls][magit-gh-pulls]] - [[#magithub][magithub]] - [[#forge][forge]] - [[#gistel][gist.el]] @@ -21,7 +20,6 @@ This layers adds support for [[http://github.com][GitHub]]. ** Features: -- [[https://github.com/sigma/magit-gh-pulls][magit-gh-pulls]]: handy =magit= add-on to manage GitHub pull requests. - [[https://github.com/vermiculus/magithub][magithub]]: Magit-integrated interface to [[https://hub.github.com/][hub]] command line - [[https://github.com/magit/forge][forge]]: integration with various forges, such as GitHub and GitLab. - [[https://github.com/defunkt/gist.el][gist.el]]: full-featured mode to browse and post GitHub gists. @@ -77,22 +75,6 @@ Alternatively, use the following Emacs forms: #+END_SRC * Key bindings -** magit-gh-pulls -In a =magit status= buffer (~SPC g s~): - -| Key binding | Description | -|-------------+-------------------------------------------------------------| -| ~# c~ | create a pull request | -| ~# g~ | get a list of (or reload) all PRs in the current repository | -| ~# f~ | fetch the commits associated with the current PR at point | -| ~# b~ | create a branch for the current PR at point | -| ~# m~ | merge the PR with current branch at point | -| ~# d~ | show a diff of the current pull request at point | -| ~# o~ | open PR at point in browser | - -Note that =magit-gh-pulls= will try to fast-forward the PRs whenever it is -possible. - ** magithub | Key binding | Description | diff --git a/layers/+source-control/github/funcs.el b/layers/+source-control/github/funcs.el index d6335d590..89e476ac9 100644 --- a/layers/+source-control/github/funcs.el +++ b/layers/+source-control/github/funcs.el @@ -8,9 +8,3 @@ ;; This file is not part of GNU Emacs. ;; ;;; License: GPLv3 - -(defun spacemacs/load-gh-pulls-mode () - "Start `magit-gh-pulls-mode'." - (interactive) - (magit-gh-pulls-mode) - (magit-gh-pulls-popup)) diff --git a/layers/+source-control/github/packages.el b/layers/+source-control/github/packages.el index afb870e24..c61977eb6 100644 --- a/layers/+source-control/github/packages.el +++ b/layers/+source-control/github/packages.el @@ -15,7 +15,6 @@ gist github-clone github-search - magit-gh-pulls magithub ;; this package does not exits, we need it to wrap ;; the call to spacemacs/declare-prefix. @@ -70,21 +69,6 @@ :commands (github-search-clone-repo github-search-user-clone-repo) :init (spacemacs/set-leader-keys "ghc/" 'github-search-clone-repo))) -;; magit-gh-pulls has to be loaded via a pre-config hook because the source code -;; makes assumptions about the status of the magit-mode keymaps that are -;; incompatible with the spacemacs' evilification feature. -;; To avoid errors, magit-gh-pulls must be loaded after magit, but before magit -;; is configured by spacemacs. - -(defun github/pre-init-magit-gh-pulls () - (spacemacs|use-package-add-hook magit - :pre-config - (progn - (use-package magit-gh-pulls - :config - (define-key magit-mode-map "#" 'spacemacs/load-gh-pulls-mode) - (spacemacs|diminish magit-gh-pulls-mode "Github-PR"))))) -(defun github/init-magit-gh-pulls ()) (defun github/init-magithub () (use-package magithub