update packages

This commit is contained in:
2025-11-25 19:52:03 +01:00
parent 14ba373378
commit dbbae92267
280 changed files with 13451 additions and 11207 deletions

View File

@@ -32,7 +32,7 @@
;; For `magit-rebase--todo'.
(declare-function git-rebase-current-line "git-rebase" (&optional batch))
(eval-when-compile
(eval-and-compile
(cl-pushnew 'action-type eieio--known-slot-names)
(cl-pushnew 'action eieio--known-slot-names)
(cl-pushnew 'action-options eieio--known-slot-names)
@@ -131,7 +131,7 @@ This discards all changes made since the sequence started."
(defvar magit-perl-executable "perl"
"The Perl executable.")
;;;###autoload (autoload 'magit-cherry-pick "magit-sequence" nil t)
;;;###autoload(autoload 'magit-cherry-pick "magit-sequence" nil t)
(transient-define-prefix magit-cherry-pick ()
"Apply or transplant commits."
:man-page "git-cherry-pick"
@@ -349,8 +349,7 @@ the process manually."
command))
((seq-find (##string-prefix-p "--mainline=" %) args)
args)
(t
(cons (format "--mainline=%s"
((cons (format "--mainline=%s"
(read-number "Replay merges relative to parent: "))
args))))
commits)))
@@ -361,13 +360,12 @@ the process manually."
(or (file-exists-p (expand-file-name "CHERRY_PICK_HEAD" dir))
;; And CHERRY_PICK_HEAD does not exist when a conflict happens
;; while picking a series of commits with --no-commit.
(and-let* ((line (magit-file-line
(expand-file-name "sequencer/todo" dir))))
(string-prefix-p "pick" line)))))
(and$ (magit-file-line (expand-file-name "sequencer/todo" dir))
(string-prefix-p "pick" $)))))
;;; Revert
;;;###autoload (autoload 'magit-revert "magit-sequence" nil t)
;;;###autoload(autoload 'magit-revert "magit-sequence" nil t)
(transient-define-prefix magit-revert ()
"Revert existing commits, with or without creating new commits."
:man-page "git-revert"
@@ -419,13 +417,12 @@ without prompting."
(or (file-exists-p (expand-file-name "REVERT_HEAD" dir))
;; And REVERT_HEAD does not exist when a conflict happens
;; while reverting a series of commits with --no-commit.
(and-let* ((line (magit-file-line
(expand-file-name "sequencer/todo" dir))))
(string-prefix-p "revert" line)))))
(and$ (magit-file-line (expand-file-name "sequencer/todo" dir))
(string-prefix-p "revert" $)))))
;;; Patch
;;;###autoload (autoload 'magit-am "magit-sequence" nil t)
;;;###autoload(autoload 'magit-am "magit-sequence" nil t)
(transient-define-prefix magit-am ()
"Apply patches received by email."
:man-page "git-am"
@@ -519,7 +516,7 @@ This discards all changes made since the sequence started."
;;; Rebase
;;;###autoload (autoload 'magit-rebase "magit-sequence" nil t)
;;;###autoload(autoload 'magit-rebase "magit-sequence" nil t)
(transient-define-prefix magit-rebase ()
"Transplant commits and/or modify existing commits."
:man-page "git-rebase"
@@ -587,7 +584,7 @@ This discards all changes made since the sequence started."
(defun magit-git-rebase (target args)
(magit-run-git-sequencer "rebase" args target))
;;;###autoload (autoload 'magit-rebase-onto-pushremote "magit-sequence" nil t)
;;;###autoload(autoload 'magit-rebase-onto-pushremote "magit-sequence" nil t)
(transient-define-suffix magit-rebase-onto-pushremote (args)
"Rebase the current branch onto its push-remote branch.
@@ -601,7 +598,7 @@ push-remote."
(magit--select-push-remote "rebase onto that")))
(magit-git-rebase (concat remote "/" branch) args)))
;;;###autoload (autoload 'magit-rebase-onto-upstream "magit-sequence" nil t)
;;;###autoload(autoload 'magit-rebase-onto-upstream "magit-sequence" nil t)
(transient-define-suffix magit-rebase-onto-upstream (args)
"Rebase the current branch onto its upstream branch.
@@ -622,7 +619,7 @@ the upstream."
(magit-git-rebase upstream args)))
(defun magit-rebase--upstream-description ()
(and-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"))
@@ -634,8 +631,7 @@ the upstream."
(concat u ", replacing non-existent"))
((or remote merge)
(concat u ", replacing invalid"))
(t
(concat u ", setting that")))))))
((concat u ", setting that")))))))
;;;###autoload
(defun magit-rebase-branch (target args)
@@ -658,29 +654,27 @@ START has to be selected from a list of recent commits."
(magit-get-upstream-branch))
nil
(magit-rebase-arguments)))
(if start
(progn (message "Rebasing...")
(magit-run-git-sequencer "rebase" "--onto" newbase start args)
(message "Rebasing...done"))
(magit-log-select
`(lambda (commit)
(magit-rebase-subset ,newbase (concat commit "^") (list ,@args)))
(concat "Type %p on a commit to rebase it "
"and commits above it onto " newbase ","))))
(defvar magit-rebase-interactive-include-selected t)
(cond (start
(message "Rebasing...")
(magit-run-git-sequencer "rebase" "--onto" newbase start args)
(message "Rebasing...done"))
((magit-log-select
`(lambda (commit)
(magit-rebase-subset ,newbase (concat commit "^") (list ,@args)))
(concat "Type %p on a commit to rebase it "
"and commits above it onto " newbase ",")))))
(defun magit-rebase-interactive-1
(commit args message &optional editor delay-edit-confirm noassert confirm)
( commit args message
&optional editor delay-edit-confirm noassert confirm exact)
(declare (indent 2))
(when commit
(unless (magit-rev-ancestor-p commit "HEAD")
(user-error "%s isn't an ancestor of HEAD" commit))
(if (magit-commit-parents commit)
(when (or (not (eq this-command 'magit-rebase-interactive))
magit-rebase-interactive-include-selected)
(setq commit (concat commit "^")))
(setq args (cons "--root" args))))
(cond ((not commit))
((not (magit-rev-ancestor-p commit "HEAD"))
(user-error "%s isn't an ancestor of HEAD" commit))
((not (magit-commit-parents commit))
(setq args (cons "--root" args)))
((not exact)
(setq commit (concat commit "^"))))
(when (and commit (not noassert))
(setq commit (magit-rebase-interactive-assert
commit delay-edit-confirm
@@ -746,6 +740,8 @@ START has to be selected from a list of recent commits."
;; The "--root" argument is being used.
since))
(defvar magit-rebase-interactive-include-selected t)
;;;###autoload
(defun magit-rebase-interactive (commit args)
"Start an interactive rebase sequence."
@@ -753,7 +749,8 @@ START has to be selected from a list of recent commits."
(magit-rebase-arguments)))
(magit-rebase-interactive-1 commit args
"Type %p on a commit to rebase it and all commits above it,"
nil t))
nil t nil nil
(not magit-rebase-interactive-include-selected)))
;;;###autoload
(defun magit-rebase-autosquash (select args)
@@ -764,12 +761,12 @@ argument, prompt for the first commit to potentially squash into."
(interactive (list current-prefix-arg
(magit-rebase-arguments)))
(magit-rebase-interactive-1
(and-let* (((not select))
(upstream (magit-get-upstream-branch)))
(and-let ((_(not select))
(upstream (magit-get-upstream-branch)))
(magit-git-string "merge-base" upstream "HEAD"))
(nconc (list "--autosquash" "--keep-empty") args)
"Type %p on a commit to squash into it and then rebase as necessary,"
"true" nil t))
"true" nil t nil t))
;;;###autoload
(defun magit-rebase-edit-commit (commit args)
@@ -822,25 +819,26 @@ argument, prompt for the first commit to potentially squash into."
In some cases this pops up a commit message buffer for you do
edit. With a prefix argument the old message is reused as-is."
(interactive "P")
(if (magit-rebase-in-progress-p)
(if (magit-anything-unstaged-p t)
(user-error "Cannot continue rebase with unstaged changes")
(let ((dir (magit-gitdir)))
(when (and (magit-anything-staged-p)
(file-exists-p (expand-file-name "rebase-merge" dir))
(not (member (magit-toplevel)
magit--rebase-public-edit-confirmed)))
(magit-commit-amend-assert
(magit-file-line
(expand-file-name "rebase-merge/orig-head" dir)))))
(if noedit
(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)
magit-this-process)
(magit-run-git-sequencer (magit--rebase-resume-command) "--continue")))
(user-error "No rebase in progress")))
(cond
((not (magit-rebase-in-progress-p))
(user-error "No rebase in progress"))
((magit-anything-unstaged-p t)
(user-error "Cannot continue rebase with unstaged changes"))
(t
(let ((dir (magit-gitdir)))
(when (and (magit-anything-staged-p)
(file-exists-p (expand-file-name "rebase-merge" dir))
(not (member (magit-toplevel)
magit--rebase-public-edit-confirmed)))
(magit-commit-amend-assert
(magit-file-line (expand-file-name "rebase-merge/orig-head" dir)))))
(if noedit
(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)
magit-this-process)
(magit-run-git-sequencer (magit--rebase-resume-command) "--continue")))))
;;;###autoload
(defun magit-rebase-skip ()
@@ -942,8 +940,7 @@ If no such sequence is in progress, do nothing."
(commit
(magit-sequence-insert-commit
"pick" commit 'magit-sequence-pick))
(t
(magit-sequence-insert-am-patch
((magit-sequence-insert-am-patch
"pick" patch 'magit-sequence-pick)))
(cl-decf i)))
(magit-sequence-insert-sequence nil "ORIG_HEAD")
@@ -1010,7 +1007,7 @@ status buffer (i.e., the reverse of how they will be applied)."
(if (eq (oref obj action-type) 'merge)
(let ((options (oref obj action-options)))
(and (string-match "-[cC] \\([^ ]+\\)" options)
(match-string 1 options)))
(match-str 1 options)))
(oref obj target)))
commits)))))
(cl-assert (equal (length commits) (length abbrevs)))
@@ -1031,9 +1028,8 @@ status buffer (i.e., the reverse of how they will be applied)."
(magit-sequence-insert-sequence
(magit-file-line (expand-file-name "rebase-merge/stopped-sha" dir))
onto
(and-let* ((lines (magit-file-lines
(expand-file-name "rebase-merge/done" dir))))
(cadr (split-string (car (last lines))))))))
(and$ (magit-file-lines (expand-file-name "rebase-merge/done" dir))
(cadr (split-string (car (last $))))))))
(defun magit-rebase-insert-apply-sequence (onto)
(let* ((dir (magit-gitdir))
@@ -1090,15 +1086,14 @@ status buffer (i.e., the reverse of how they will be applied)."
(equal (magit-patch-id unstaged) id))
"same")
;; ...and some changes are gone and/or others were added.
(t "work")))
("work")))
stop 'magit-sequence-part))
;; The commit is definitely gone...
((assoc (##magit-rev-equal % stop) done)
;; ...but all of its changes are still in effect.
(magit-sequence-insert-commit "poof" stop 'magit-sequence-drop))
(t
;; ...and some changes are gone and/or other changes were added.
(magit-sequence-insert-commit "gone" stop 'magit-sequence-drop)))
;; ...and some changes are gone and/or other changes were added.
((magit-sequence-insert-commit "gone" stop 'magit-sequence-drop)))
(setq stop nil))))
(pcase-dolist (`(,rev ,abbrev ,msg) done)
(apply #'magit-sequence-insert-commit
@@ -1116,8 +1111,7 @@ status buffer (i.e., the reverse of how they will be applied)."
abbrev msg))
((equal rev head)
(list "done" rev 'magit-sequence-head abbrev msg))
(t
(list "done" rev 'magit-sequence-done abbrev msg)))))
((list "done" rev 'magit-sequence-done abbrev msg)))))
(magit-sequence-insert-commit "onto" onto
(if (equal onto head)
'magit-sequence-head
@@ -1126,9 +1120,9 @@ status buffer (i.e., the reverse of how they will be applied)."
(defun magit-sequence-insert-commit (type hash face &optional abbrev msg)
(magit-insert-section (commit hash)
(magit-insert-heading
(propertize type 'font-lock-face face) " "
(magit--propertize-face type face) " "
(if abbrev
(concat (propertize abbrev 'face 'magit-hash) " " msg "\n")
(concat (magit--propertize-face abbrev 'magit-hash) " " msg "\n")
(concat (magit-format-rev-summary hash) "\n")))))
(defun magit-sequence-insert-step (type target)
@@ -1141,4 +1135,15 @@ status buffer (i.e., the reverse of how they will be applied)."
;;; _
(provide 'magit-sequence)
;; Local Variables:
;; read-symbol-shorthands: (
;; ("and$" . "cond-let--and$")
;; ("and>" . "cond-let--and>")
;; ("and-let" . "cond-let--and-let")
;; ("if-let" . "cond-let--if-let")
;; ("when-let" . "cond-let--when-let")
;; ("while-let" . "cond-let--while-let")
;; ("match-string" . "match-string")
;; ("match-str" . "match-string-no-properties"))
;; End:
;;; magit-sequence.el ends here