From b53a8957a16f3f107a5e8cdc978129bd629a51de Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Mon, 6 Feb 2017 22:48:38 -0500 Subject: [PATCH] github: add magithub to opt-out simply add magithub to the dotspacemacs-excluded-packages variable --- layers/+source-control/github/README.org | 18 +++++++++++++++++- layers/+source-control/github/packages.el | 10 ++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/layers/+source-control/github/README.org b/layers/+source-control/github/README.org index 3713c08ff..ccbffacc8 100644 --- a/layers/+source-control/github/README.org +++ b/layers/+source-control/github/README.org @@ -8,8 +8,10 @@ - [[#install][Install]] - [[#layer][Layer]] - [[#git-configuration][Git configuration]] + - [[#hub-configuration][Hub configuration]] - [[#key-bindings][Key Bindings]] - [[#magit-gh-pulls][magit-gh-pulls]] + - [[#magithub][magithub]] - [[#gistel][gist.el]] - [[#clone-repositories][Clone repositories]] - [[#browse-files][Browse files]] @@ -19,6 +21,7 @@ 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/defunkt/gist.el][gist.el]]: full-featured mode to browse and post GitHub gists. - [[https://github.com/osener/github-browse-file][github-browse-file]] and [[https://github.com/sshaw/git-link][git-link]]: quickly browse GitHub URL in your browser. @@ -39,9 +42,13 @@ be added to your =~/.gitconfig= git config --global github.oauth-token #+END_SRC +** Hub configuration +For now, =Magithub= requires the =hub= utility to work -- before trying to use +Magithub, follow the installation instructions at hub.github.com. To force hub +to authenticate, you can use hub browse in a terminal (inside a GitHub repo). + * Key Bindings ** magit-gh-pulls - In a =magit status= buffer (~SPC g s~): | Key Binding | Description | @@ -57,6 +64,15 @@ In a =magit status= buffer (~SPC g s~): Note that =magit-gh-pulls= will try to fast-forward the PRs whenever it is possible. +** magithub +| Key Binding | Description | +|-------------+-------------------------------------------------------------| +| ~@ H~ | opens the current repository in the browser | +| ~@ c~ | pushes a brand-new local repository up to GitHub | +| ~@ f~ | create a fork of an existing repository | +| ~@ p~ | submit pull request upstream | +| ~@ i~ | create an issue | + ** gist.el | Key Binding | Description | diff --git a/layers/+source-control/github/packages.el b/layers/+source-control/github/packages.el index 9c16957ec..780dd5e51 100644 --- a/layers/+source-control/github/packages.el +++ b/layers/+source-control/github/packages.el @@ -16,6 +16,7 @@ github-clone github-search magit-gh-pulls + magithub ;; this package does not exits, we need it to wrap ;; the call to spacemacs/declare-prefix. (spacemacs-github :location built-in) @@ -83,5 +84,14 @@ :config (spacemacs|diminish magit-gh-pulls-mode "Github-PR"))))) +(defun github/init-magithub () + (use-package magithub + :defer t + :after magit + :config + (progn + (magithub-feature-autoinject t) + (define-key magit-status-mode-map "@" #'magithub-dispatch-popup)))) + (defun github/init-spacemacs-github () (spacemacs/declare-prefix "gh" "github"))