pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
;;; magit-sequence.el --- history manipulation in Magit -*- lexical-binding: t -*-
|
||||
;;; magit-sequence.el --- History manipulation in Magit -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 2011-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:
|
||||
|
||||
@@ -95,8 +92,8 @@
|
||||
"Resume the current cherry-pick or revert sequence."
|
||||
(interactive)
|
||||
(if (magit-sequencer-in-progress-p)
|
||||
(if (magit-anything-unstaged-p t)
|
||||
(user-error "Cannot continue due to unstaged changes")
|
||||
(if (magit-anything-unmerged-p)
|
||||
(user-error "Cannot continue due to unresolved conflicts")
|
||||
(magit-run-git-sequencer
|
||||
(if (magit-revert-in-progress-p) "revert" "cherry-pick") "--continue"))
|
||||
(user-error "No cherry-pick or revert in progress")))
|
||||
@@ -165,7 +162,7 @@ This discards all changes made since the sequence started."
|
||||
:class 'transient-option
|
||||
:shortarg "-m"
|
||||
:argument "--mainline="
|
||||
:reader 'transient-read-number-N+)
|
||||
:reader #'transient-read-number-N+)
|
||||
|
||||
(defun magit-cherry-pick-read-args (prompt)
|
||||
(list (or (nreverse (magit-region-values 'commit))
|
||||
@@ -176,8 +173,8 @@ This discards all changes made since the sequence started."
|
||||
(declare (indent defun))
|
||||
(let ((commits (or (nreverse (magit-region-values 'commit))
|
||||
(list (funcall (if away
|
||||
'magit-read-branch-or-commit
|
||||
'magit-read-other-branch-or-commit)
|
||||
#'magit-read-branch-or-commit
|
||||
#'magit-read-other-branch-or-commit)
|
||||
(format "%s cherry" (capitalize verb))))))
|
||||
(current (or (magit-get-current-branch)
|
||||
(and allow-detached (magit-rev-parse "HEAD")))))
|
||||
@@ -186,8 +183,8 @@ This discards all changes made since the sequence started."
|
||||
(let ((reachable (magit-rev-ancestor-p (car commits) current))
|
||||
(msg "Cannot %s cherries that %s reachable from HEAD"))
|
||||
(pcase (list away reachable)
|
||||
(`(nil t) (user-error msg verb "are"))
|
||||
(`(t nil) (user-error msg verb "are not"))))
|
||||
('(nil t) (user-error msg verb "are"))
|
||||
('(t nil) (user-error msg verb "are not"))))
|
||||
`(,commits
|
||||
,@(funcall fn commits)
|
||||
,(transient-args 'magit-cherry-pick))))
|
||||
@@ -313,12 +310,11 @@ the process manually."
|
||||
(magit-refresh)))
|
||||
(t
|
||||
(magit-git "checkout" src)
|
||||
(let ((process-environment process-environment))
|
||||
(push (format "%s=%s -i -ne '/^pick (%s)/ or print'"
|
||||
"GIT_SEQUENCE_EDITOR"
|
||||
magit-perl-executable
|
||||
(mapconcat #'magit-rev-abbrev commits "|"))
|
||||
process-environment)
|
||||
(with-environment-variables
|
||||
(("GIT_SEQUENCE_EDITOR"
|
||||
(format "%s -i -ne '/^pick (%s)/ or print'"
|
||||
magit-perl-executable
|
||||
(mapconcat #'magit-rev-abbrev commits "|"))))
|
||||
(magit-run-git-sequencer "rebase" "-i" keep))
|
||||
(when checkout-dst
|
||||
(set-process-sentinel
|
||||
@@ -334,13 +330,13 @@ the process manually."
|
||||
(defun magit--cherry-pick (commits args &optional revert)
|
||||
(let ((command (if revert "revert" "cherry-pick")))
|
||||
(when (stringp commits)
|
||||
(setq commits (if (string-match-p "\\.\\." commits)
|
||||
(setq commits (if (string-search ".." commits)
|
||||
(split-string commits "\\.\\.")
|
||||
(list commits))))
|
||||
(magit-run-git-sequencer
|
||||
(if revert "revert" "cherry-pick")
|
||||
(pcase-let ((`(,merge ,non-merge)
|
||||
(-separate 'magit-merge-commit-p commits)))
|
||||
(-separate #'magit-merge-commit-p commits)))
|
||||
(cond
|
||||
((not merge)
|
||||
(--remove (string-prefix-p "--mainline=" it) args))
|
||||
@@ -357,7 +353,11 @@ the process manually."
|
||||
|
||||
(defun magit-cherry-pick-in-progress-p ()
|
||||
;; .git/sequencer/todo does not exist when there is only one commit left.
|
||||
(file-exists-p (magit-git-dir "CHERRY_PICK_HEAD")))
|
||||
(or (file-exists-p (magit-git-dir "CHERRY_PICK_HEAD"))
|
||||
;; And CHERRY_PICK_HEAD does not exist when a conflict happens
|
||||
;; while picking a series of commits with --no-commit.
|
||||
(when-let ((line (magit-file-line (magit-git-dir "sequencer/todo"))))
|
||||
(string-prefix-p "pick" line))))
|
||||
|
||||
;;; Revert
|
||||
|
||||
@@ -409,7 +409,11 @@ without prompting."
|
||||
|
||||
(defun magit-revert-in-progress-p ()
|
||||
;; .git/sequencer/todo does not exist when there is only one commit left.
|
||||
(file-exists-p (magit-git-dir "REVERT_HEAD")))
|
||||
(or (file-exists-p (magit-git-dir "REVERT_HEAD"))
|
||||
;; And REVERT_HEAD does not exist when a conflict happens while
|
||||
;; reverting a series of commits with --no-commit.
|
||||
(when-let ((line (magit-file-line (magit-git-dir "sequencer/todo"))))
|
||||
(string-prefix-p "revert" line))))
|
||||
|
||||
;;; Patch
|
||||
|
||||
@@ -448,7 +452,7 @@ without prompting."
|
||||
:class 'transient-option
|
||||
:argument "-p"
|
||||
:allow-empty t
|
||||
:reader 'transient-read-number-N+)
|
||||
:reader #'transient-read-number-N+)
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-am-apply-patches (&optional files args)
|
||||
@@ -519,9 +523,12 @@ This discards all changes made since the sequence started."
|
||||
("-r" "Rebase merges" ("-r" "--rebase-merges=")
|
||||
magit-rebase-merges-select-mode
|
||||
:if (lambda () (magit-git-version>= "2.18.0")))
|
||||
("-u" "Update branches" "--update-refs"
|
||||
:if (lambda () (magit-git-version>= "2.38.0")))
|
||||
(7 magit-merge:--strategy)
|
||||
(7 magit-merge:--strategy-option)
|
||||
(7 "=X" magit-diff:--diff-algorithm :argument "-Xdiff-algorithm=")
|
||||
(7 "-f" "Force rebase" ("-f" "--force-rebase"))
|
||||
("-d" "Use author date as committer date" "--committer-date-is-author-date")
|
||||
("-t" "Use current time as author date" "--ignore-date")
|
||||
("-a" "Autosquash" "--autosquash")
|
||||
@@ -579,8 +586,8 @@ This discards all changes made since the sequence started."
|
||||
With a prefix argument or when the push-remote is either not
|
||||
configured or unusable, then let the user first configure the
|
||||
push-remote."
|
||||
:if 'magit-get-current-branch
|
||||
:description 'magit-pull--pushbranch-description
|
||||
:if #'magit-get-current-branch
|
||||
:description #'magit-pull--pushbranch-description
|
||||
(interactive (list (magit-rebase-arguments)))
|
||||
(pcase-let ((`(,branch ,remote)
|
||||
(magit--select-push-remote "rebase onto that")))
|
||||
@@ -593,8 +600,8 @@ push-remote."
|
||||
With a prefix argument or when the upstream is either not
|
||||
configured or unusable, then let the user first configure
|
||||
the upstream."
|
||||
:if 'magit-get-current-branch
|
||||
:description 'magit-rebase--upstream-description
|
||||
:if #'magit-get-current-branch
|
||||
:description #'magit-rebase--upstream-description
|
||||
(interactive (list (magit-rebase-arguments)))
|
||||
(let* ((branch (or (magit-get-current-branch)
|
||||
(user-error "No branch is checked out")))
|
||||
@@ -607,7 +614,7 @@ the upstream."
|
||||
(magit-git-rebase upstream args)))
|
||||
|
||||
(defun magit-rebase--upstream-description ()
|
||||
(when-let ((branch (magit-get-current-branch)))
|
||||
(and-let* ((branch (magit-get-current-branch)))
|
||||
(or (magit-get-upstream-branch branch)
|
||||
(let ((remote (magit-get "branch" branch "remote"))
|
||||
(merge (magit-get "branch" branch "merge"))
|
||||
@@ -660,9 +667,9 @@ START has to be selected from a list of recent commits."
|
||||
(declare (indent 2))
|
||||
(when commit
|
||||
(if (eq commit :merge-base)
|
||||
(setq commit (--if-let (magit-get-upstream-branch)
|
||||
(magit-git-string "merge-base" it "HEAD")
|
||||
nil))
|
||||
(setq commit
|
||||
(and-let* ((upstream (magit-get-upstream-branch)))
|
||||
(magit-git-string "merge-base" upstream "HEAD")))
|
||||
(unless (magit-rev-ancestor-p commit "HEAD")
|
||||
(user-error "%s isn't an ancestor of HEAD" commit))
|
||||
(if (magit-commit-parents commit)
|
||||
@@ -683,7 +690,7 @@ START has to be selected from a list of recent commits."
|
||||
editor))
|
||||
process-environment))
|
||||
(magit-run-git-sequencer "rebase" "-i" args
|
||||
(unless (member "--root" args) commit)))
|
||||
(and (not (member "--root" args)) commit)))
|
||||
(magit-log-select
|
||||
`(lambda (commit)
|
||||
;; In some cases (currently just magit-rebase-remove-commit), "-c
|
||||
@@ -814,8 +821,7 @@ edit. With a prefix argument the old message is reused as-is."
|
||||
(magit-commit-amend-assert
|
||||
(magit-file-line (magit-git-dir "rebase-merge/orig-head"))))
|
||||
(if noedit
|
||||
(let ((process-environment process-environment))
|
||||
(push "GIT_EDITOR=true" process-environment)
|
||||
(with-environment-variables (("GIT_EDITOR" "true"))
|
||||
(magit-run-git-async (magit--rebase-resume-command) "--continue")
|
||||
(set-process-sentinel magit-this-process
|
||||
#'magit-sequencer-process-sentinel)
|
||||
@@ -972,13 +978,13 @@ status buffer (i.e. the reverse of how they will be applied)."
|
||||
(dolist (line (magit-rebase--todo))
|
||||
(with-slots (action-type action action-options target) line
|
||||
(pcase action-type
|
||||
(`commit
|
||||
('commit
|
||||
(magit-sequence-insert-commit action target 'magit-sequence-pick))
|
||||
((or (or `exec `label)
|
||||
(and `merge (guard (not action-options))))
|
||||
(insert (propertize action 'font-lock-face 'magit-sequence-onto) "\s"
|
||||
(propertize target 'font-lock-face 'git-rebase-label) "\n"))
|
||||
(`merge
|
||||
('merge
|
||||
(if-let ((hash (and (string-match "-[cC] \\([^ ]+\\)" action-options)
|
||||
(match-string 1 action-options))))
|
||||
(magit-insert-section (commit hash)
|
||||
@@ -990,8 +996,8 @@ status buffer (i.e. the reverse of how they will be applied)."
|
||||
(magit-sequence-insert-sequence
|
||||
(magit-file-line (magit-git-dir "rebase-merge/stopped-sha"))
|
||||
onto
|
||||
(--when-let (magit-file-lines (magit-git-dir "rebase-merge/done"))
|
||||
(cadr (split-string (car (last it)))))))
|
||||
(and-let* ((lines (magit-file-lines (magit-git-dir "rebase-merge/done"))))
|
||||
(cadr (split-string (car (last lines)))))))
|
||||
|
||||
(defun magit-rebase-insert-apply-sequence (onto)
|
||||
(let ((rewritten
|
||||
@@ -1051,7 +1057,7 @@ status buffer (i.e. the reverse of how they will be applied)."
|
||||
(magit-sequence-insert-commit "gone" stop 'magit-sequence-drop)))
|
||||
(setq stop nil))))
|
||||
(dolist (rev done)
|
||||
(apply 'magit-sequence-insert-commit
|
||||
(apply #'magit-sequence-insert-commit
|
||||
(cond ((equal rev stop)
|
||||
;; ...but its reincarnation lives on.
|
||||
;; Or it didn't die in the first place.
|
||||
|
||||
Reference in New Issue
Block a user