From a53715eff1e16c21e7493289031991ae0f17a1f3 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 25 Nov 2025 19:35:56 +0100 Subject: [PATCH] update magit --- .../.dir-locals.el | 0 .../AUTHORS.md | 1 + .../LICENSE | 0 .../dir | 0 .../git-commit.el | 68 +- .../git-rebase.el | 239 ++- .../magit-apply.el | 97 +- .../magit-autoloads.el | 78 +- .../magit-autorevert.el | 28 +- .../magit-base.el | 150 +- .../magit-bisect.el | 15 +- .../magit-blame.el | 107 +- .../magit-bookmark.el | 16 + .../magit-branch.el | 177 ++- .../magit-bundle.el | 13 +- .../magit-clone.el | 29 +- .../magit-commit.el | 21 +- .../magit-core.el | 11 + .../magit-diff.el | 1403 +++++++++-------- .../magit-dired.el | 17 +- .../magit-ediff.el | 46 +- .../magit-extras.el | 217 +-- .../magit-fetch.el | 14 +- .../magit-files.el | 204 ++- .../magit-git.el | 735 +++++---- .../magit-gitignore.el | 19 +- .../magit-log.el | 526 +++--- .../magit-margin.el | 172 +- .../magit-merge.el | 46 +- .../magit-mode.el | 445 +++--- .../magit-notes.el | 33 +- .../magit-patch.el | 27 +- .../magit-pkg.el | 19 +- .../magit-process.el | 188 ++- .../magit-pull.el | 30 +- .../magit-push.el | 45 +- .../magit-reflog.el | 17 +- .../magit-refs.el | 164 +- .../magit-remote.el | 15 +- .../magit-repos.el | 66 +- .../magit-reset.el | 17 +- .../magit-sequence.el | 120 +- .../magit-sparse-checkout.el | 21 +- .../magit-stash.el | 24 +- .../magit-status.el | 211 +-- .../magit-submodule.el | 42 +- .../magit-subtree.el | 11 + .../magit-tag.el | 38 +- .../magit-transient.el | 93 +- .../magit-wip.el | 118 +- .../magit-worktree.el | 169 +- .../magit.el | 121 +- .../magit.info | 1061 +++++++------ .../dir | 0 .../magit-section-autoloads.el | 0 .../magit-section-pkg.el | 15 +- .../magit-section.el | 587 +++---- .../magit-section.info | 2 +- 58 files changed, 4604 insertions(+), 3544 deletions(-) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/.dir-locals.el (100%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/AUTHORS.md (99%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/LICENSE (100%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/dir (100%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/git-commit.el (96%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/git-rebase.el (80%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-apply.el (93%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-autoloads.el (97%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-autorevert.el (92%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-base.el (93%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-bisect.el (95%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-blame.el (93%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-bookmark.el (88%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-branch.el (90%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-bundle.el (92%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-clone.el (94%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-commit.el (97%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-core.el (91%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-diff.el (78%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-dired.el (85%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-ediff.el (95%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-extras.el (86%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-fetch.el (93%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-files.el (78%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-git.el (84%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-gitignore.el (91%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-log.el (83%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-margin.el (60%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-merge.el (91%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-mode.el (81%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-notes.el (86%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-patch.el (93%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-pkg.el (59%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-process.el (91%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-pull.el (89%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-push.el (92%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-reflog.el (92%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-refs.el (88%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-remote.el (96%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-repos.el (91%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-reset.el (91%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-sequence.el (93%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-sparse-checkout.el (92%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-stash.el (97%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-status.el (85%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-submodule.el (96%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-subtree.el (94%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-tag.el (89%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-transient.el (78%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-wip.el (85%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit-worktree.el (51%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit.el (89%) rename elpa/{magit-20250519.1537 => magit-20251103.1130}/magit.info (96%) rename elpa/{magit-section-20250518.653 => magit-section-20251027.1634}/dir (100%) rename elpa/{magit-section-20250518.653 => magit-section-20251027.1634}/magit-section-autoloads.el (100%) rename elpa/{magit-section-20250518.653 => magit-section-20251027.1634}/magit-section-pkg.el (55%) rename elpa/{magit-section-20250518.653 => magit-section-20251027.1634}/magit-section.el (87%) rename elpa/{magit-section-20250518.653 => magit-section-20251027.1634}/magit-section.info (99%) diff --git a/elpa/magit-20250519.1537/.dir-locals.el b/elpa/magit-20251103.1130/.dir-locals.el similarity index 100% rename from elpa/magit-20250519.1537/.dir-locals.el rename to elpa/magit-20251103.1130/.dir-locals.el diff --git a/elpa/magit-20250519.1537/AUTHORS.md b/elpa/magit-20251103.1130/AUTHORS.md similarity index 99% rename from elpa/magit-20250519.1537/AUTHORS.md rename to elpa/magit-20251103.1130/AUTHORS.md index e0b88d92..ba62bdf3 100644 --- a/elpa/magit-20250519.1537/AUTHORS.md +++ b/elpa/magit-20251103.1130/AUTHORS.md @@ -411,6 +411,7 @@ All Contributors - Wouter Bolsterlee - X4lldux - Xavier Noria +- Xavier Young - Xu Chunyang - Yann Herklotz - Yann Hodique diff --git a/elpa/magit-20250519.1537/LICENSE b/elpa/magit-20251103.1130/LICENSE similarity index 100% rename from elpa/magit-20250519.1537/LICENSE rename to elpa/magit-20251103.1130/LICENSE diff --git a/elpa/magit-20250519.1537/dir b/elpa/magit-20251103.1130/dir similarity index 100% rename from elpa/magit-20250519.1537/dir rename to elpa/magit-20251103.1130/dir diff --git a/elpa/magit-20250519.1537/git-commit.el b/elpa/magit-20251103.1130/git-commit.el similarity index 96% rename from elpa/magit-20250519.1537/git-commit.el rename to elpa/magit-20251103.1130/git-commit.el index 206cef88..0bcad3d3 100644 --- a/elpa/magit-20250519.1537/git-commit.el +++ b/elpa/magit-20251103.1130/git-commit.el @@ -235,7 +235,7 @@ Also see `magit-post-commit-hook'." :type 'hook :get #'magit-hook-custom-get) -(defcustom git-commit-post-finish-hook-timeout 1 +(defcustom git-commit-post-finish-hook-timeout 2 "Time in seconds to wait for git to create a commit. The hook `git-commit-post-finish-hook' (which see) is run only @@ -502,7 +502,7 @@ the redundant bindings, then set this to nil, before loading (not (file-accessible-directory-p (file-name-directory buffer-file-name))) (magit-expand-git-file-name (substring buffer-file-name 2)))) - ((file-accessible-directory-p (file-name-directory file))) + (_(file-accessible-directory-p (file-name-directory file))) (inhibit-read-only t)) (insert-file-contents file t) t)) @@ -619,17 +619,14 @@ Used as the local value of `header-line-format', in buffer using (defun git-commit-run-post-finish-hook (previous) (when git-commit-post-finish-hook - (cl-block nil - (let ((break (time-add (current-time) - (seconds-to-time - git-commit-post-finish-hook-timeout)))) - (while (equal (magit-rev-parse "HEAD") previous) - (if (time-less-p (current-time) break) - (sit-for 0.01) - (message "No commit created after 1 second. Not running %s." - 'git-commit-post-finish-hook) - (cl-return)))) - (run-hooks 'git-commit-post-finish-hook)))) + (if (with-timeout (git-commit-post-finish-hook-timeout) + (while (equal (magit-rev-parse "HEAD") previous) + (sit-for 0.01)) + t) + (run-hooks 'git-commit-post-finish-hook) + (message "No commit created after %s second. Not running %s." + git-commit-post-finish-hook-timeout + 'git-commit-post-finish-hook)))) (define-minor-mode git-commit-mode "Auxiliary minor mode used when editing Git commit messages. @@ -721,15 +718,15 @@ conventions are checked." (save-excursion (goto-char (point-min)) (re-search-forward (git-commit-summary-regexp) nil t) - (if (equal (match-string 1) "") + (if (equal (match-str 1) "") t ; Just try; we don't know whether --allow-empty-message was used. (and (or (not (memq 'overlong-summary-line git-commit-style-convention-checks)) - (equal (match-string 2) "") + (equal (match-str 2) "") (y-or-n-p "Summary line is too long. Commit anyway? ")) (or (not (memq 'non-empty-second-line git-commit-style-convention-checks)) - (not (match-string 3)) + (not (match-str 3)) (y-or-n-p "Second line is not empty. Commit anyway? "))))))) (defun git-commit-cancel-message () @@ -751,7 +748,7 @@ With a numeric prefix ARG, go back ARG messages." ;; non-empty and newly written comment, because otherwise ;; it would be irreversibly lost. (when-let* ((message (git-commit-buffer-message)) - ((not (ring-member log-edit-comment-ring message)))) + (_(not (ring-member log-edit-comment-ring message)))) (ring-insert log-edit-comment-ring message) (cl-incf arg) (setq len (ring-length log-edit-comment-ring))) @@ -799,16 +796,16 @@ Save current message first." (defun git-commit-save-message () "Save current message to `log-edit-comment-ring'." (interactive) - (if-let ((message (git-commit-buffer-message))) - (progn - (when-let ((index (ring-member log-edit-comment-ring message))) - (ring-remove log-edit-comment-ring index)) - (ring-insert log-edit-comment-ring message) - (when git-commit-use-local-message-ring - (magit-repository-local-set 'log-edit-comment-ring - log-edit-comment-ring)) - (message "Message saved")) - (message "Only whitespace and/or comments; message not saved"))) + (cond-let + ([message (git-commit-buffer-message)] + (when-let ((index (ring-member log-edit-comment-ring message))) + (ring-remove log-edit-comment-ring index)) + (ring-insert log-edit-comment-ring message) + (when git-commit-use-local-message-ring + (magit-repository-local-set 'log-edit-comment-ring + log-edit-comment-ring)) + (message "Message saved")) + ((message "Only whitespace and/or comments; message not saved")))) (defun git-commit-prepare-message-ring () (make-local-variable 'log-edit-comment-ring-index) @@ -950,11 +947,11 @@ completion candidates. The input must have the form \"NAME \"." (sort (delete-dups (magit-git-lines "log" "-n9999" "--format=%aN <%ae>")) #'string<) - nil nil nil 'git-commit-read-ident-history))) + nil 'any nil 'git-commit-read-ident-history))) (save-match-data (if (string-match "\\`\\([^<]+\\) *<\\([^>]+\\)>\\'" str) - (list (save-match-data (string-trim (match-string 1 str))) - (string-trim (match-string 2 str))) + (list (save-match-data (string-trim (match-str 1 str))) + (string-trim (match-str 2 str))) (user-error "Invalid input"))))) (defun git-commit--insert-ident-trailer (trailer name email) @@ -1221,4 +1218,15 @@ Elisp doc-strings, including this one. Unlike in doc-strings, "git-commit 4.0.0") (provide 'git-commit) +;; 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: ;;; git-commit.el ends here diff --git a/elpa/magit-20250519.1537/git-rebase.el b/elpa/magit-20251103.1130/git-rebase.el similarity index 80% rename from elpa/magit-20250519.1537/git-rebase.el rename to elpa/magit-20251103.1130/git-rebase.el index 65441f89..614887f0 100644 --- a/elpa/magit-20250519.1537/git-rebase.el +++ b/elpa/magit-20251103.1130/git-rebase.el @@ -44,8 +44,8 @@ ;; M-p Move the commit at point up. ;; M-n Move the commit at point down. ;; -;; k Drop the commit at point. -;; c Don't drop the commit at point. +;; d Drop the commit at point. +;; c Keep the commit at point. ;; r Change the message of the commit at point. ;; e Edit the commit at point. ;; s Squash the commit at point, into the one above. @@ -53,6 +53,7 @@ ;; b Break for editing at this point in the sequence. ;; x Add a script to be run with the commit at point ;; being checked out. +;; k Un-/comment current line. ;; z Add noop action at point. ;; ;; SPC Show the commit at point in another buffer. @@ -152,6 +153,7 @@ "M-p" #'git-rebase-move-line-up "M-n" #'git-rebase-move-line-down "c" #'git-rebase-pick + "d" #'git-rebase-drop "k" #'git-rebase-kill-line "C-k" #'git-rebase-kill-line "b" #'git-rebase-break @@ -160,11 +162,14 @@ "M M" #'git-rebase-merge "M t" #'git-rebase-merge-toggle-editmsg "m" #'git-rebase-edit + "s" #'git-rebase-squash + "S" #'git-rebase-squish "f" #'git-rebase-fixup + "F" #'git-rebase-alter + "A" #'git-rebase-alter "q" #'undefined "r" #'git-rebase-reword "w" #'git-rebase-reword - "s" #'git-rebase-squash "t" #'git-rebase-reset "u" #'git-rebase-update-ref "x" #'git-rebase-exec @@ -176,6 +181,7 @@ "M-" #'git-rebase-move-line-up "M-" #'git-rebase-move-line-down " " #'git-rebase-undo) +(put 'git-rebase-alter :advertised-binding (kbd "F")) (put 'git-rebase-reword :advertised-binding (kbd "r")) (put 'git-rebase-move-line-up :advertised-binding (kbd "M-p")) (put 'git-rebase-kill-line :advertised-binding (kbd "k")) @@ -184,6 +190,7 @@ "Git-Rebase mode menu." '("Rebase" ["Pick" git-rebase-pick t] + ["Drop" git-rebase-drop t] ["Reword" git-rebase-reword t] ["Edit" git-rebase-edit t] ["Squash" git-rebase-squash t] @@ -208,10 +215,22 @@ (git-rebase-show-commit . "show the commit at point in another buffer and select its window") (undo . "undo last change") - (git-rebase-kill-line . "drop the commit at point") + (git-rebase-drop . "drop the commit at point") + (git-rebase-kill-line . "un-/comment current line") (git-rebase-insert . "insert a line for an arbitrary commit") (git-rebase-noop . "add noop action at point"))) +(defvar git-rebase-fixup-descriptions + '((git-rebase-squish + . "fixup -c = use commit, but meld into previous commit,\n#\ + dropping previous commit's message, and open the editor") + (git-rebase-fixup + . "fixup = use commit, but meld into previous commit,\n#\ + dropping 's message") + (git-rebase-alter + . "fixup -C = use commit, but meld into previous commit,\n#\ + dropping previous commit's message"))) + ;;; Commands (defun git-rebase-pick () @@ -220,6 +239,12 @@ If the region is active, act on all lines touched by the region." (interactive) (git-rebase-set-action "pick")) +(defun git-rebase-drop () + "Drop commit on current line. +If the region is active, act on all lines touched by the region." + (interactive) + (git-rebase-set-action "drop")) + (defun git-rebase-reword () "Edit message of commit on current line. If the region is active, act on all lines touched by the region." @@ -233,21 +258,38 @@ If the region is active, act on all lines touched by the region." (git-rebase-set-action "edit")) (defun git-rebase-squash () - "Meld commit on current line into previous commit, edit message. + "Fold commit on current line into previous commit, edit combined message. If the region is active, act on all lines touched by the region." (interactive) (git-rebase-set-action "squash")) +(defun git-rebase-squish () + "Fold current into previous commit, discard previous message and edit current. +This is like `git-rebase-squash', except that the other message is kept. +The action indicatore shown in the list commits is \"fixup -c\". If the +region is active, act on all lines touched by the region." + (interactive) + (git-rebase-set-action "fixup -c")) + (defun git-rebase-fixup () - "Meld commit on current line into previous commit, discard its message. + "Fold commit on current line into previous commit, discard current message. If the region is active, act on all lines touched by the region." (interactive) (git-rebase-set-action "fixup")) +(defun git-rebase-alter () + "Meld current into previous commit, discard previous message and use current. +This is like `git-rebase-fixup', except that the other message is kept. +The action indicatore shown in the list commits is \"fixup -C\". If the +region is active, act on all lines touched by the region." + (interactive) + (git-rebase-set-action "fixup -C")) + (defvar-local git-rebase-comment-re nil) (defvar git-rebase-short-options '((?b . "break") + (?d . "drop") (?e . "edit") (?f . "fixup") (?l . "label") @@ -279,14 +321,22 @@ If the region is active, act on all lines touched by the region." (abbrev))) (defvar git-rebase-line-regexps + ;; 1: action, 2: option, 3: target, 4: "#", 5: description. + ;; + ;; [[# ] ] + ;; fixup [-C|-c] [[# ] ] `((commit . ,(concat - (regexp-opt '("e" "edit" - "f" "fixup" - "p" "pick" - "r" "reword" - "s" "squash") + (regexp-opt '("d" "drop" + "e" "edit" + "f" "fixup" + "f -C" "fixup -C" + "f -c" "fixup -c" + "p" "pick" + "r" "reword" + "s" "squash") "\\(?1:") - " \\(?3:[^ \n]+\\) ?\\(?4:.*\\)")) + " \\(?3:[^ \n]+\\)" + "\\(?: \\(?4:# \\)?\\(?5:.*\\)\\)?")) (exec . "\\(?1:x\\|exec\\) \\(?3:.*\\)") (bare . ,(concat (regexp-opt '("b" "break" "noop") "\\(?1:") " *$")) @@ -294,37 +344,44 @@ If the region is active, act on all lines touched by the region." "t" "reset" "u" "update-ref") "\\(?1:") - " \\(?3:[^ \n]+\\) ?\\(?4:.*\\)")) + " \\(?3:[^ \n]+\\)" + "\\(?: \\(?4:# \\)?\\(?5:.*\\)\\)?")) + ;; merge [-C | -c ]