Oh My GitHub 1.0 is out!

Published: 2022-11-26   Updated: 2023-04-24   Tags: emacs

Table of Contents

I'm glad to announce my package Oh My GitHub v1.0 is out. Besides bug fixes, it introduce a very practical feature: create pull request without leaving Emacs.

AFAIK, there already exists a similar package called github-pullrequest does this job, but its interface is not very flexible, the PR's title and description is hard coded, and this will break template setup by owners if there exists one.

In oh-my-github, M-x omg-pull-create will open an org-mode buffer to edit what a PR required:

Those are PR's metadata, and users can define following metadata in org-mode buffer to set them:

#+TITLE:
#+TARGET-REPO: ${owner}/${repo}
#+TARGET-BRANCH:
#+SOURCE-HEAD:
#+DRAFT:

And oh-my-github will use context git info to auto fill those fields, for example

Users can define following directory variables(.dir-locals.el) to automatically set those when default value doesn't make sense:

1
2
3
4
((nil . ((omg-pull-target-repo . "jiacai2050/oh-my-github")
         (omg-pull-target-branch . "master")
         (omg-pull-username  . "jiacai2050")
         (omg-pull-draft . "false"))))

As for description, oh-my-github will detect whether ${project-root}/.github/pull_request_template.md exists, and insert following block when it's there:

#+begin_export markdown
// template's content
#+end_export

Pull Request create demo

After finish editing those information, users can C-c C-c to submit it, or C-c C-k to cancel. If PR is created successfully, oh-my-github will open the PR link via browse-url-default-browser.

I have used this workflows for a while, and feels very comfortable, and hope you guys will also enjoy this feature just like I enjoy making it!

Why oh-my-github

People may wonder why oh-my-github since there are alternatives(Forge) exist, here are my answer in this Reddit thread:

oh-my-github's Emacs interface require nothing but Emacs(28+), so this maybe its one advantage(or disadvantage 🤔).

All that said, oh-my-github is not only designed for Emacs, it's designed as a generic framework for working with GitHub API.

oh-my-github's core is written in C, so other language may use it as a library via FFI, I plan to improve CLI interface in future.

Hope this explain what oh-my-github's design principle is, and why it exists besides X/Y/Z.

Discussion on Lobste and Reddit.