domtronn / magit-gh-issues.el

A small plugin for Magit which allows users to see, open, comment and label GitHub issues.
GNU General Public License v2.0
5 stars 1 forks source link

magit-gh-issues.el

A small plugin for Magit which allows users to see, open, comment and label GitHub issues.

Installing

Add this package to your load path and then turn on the minor mode globally

(require 'magit-gh-issues)
(magit-gh-issues-mode 1)

Usage

Most interactions are context sensitive and only run when highlighting an issue (currently this project doesn't support performing actions on multiple issues, partly because I didn't think this made sense). There are a couple of commands that can be run globally (I'd like to be able to add these to the magit-popup in the future)

Global bindings
Key Binding Command Effect
I o magit-gh-issues-open-issue Open a new issue and refresh the list of issues
I g magit-gh-issues-reload Purge the cache of issues and refetch them for the current project
I z magit-gh-issues-collapse-issues Collapse all of the currently opened issues
Context Sensitive bindings
Key Binding Command Effect
a magit-gh-issues-add-label Add a label to the currently highlighted issue from a popup
r magit-gh-issues-remove-label Remove a label from the currently highlighted issue
c magit-gh-issues-comment-issue Comment on the current issue
k magit-gh-issues-close-issue Close the current issue
RET magit-gh-issues-visit-issue Open the current issue in a browser

Creating Issues

Currently, this package uses ghi to open new issues, you can install it by running

brew install ghi
ghi config --auth

You need to authorize ghi so that it can work with all your repos

Auto Completion

This package provides auto completion for issue numbers when in git commit modes so that you can easily reference them from the commit. To enable this, add the following to you init.el

(add-hook 'git-commit-mode-hook 'ac-source-gh-setup)

Then when writing a commit, typing # followed by the first number of an issue will provide a prompt with open issues and their title.

Selecting an issue will only insert the issue number.

Philosophy of Functionality

My main goal with this project is to make it easier for users to access and interact with GitHub issues from within magit. However, I'm not looking to recreate GitHub from within magit, there's a lot of metadata and information associated with issues, e.g. Assignees, Milestones, Labels, but I don't want to overload the user with information.

I want to make referenceable things (like the issue numbers) readily available and provide an at a glance overview of current state of project.

This is why I will probably deprioritize some of the functionality people may be familiar with in GitHub.

Planned Features