diff options
Diffstat (limited to '.config/emacs/modules/mm-projects.el')
| -rw-r--r-- | .config/emacs/modules/mm-projects.el | 64 |
1 files changed, 17 insertions, 47 deletions
diff --git a/.config/emacs/modules/mm-projects.el b/.config/emacs/modules/mm-projects.el index 71006d5..02d7af4 100644 --- a/.config/emacs/modules/mm-projects.el +++ b/.config/emacs/modules/mm-projects.el @@ -19,7 +19,7 @@ This is intended to be called interactively via (project-find-file "Find File" ?f) (mm-projects-project-magit-status "Git Status" ?s))) :config - (unless mm-darwin-p + (unless mm-humanwave-p (if-let ((repo-directory (getenv "REPODIR"))) (let* ((list-dir (lambda (path) @@ -47,9 +47,10 @@ This is intended to be called interactively via (use-package magit :ensure t - :bind ( :map magit-status-mode-map - ("[" . magit-section-backward-sibling) - ("]" . magit-section-forward-sibling)) + :bind (("C-c b" . magit-blame-addition) + :map magit-status-mode-map + ("[" . magit-section-backward-sibling) + ("]" . magit-section-forward-sibling)) :custom (git-commit-style-convention-checks '(non-empty-second-line overlong-summary-line)) @@ -70,11 +71,18 @@ This is intended to be called interactively via "push" "-v" args remote (format "refs/heads/%s:refs/heads/%s" branch branch))))) (transient-append-suffix #'magit-push '(1 -1) - '("a" "all remotes" mm-projects-magit-push-current-to-all-remotes))) + '("a" "all remotes" mm-projects-magit-push-current-to-all-remotes)) + (add-to-list 'magit-blame-styles + '(margin + (show-lines . t) + (margin-format . (" %C %a" " %s%f" " ")) + (margin-width . 73) + (margin-face . magit-blame-margin) + (margin-body-face . (magit-blame-dimmed))))) (use-package magit-repos :ensure nil ; Part of ‘magit’ - :if (not mm-darwin-p) + :if (not mm-humanwave-p) :commands (magit-list-repositories) :init (if-let ((directory (getenv "REPODIR"))) @@ -100,45 +108,7 @@ This is intended to be called interactively via ;;; GitHub Pull Requests (require 'gh) -(keymap-global-set "C-c p" #'gh-create-pr) +(keymap-global-set "C-c p c" #'gh-create-pr) +(keymap-global-set "C-c p o" #'gh-open-previous-pr) -;; (defun mm-gh--get-labels () -;; (with-temp-buffer -;; (call-process "gh" nil t nil "label" "list" "--json" "name") -;; (goto-char (point-min)) -;; (let* ((data (json-parse-buffer)) -;; (labels (seq-map (lambda (x) (gethash "name" x)) data))) -;; (sort labels -;; :in-place t -;; :lessp (lambda (x y) -;; (let ((prefix-x-p (string-prefix-p "Sprint " x)) -;; (prefix-y-p (string-prefix-p "Sprint " y))) -;; (cond -;; ((and prefix-x-p prefix-y-p) (string> x y)) -;; (prefix-x-p t) -;; (prefix-y-p nil) -;; (:else (string< x y))))))))) - -;; (defun mm-gh-create-pr (title draftp labels) -;; "Create a GitHub pull request using the gh CLI. -;; If DRAFT is non-nil, the PR will be created as a draft. -;; LABELS should be a comma-separated string of GitHub labels." -;; (interactive -;; (list -;; (read-string (format-prompt "PR Title" nil)) -;; (y-or-n-p "Create as draft PR? ") -;; (completing-read-multiple (format-prompt "PR Labels" nil) -;; (mm-gh--get-labels)))) -;; (let* ((branch (car (vc-git-branches))) -;; (title (format "%s %s" branch title)) -;; (flags `("--fill-verbose" "--title" ,title "--assignee" "@me")) -;; (label-string (mapconcat #'identity labels ","))) -;; (when draftp -;; (setq flags (append flags '("--draft")))) -;; (when labels -;; (setq flags (append flags `("--label" ,label-string)))) -;; (with-temp-buffer -;; (apply #'call-process "gh" nil t nil "pr" "create" flags) -;; (message (buffer-string))))) - -(provide 'mm-projects)
\ No newline at end of file +(provide 'mm-projects) |