瀏覽代碼

git-bug WIP

master
10sr 5 年之前
父節點
當前提交
b0e07675dd
簽署人: 10sr GPG Key ID: 7BEC428194130EB2
共有 1 個文件被更改,包括 29 次插入2 次删除
  1. +29
    -2
      emacs.el

+ 29
- 2
emacs.el 查看文件

@@ -2043,9 +2043,8 @@ and search from projectile root (if projectile is available)."
"Regexp to parse line of output of git-bug ls.
Used by `git-bug-ls'.")

(defun git-bug--bugs ()
(defun git-bug-bugs ()
"Get list of git-bug bugs."
(interactive)
(with-temp-buffer
(git-bug--call-process "bug" "ls")
(goto-char (point-min))
@@ -2066,6 +2065,34 @@ Used by `git-bug-ls'.")
(goto-char (point-at-bol)))
bugs)))

(defun git-bug-ls-noselect (&optional directory)
"Open git bug list buffer.

If optional arg DIRECTORY is given change current directory to there before
initializing."
(setq directory (expand-file-name (or directory
default-directory)))
(cl-assert (file-directory-p directory))
(let* ((root (git-bug--get-repository-root directory))
(name (file-name-nondirectory root))
(bname (format "*GitBug<%s>*" name)))
(with-current-buffer (get-buffer-create bname)
(cd root)
(git-bug--set-tabulated-list-mode-variables)
(git-bug-mode)
(current-buffer))))

(defun git-bug--get-repository-root (dir)
"Resolve repository root of DIR.

If DIR is not inside of any git repository, signal an error."
(cl-assert (file-directory-p dir))
(with-temp-buffer
(cd dir)
(git-bug--call-process "rev-parse" "--show-toplevel")
(goto-char (point-min))
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))

(defun git-bug--call-process (&rest args)
"Start git process synchronously with ARGS.



Loading…
取消
儲存