Search and insert the right issue at “Fixes #”
Goal: In a magit commit buffer, I want to complete the issue when I type “Fixes #”.
For Github and Gitlab.
Activate the minor mode
In a magit commit buffer (
git-commit-mode), type “Fixes #” (or any
other keyword understood by github, or just a “#” for Gitlab) and choose
the issue from the list.
So to always activate it:
(add-hook 'git-commit-mode-hook 'git-commit-insert-issue-mode)
You can also call it with
and programmatically doing something like
(--map (insert (concat it "\n")) (git-commit-insert-issue-github-issues-format "inkel" "github-issues.el"))
Connect to your Gitlab account
Don’t forget to set your Gitlab credentials:
(setq gitlab-host "https://gitlab.com" gitlab-username "foo" gitlab-password "password")
normally you would then call
M-x gitlab-login, but the lib does it when needed.
M-x package-install RET git-commit-insert-issue RET
(you may need a
Alternatively, you can download this repo and call
M-x load-file on the
They are all in MELPA.
Feedback on emacs-gitlab: it’s very well written but monolithic and not very flexible. It has functions for every action of the api (glab.el takes another approach, the developer writes the api endpoint) but it seems it wasn’t written for practical stuff in mind. For example, it didn’t have an option to fetch only the opened issues of a project, or optional function arguments to make it easier to develop. See this PR as an example.
Doc is missing, but once you understand that a project can be referenced by “username/project”, it’s easier.
- the helm integration is broken, we then simply use ido.
- if you play too much with it, you can reach github’s rate limit.
(--map (insert (concat it "\n")) (git-commit-insert-issue-github-issues-format "inkel" "github-issues.el")) #10 - Why not just use the gh package? #1 - Doesn't work on private repos.
- [X] gitlab integration:
- [X] Get opened issues from gitlab
- [X] Get a list of strings with “id - title”
- [X] choose with ido and insert in buffer:
- [X] choose github or gitlab, depending on project.
- [X] get the remote server in git config
- [X] make it work for projects in groups (i.e, “emacs-stuff/project” and
- [X] get the group name in git config
- [±] error handling (bad project name, etc)