Oh My GitHub 1.0 is out!
I'm glad to announce my package Oh My GitHub[1] 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[2] does this job, but its interface is not very flexible, the PR's title and description is hard coded[3], of course this will break template[4] setup by owners if there exists one.
In oh-my-github
, M-x omg-pull-create
will open a org-mode buffer to edit what a PR required[5]:
- •
title
- • the target
repo
&branch
that your changes want to be merged into - •
head
, the name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace head with a user like this: username:branch. - •
draft
, Indicates whether the pull request is a draft.
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 field, for example
- • use last commit message as title
- • use current branch as source head
Users can define following directory variables(.dir-locals.el
) to automatically set those when default value doesn't make sense:
((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 will insert following block when it's there:
#+begin_export markdown
// template's content
#+end_export
After fill in those information, users can C-c C-c
to submit it, or C-c C-k
to cancel this. 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.
Hope you guys will also enjoy this feature just like I enjoy making it!
引用链接
[1]
Oh My GitHub: https://github.com/jiacai2050/oh-my-github
[2]
github-pullrequest: https://github.com/jakoblind/github-pullrequest
[3]
hard coded: https://github.com/jakoblind/github-pullrequest/blob/6ae5c38b0fc15b638b5ba4490112d9822ce5e267/github-pullrequest.el#L79
[4]
template: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository
[5]
what a PR required: https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request
相关文章
- 嵌入式:ARM处理器的工作状态
- MySQL基础知识(二)-超详细 Linux安装MySQL5.7完整版教程及遇到的坑
- 从Linux零拷贝深入了解Linux-I/O
- [PHP] linux下安装PHP8的小问题
- [PHP] windows或者linux安装composer2
- Linux服务器下启动和关闭node
- [Go] 理解(*interface{})(nil) 赋值的变量是否为nil
- [Linux] 理解CPU缓存的伪共享问题
- [Go]理解golang项目性能分析工具trace
- 《安富莱嵌入式周报》第293期:SEGGER开源其C/C++库源码emRun,丰富EMC电磁兼容资,OTA开源组件,2022 Github全球报告,内存安全指南
- [Go]理解golang项目性能分析工具PProf
- [Go] 理解切片slice扩容
- [Linux] 理解Reactor 模型
- [Linux] 理解I/O多路复用
- 《安富莱嵌入式周报》第294期:将C/C++代码转换为各种高级语言,超炫渲染着色器,VS2022新闻插件,基于以太网的开源步进电机控制器,Arduino PLC
- [Go] 解决missing go.sum entry for module providing package <package_name>
- [Go]空接口类型断言后 .(指针类型) 和.(具体对象) 的不同区别
- [Go] embed指令嵌入静态文件到二进制包
- [Go]理解GO设计Map的原理
- [Go] golang协程池模拟实现群发邮件