pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
;;; magit-process.el --- process functionality -*- lexical-binding: t -*-
|
||||
;;; magit-process.el --- Process functionality -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 2010-2022 The Magit Project Contributors
|
||||
;;
|
||||
;; You should have received a copy of the AUTHORS.md file which
|
||||
;; lists all contributors. If not, see http://magit.vc/authors.
|
||||
;; Copyright (C) 2008-2022 The Magit Project Contributors
|
||||
|
||||
;; Author: Jonas Bernoulli <jonas@bernoul.li>
|
||||
;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
|
||||
|
||||
;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
;; Magit is free software; you can redistribute it and/or modify it
|
||||
;; Magit is free software: you can redistribute it and/or modify it
|
||||
;; under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
;;
|
||||
;; Magit is distributed in the hope that it will be useful, but WITHOUT
|
||||
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
@@ -21,7 +18,7 @@
|
||||
;; License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with Magit. If not, see http://www.gnu.org/licenses.
|
||||
;; along with Magit. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
@@ -33,17 +30,13 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'magit-utils)
|
||||
(require 'magit-section)
|
||||
(require 'magit-base)
|
||||
(require 'magit-git)
|
||||
(require 'magit-mode)
|
||||
|
||||
(require 'ansi-color)
|
||||
(require 'with-editor)
|
||||
|
||||
(declare-function auth-source-search "auth-source"
|
||||
(&rest spec &key max require create delete &allow-other-keys))
|
||||
|
||||
;;; Options
|
||||
|
||||
(defcustom magit-process-connection-type (not (eq system-type 'cygwin))
|
||||
@@ -286,10 +279,7 @@ Used when `magit-process-display-mode-line-error' is non-nil."
|
||||
"Mode for looking at Git process output."
|
||||
:group 'magit-process
|
||||
(hack-dir-local-variables-non-file-buffer)
|
||||
(setq imenu-prev-index-position-function
|
||||
'magit-imenu--process-prev-index-position-function)
|
||||
(setq imenu-extract-index-name-function
|
||||
'magit-imenu--process-extract-index-name-function))
|
||||
(setq magit--imenu-item-types 'process))
|
||||
|
||||
(defun magit-process-buffer (&optional nodisplay)
|
||||
"Display the current repository's process buffer.
|
||||
@@ -310,8 +300,8 @@ optional NODISPLAY is non-nil also display it."
|
||||
(and (eq major-mode 'magit-process-mode)
|
||||
(equal default-directory topdir)))
|
||||
(buffer-list))
|
||||
(let ((default-directory topdir))
|
||||
(magit-generate-new-buffer 'magit-process-mode)))))
|
||||
(magit-generate-new-buffer 'magit-process-mode
|
||||
nil topdir))))
|
||||
(with-current-buffer buffer
|
||||
(if magit-root-section
|
||||
(when magit-process-log-max
|
||||
@@ -495,7 +485,7 @@ and still alive), as well as the respective Magit status buffer.
|
||||
|
||||
See `magit-start-process' for more information."
|
||||
(message "Running %s %s" (magit-git-executable)
|
||||
(let ((m (mapconcat #'identity (-flatten args) " ")))
|
||||
(let ((m (mapconcat #'identity (flatten-tree args) " ")))
|
||||
(remove-list-of-text-properties 0 (length m) '(face) m)
|
||||
m))
|
||||
(magit-start-git nil args))
|
||||
@@ -623,7 +613,7 @@ Magit status buffer."
|
||||
(let ((process-connection-type nil)
|
||||
(process-environment (magit-process-environment))
|
||||
(default-process-coding-system
|
||||
(magit--process-coding-system)))
|
||||
(magit--process-coding-system)))
|
||||
(apply #'start-file-process "git" process-buf
|
||||
(magit-git-executable) args))))
|
||||
(process-put process 'command-buf command-buf)
|
||||
@@ -733,22 +723,22 @@ Magit status buffer."
|
||||
"Special sentinel used by `magit-run-git-sequencer'."
|
||||
(when (memq (process-status process) '(exit signal))
|
||||
(magit-process-sentinel process event)
|
||||
(when-let ((process-buf (process-buffer process)))
|
||||
(when (buffer-live-p process-buf)
|
||||
(when-let ((status-buf (with-current-buffer process-buf
|
||||
(magit-get-mode-buffer 'magit-status-mode))))
|
||||
(with-current-buffer status-buf
|
||||
(--when-let
|
||||
(magit-get-section
|
||||
`((commit . ,(magit-rev-parse "HEAD"))
|
||||
(,(pcase (car (cadr (-split-at
|
||||
(1+ (length magit-git-global-arguments))
|
||||
(process-command process))))
|
||||
((or "rebase" "am") 'rebase-sequence)
|
||||
((or "cherry-pick" "revert") 'sequence)))
|
||||
(status)))
|
||||
(goto-char (oref it start))
|
||||
(magit-section-update-highlight))))))))
|
||||
(when-let* ((process-buf (process-buffer process))
|
||||
(- (buffer-live-p process-buf))
|
||||
(status-buf (with-current-buffer process-buf
|
||||
(magit-get-mode-buffer 'magit-status-mode))))
|
||||
(with-current-buffer status-buf
|
||||
(--when-let
|
||||
(magit-get-section
|
||||
`((commit . ,(magit-rev-parse "HEAD"))
|
||||
(,(pcase (car (cadr (-split-at
|
||||
(1+ (length magit-git-global-arguments))
|
||||
(process-command process))))
|
||||
((or "rebase" "am") 'rebase-sequence)
|
||||
((or "cherry-pick" "revert") 'sequence)))
|
||||
(status)))
|
||||
(goto-char (oref it start))
|
||||
(magit-section-update-highlight))))))
|
||||
|
||||
(defun magit-process-filter (proc string)
|
||||
"Default filter used by `magit-start-process'."
|
||||
@@ -805,11 +795,11 @@ Magit status buffer."
|
||||
If found, return the password. Otherwise, return nil.
|
||||
|
||||
To use this function add it to the appropriate hook
|
||||
(add-hook 'magit-process-find-password-functions
|
||||
'magit-process-password-auth-source)
|
||||
(add-hook \\='magit-process-find-password-functions
|
||||
\\='magit-process-password-auth-source)
|
||||
|
||||
KEY typically derives from a prompt such as:
|
||||
Password for 'https://yourname@github.com'
|
||||
Password for \\='https://yourname@github.com\\='
|
||||
in which case it would be the string
|
||||
yourname@github.com
|
||||
which matches the ~/.authinfo.gpg entry
|
||||
@@ -842,7 +832,8 @@ be translated on the fly by doing this once
|
||||
|
||||
[1]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token."
|
||||
(require 'auth-source)
|
||||
(and (string-match "\\`\\(.+\\)@\\([^@]+\\)\\'" key)
|
||||
(and (fboundp 'auth-source-search)
|
||||
(string-match "\\`\\(.+\\)@\\([^@]+\\)\\'" key)
|
||||
(let* ((user (match-string 1 key))
|
||||
(host (match-string 2 key))
|
||||
(secret
|
||||
@@ -879,7 +870,7 @@ from the user."
|
||||
magit-process-password-prompt-regexps string)))
|
||||
(process-send-string
|
||||
process (magit-process-kill-on-abort process
|
||||
(concat (or (when-let ((key (match-string 99 string)))
|
||||
(concat (or (and-let* ((key (match-string 99 string)))
|
||||
(run-hook-with-args-until-success
|
||||
'magit-process-find-password-functions key))
|
||||
(read-passwd prompt))
|
||||
@@ -958,7 +949,7 @@ as argument."
|
||||
(apply fn name buffer program args)))
|
||||
|
||||
(advice-add 'tramp-sh-handle-start-file-process :around
|
||||
'tramp-sh-handle-start-file-process--magit-tramp-process-environment)
|
||||
#'tramp-sh-handle-start-file-process--magit-tramp-process-environment)
|
||||
|
||||
(defun tramp-sh-handle-process-file--magit-tramp-process-environment
|
||||
(fn program &optional infile destination display &rest args)
|
||||
@@ -969,7 +960,7 @@ as argument."
|
||||
(apply fn program infile destination display args)))
|
||||
|
||||
(advice-add 'tramp-sh-handle-process-file :around
|
||||
'tramp-sh-handle-process-file--magit-tramp-process-environment)
|
||||
#'tramp-sh-handle-process-file--magit-tramp-process-environment)
|
||||
|
||||
(defvar magit-mode-line-process-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
@@ -1028,15 +1019,15 @@ If STR is supplied, it replaces the `mode-line-process' text."
|
||||
(let ((repokey (magit-repository-local-repository)))
|
||||
;; The following closure captures the repokey value, and is
|
||||
;; added to `pre-command-hook'.
|
||||
(cl-labels ((enable-magit-process-unset-mode-line
|
||||
() ;;; Remove ourself from the hook variable, so
|
||||
;;; that we only run once.
|
||||
(remove-hook 'pre-command-hook
|
||||
#'enable-magit-process-unset-mode-line)
|
||||
;; Clear the inhibit flag for the repository in
|
||||
;; which we set it.
|
||||
(magit-repository-local-set
|
||||
'inhibit-magit-process-unset-mode-line nil repokey)))
|
||||
(cl-labels ((enable-magit-process-unset-mode-line ()
|
||||
;; Remove ourself from the hook variable, so
|
||||
;; that we only run once.
|
||||
(remove-hook 'pre-command-hook
|
||||
#'enable-magit-process-unset-mode-line)
|
||||
;; Clear the inhibit flag for the repository in
|
||||
;; which we set it.
|
||||
(magit-repository-local-set
|
||||
'inhibit-magit-process-unset-mode-line nil repokey)))
|
||||
;; Set the inhibit flag until the next command is invoked.
|
||||
(magit-repository-local-set
|
||||
'inhibit-magit-process-unset-mode-line t repokey)
|
||||
@@ -1052,6 +1043,9 @@ If STR is supplied, it replaces the `mode-line-process' text."
|
||||
'magit-mode-line-process-error))
|
||||
(magit-process-unset-mode-line))))
|
||||
|
||||
(add-hook 'magit-refresh-buffer-hook
|
||||
#'magit-process-unset-mode-line-error-status)
|
||||
|
||||
(defun magit-process-unset-mode-line (&optional directory)
|
||||
"Remove the git command from the mode line."
|
||||
(let ((default-directory (or directory default-directory)))
|
||||
|
||||
Reference in New Issue
Block a user