From e39db7fdbbb548122968b8300dc8cecdc8207468 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 26 Apr 2026 19:58:15 +0200 Subject: [PATCH] update magit --- .../.dir-locals.el | 9 +- .../AUTHORS.md | 2 + .../LICENSE | 0 elpa/magit-20260422.2206/README-elpa | 10 + .../dir | 0 .../git-commit.el | 285 +++- .../git-hooks/applypatch-msg | 0 .../git-hooks/commit-msg | 0 .../git-hooks/fallthrough | 0 .../git-hooks/fsmonitor-watchman | 0 .../git-hooks/p4-changelist | 0 .../git-hooks/p4-post-changelist | 0 .../git-hooks/p4-pre-submit | 0 .../git-hooks/p4-prepare-changelist | 0 .../git-hooks/post-applypatch | 0 .../git-hooks/post-checkout | 0 .../git-hooks/post-commit | 0 .../git-hooks/post-index-change | 0 .../git-hooks/post-merge | 0 .../git-hooks/post-receive | 0 .../git-hooks/post-rewrite | 0 .../git-hooks/post-update | 0 .../git-hooks/pre-applypatch | 0 .../git-hooks/pre-auto-gc | 0 .../git-hooks/pre-commit | 0 .../git-hooks/pre-merge-commit | 0 .../git-hooks/pre-push | 0 .../git-hooks/pre-rebase | 0 .../git-hooks/pre-receive | 0 .../git-hooks/prepare-commit-msg | 0 .../git-hooks/proc-receive | 0 .../git-hooks/push-to-checkout | 0 .../git-hooks/reference-transaction | 0 .../git-hooks/sendemail-validate | 0 .../git-hooks/update | 0 .../git-rebase.el | 103 +- .../magit-apply.el | 95 +- .../magit-autoloads.el | 1172 +++++++------ .../magit-autorevert.el | 2 +- .../magit-base.el | 124 +- .../magit-bisect.el | 3 +- .../magit-blame.el | 9 +- .../magit-bookmark.el | 30 +- .../magit-branch.el | 375 ++--- .../magit-bundle.el | 41 +- .../magit-clone.el | 15 +- .../magit-commit.el | 196 +-- .../magit-core.el | 3 +- .../magit-diff.el | 1451 ++++++++++------- .../magit-dired.el | 3 +- .../magit-ediff.el | 342 ++-- .../magit-extras.el | 189 +-- .../magit-fetch.el | 27 +- .../magit-files.el | 504 ++++-- .../magit-git.el | 498 +++--- .../magit-gitignore.el | 170 +- .../magit-log.el | 199 +-- .../magit-margin.el | 3 +- .../magit-merge.el | 57 +- .../magit-mode.el | 139 +- .../magit-notes.el | 3 +- .../magit-patch.el | 53 +- .../magit-pkg.el | 12 +- .../magit-process.el | 84 +- .../magit-pull.el | 21 +- .../magit-push.el | 135 +- .../magit-reflog.el | 3 +- .../magit-refs.el | 98 +- .../magit-remote.el | 134 +- .../magit-repos.el | 7 +- .../magit-reset.el | 3 +- .../magit-sequence.el | 278 ++-- .../magit-sparse-checkout.el | 35 +- .../magit-stash.el | 24 +- .../magit-status.el | 93 +- .../magit-submodule.el | 77 +- .../magit-subtree.el | 35 +- .../magit-tag.el | 135 +- .../magit-transient.el | 56 +- .../magit-wip.el | 167 +- .../magit-worktree.el | 101 +- .../magit.el | 13 +- .../magit.info | 663 ++++---- elpa/magit-section-20260422.2206/README-elpa | 4 + .../dir | 0 .../magit-section-autoloads.el | 8 +- .../magit-section-pkg.el | 8 +- .../magit-section.el | 365 +++-- .../magit-section.info | 6 +- .../README-elpa} | 8 + .../magit-todos-autoloads.el | 16 +- .../magit-todos-pkg.el | 6 +- .../magit-todos.el | 34 +- 93 files changed, 4848 insertions(+), 3893 deletions(-) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/.dir-locals.el (65%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/AUTHORS.md (99%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/LICENSE (100%) create mode 100644 elpa/magit-20260422.2206/README-elpa rename elpa/{magit-20251217.1836 => magit-20260422.2206}/dir (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-commit.el (86%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/applypatch-msg (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/commit-msg (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/fallthrough (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/fsmonitor-watchman (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/p4-changelist (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/p4-post-changelist (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/p4-pre-submit (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/p4-prepare-changelist (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-applypatch (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-checkout (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-commit (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-index-change (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-merge (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-receive (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-rewrite (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/post-update (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/pre-applypatch (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/pre-auto-gc (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/pre-commit (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/pre-merge-commit (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/pre-push (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/pre-rebase (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/pre-receive (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/prepare-commit-msg (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/proc-receive (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/push-to-checkout (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/reference-transaction (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/sendemail-validate (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-hooks/update (100%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/git-rebase.el (93%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-apply.el (93%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-autoloads.el (66%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-autorevert.el (99%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-base.el (92%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-bisect.el (99%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-blame.el (99%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-bookmark.el (88%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-branch.el (77%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-bundle.el (80%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-clone.el (97%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-commit.el (86%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-core.el (97%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-diff.el (77%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-dired.el (97%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-ediff.el (67%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-extras.el (86%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-fetch.el (90%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-files.el (54%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-git.el (91%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-gitignore.el (51%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-log.el (94%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-margin.el (99%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-merge.el (88%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-mode.el (94%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-notes.el (98%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-patch.el (88%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-pkg.el (73%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-process.el (96%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-pull.el (91%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-push.el (79%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-reflog.el (98%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-refs.el (92%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-remote.el (78%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-repos.el (98%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-reset.el (98%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-sequence.el (84%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-sparse-checkout.el (85%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-stash.el (97%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-status.el (92%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-submodule.el (93%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-subtree.el (85%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-tag.el (68%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-transient.el (83%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-wip.el (71%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit-worktree.el (78%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit.el (99%) rename elpa/{magit-20251217.1836 => magit-20260422.2206}/magit.info (97%) create mode 100644 elpa/magit-section-20260422.2206/README-elpa rename elpa/{magit-section-20251220.917 => magit-section-20260422.2206}/dir (100%) rename elpa/{magit-section-20251220.917 => magit-section-20260422.2206}/magit-section-autoloads.el (91%) rename elpa/{magit-section-20251220.917 => magit-section-20260422.2206}/magit-section-pkg.el (72%) rename elpa/{magit-section-20251220.917 => magit-section-20260422.2206}/magit-section.el (92%) rename elpa/{magit-section-20251220.917 => magit-section-20260422.2206}/magit-section.info (99%) rename elpa/{magit-todos-readme.txt => magit-todos-20250928.1611/README-elpa} (62%) rename elpa/{magit-todos-20240927.52 => magit-todos-20250928.1611}/magit-todos-autoloads.el (80%) rename elpa/{magit-todos-20240927.52 => magit-todos-20250928.1611}/magit-todos-pkg.el (79%) rename elpa/{magit-todos-20240927.52 => magit-todos-20250928.1611}/magit-todos.el (98%) diff --git a/elpa/magit-20251217.1836/.dir-locals.el b/elpa/magit-20260422.2206/.dir-locals.el similarity index 65% rename from elpa/magit-20251217.1836/.dir-locals.el rename to elpa/magit-20260422.2206/.dir-locals.el index ea760dc2..07a40bba 100644 --- a/elpa/magit-20251217.1836/.dir-locals.el +++ b/elpa/magit-20260422.2206/.dir-locals.el @@ -1,11 +1,12 @@ ((nil (indent-tabs-mode . nil)) + (emacs-lisp-mode + (checkdoc-allow-quoting-nil-and-t . t) + (lisp-indent-local-overrides . ((cond . 0) (interactive . 0)))) (makefile-mode (indent-tabs-mode . t) - (outline-regexp . "#\\(#+\\)") - (mode . outline-minor)) - (emacs-lisp-mode - (checkdoc-allow-quoting-nil-and-t . t)) + (mode . outline-minor) + (outline-regexp . "#\\(#+\\)")) (git-commit-mode (git-commit-major-mode . git-commit-elisp-text-mode)) (".github/PULL_REQUEST_TEMPLATE" diff --git a/elpa/magit-20251217.1836/AUTHORS.md b/elpa/magit-20260422.2206/AUTHORS.md similarity index 99% rename from elpa/magit-20251217.1836/AUTHORS.md rename to elpa/magit-20260422.2206/AUTHORS.md index e1673d29..b1b22374 100644 --- a/elpa/magit-20251217.1836/AUTHORS.md +++ b/elpa/magit-20260422.2206/AUTHORS.md @@ -49,6 +49,7 @@ All Contributors - Alex Kreisher - Alex Ott - Allen Li +- Andrea Alberti - Andreas Fuchs - Andreas Liljeqvist - Andreas Rottmann @@ -230,6 +231,7 @@ All Contributors - Lele Gaifax - Lénaïc Huard - Leo Liu +- Leonard Lausen - Leonardo Etcheverry - Leo Vivier - Li Chen diff --git a/elpa/magit-20251217.1836/LICENSE b/elpa/magit-20260422.2206/LICENSE similarity index 100% rename from elpa/magit-20251217.1836/LICENSE rename to elpa/magit-20260422.2206/LICENSE diff --git a/elpa/magit-20260422.2206/README-elpa b/elpa/magit-20260422.2206/README-elpa new file mode 100644 index 00000000..347b1de2 --- /dev/null +++ b/elpa/magit-20260422.2206/README-elpa @@ -0,0 +1,10 @@ +Magit is a text-based Git user interface that puts an unmatched focus +on streamlining workflows. Commands are invoked using short mnemonic +key sequences that take the cursor’s position in the highly actionable +interface into account to provide context-sensitive behavior. + +With Magit you can do nearly everything that you can do when using Git +on the command-line, but at greater speed and while taking advantage +of advanced features that previously seemed too daunting to use on a +daily basis. Many users will find that by using Magit they can become +more effective Git user. diff --git a/elpa/magit-20251217.1836/dir b/elpa/magit-20260422.2206/dir similarity index 100% rename from elpa/magit-20251217.1836/dir rename to elpa/magit-20260422.2206/dir diff --git a/elpa/magit-20251217.1836/git-commit.el b/elpa/magit-20260422.2206/git-commit.el similarity index 86% rename from elpa/magit-20251217.1836/git-commit.el rename to elpa/magit-20260422.2206/git-commit.el index 82c4dee0..9535c635 100644 --- a/elpa/magit-20251217.1836/git-commit.el +++ b/elpa/magit-20260422.2206/git-commit.el @@ -1,6 +1,6 @@ ;;; git-commit.el --- Edit Git commit messages -*- lexical-binding:t; coding:utf-8 -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Sebastian Wiesner @@ -110,6 +110,7 @@ (require 'transient) (require 'with-editor) +(defvar dabbrev--abbrev-char-regexp) (defvar diff-default-read-only) (defvar flyspell-generic-check-word-predicate) (defvar font-lock-beg) @@ -118,6 +119,12 @@ (defvar git-commit-need-summary-line) +(declare-function dabbrev--reset-global-variables "dabbrev" ()) +(declare-function dabbrev-capf "dabbrev" ()) +(declare-function magit-commit-diff--args "magit-commit" ()) +(declare-function magit-diff--modified-defuns "magit-diff" ()) +(declare-function magit-diff-arguments "magit-diff" (&optional mode)) + (define-obsolete-variable-alias 'git-commit-known-pseudo-headers 'git-commit-trailers @@ -132,42 +139,6 @@ :link '(info-link "(magit)Editing Commit Messages") :group 'tools) -(define-minor-mode global-git-commit-mode - "Edit Git commit messages. - -This global mode arranges for `git-commit-setup' to be called -when a Git commit message file is opened. That usually happens -when Git uses the Emacsclient as $GIT_EDITOR to have the user -provide such a commit message. - -Loading the library `git-commit' by default enables this mode, -but the library is not automatically loaded because doing that -would pull in many dependencies and increase startup time too -much. You can either rely on `magit' loading this library or -you can load it explicitly. Autoloading is not an alternative -because in this case autoloading would immediately trigger -full loading." - :group 'git-commit - :type 'boolean - :global t - :init-value t - :initialize - (lambda (symbol exp) - (custom-initialize-default symbol exp) - (when global-git-commit-mode - (add-hook 'find-file-hook #'git-commit-setup-check-buffer) - (remove-hook 'after-change-major-mode-hook - #'git-commit-setup-font-lock-in-buffer))) - (cond - (global-git-commit-mode - (add-hook 'find-file-hook #'git-commit-setup-check-buffer) - (add-hook 'after-change-major-mode-hook - #'git-commit-setup-font-lock-in-buffer)) - (t - (remove-hook 'find-file-hook #'git-commit-setup-check-buffer) - (remove-hook 'after-change-major-mode-hook - #'git-commit-setup-font-lock-in-buffer)))) - (defcustom git-commit-major-mode #'text-mode "Major mode used to edit Git commit messages. @@ -198,9 +169,11 @@ Also note that `git-commit-mode' (which see) is not a major-mode.") (defcustom git-commit-setup-hook (list #'git-commit-ensure-comment-gap #'git-commit-save-message + #'git-commit-setup-capf #'git-commit-setup-changelog-support - #'git-commit-turn-on-auto-fill + #'git-commit-setup-auto-fill #'git-commit-propertize-diff + #'git-commit-collapse-diff #'bug-reference-mode) "Hook run at the end of `git-commit-setup'." :group 'git-commit @@ -208,12 +181,14 @@ Also note that `git-commit-mode' (which see) is not a major-mode.") :get #'magit-hook-custom-get :options '(git-commit-ensure-comment-gap git-commit-save-message + git-commit-setup-capf git-commit-setup-changelog-support magit-generate-changelog - git-commit-turn-on-auto-fill - git-commit-turn-on-orglink - git-commit-turn-on-flyspell + git-commit-setup-auto-fill + git-commit-setup-orglink + git-commit-setup-flyspell git-commit-propertize-diff + git-commit-collapse-diff bug-reference-mode)) (defcustom git-commit-finish-query-functions @@ -363,6 +338,11 @@ In this context a \"keyword\" is text surrounded by brackets." "Face used for headings in commit message comments." :group 'git-commit-faces) +(defface git-commit-comment-button + '((t :inherit git-commit-comment-heading :underline t)) + "Face used for buttons in commit message comments." + :group 'git-commit-faces) + (defface git-commit-comment-file '((t :inherit git-commit-trailer-value)) "Face used for file names in commit message comments." @@ -437,7 +417,43 @@ the redundant bindings, then set this to nil, before loading ["Cancel" with-editor-cancel t] ["Commit" with-editor-finish t])) -;;; Hooks +;;; Global Mode + +(define-minor-mode global-git-commit-mode + "Edit Git commit messages. + +This global mode arranges for `git-commit-setup' to be called +when a Git commit message file is opened. That usually happens +when Git uses the Emacsclient as $GIT_EDITOR to have the user +provide such a commit message. + +Loading the library `git-commit' by default enables this mode, +but the library is not automatically loaded because doing that +would pull in many dependencies and increase startup time too +much. You can either rely on `magit' loading this library or +you can load it explicitly. Autoloading is not an alternative +because in this case autoloading would immediately trigger +full loading." + :group 'git-commit + :type 'boolean + :global t + :init-value t + :initialize + (lambda (symbol exp) + (custom-initialize-default symbol exp) + (when global-git-commit-mode + (add-hook 'find-file-hook #'git-commit-setup-check-buffer) + (remove-hook 'after-change-major-mode-hook + #'git-commit-setup-font-lock-in-buffer))) + (cond + (global-git-commit-mode + (add-hook 'find-file-hook #'git-commit-setup-check-buffer) + (add-hook 'after-change-major-mode-hook + #'git-commit-setup-font-lock-in-buffer)) + (t + (remove-hook 'find-file-hook #'git-commit-setup-check-buffer) + (remove-hook 'after-change-major-mode-hook + #'git-commit-setup-font-lock-in-buffer)))) (defconst git-commit-filename-regexp "/\\(\ \\(\\(COMMIT\\|NOTES\\|PULLREQ\\|MERGEREQ\\|TAG\\)_EDIT\\|MERGE_\\|\\)MSG\ @@ -458,8 +474,6 @@ the redundant bindings, then set this to nil, before loading (string-match-p git-commit-filename-regexp buffer-file-name)) (git-commit-setup))) -(defvar git-commit-mode) - (defun git-commit-file-not-found () ;; cygwin git will pass a cygwin path (/cygdrive/c/foo/.git/...), ;; try to handle this in window-nt Emacs. @@ -480,6 +494,10 @@ the redundant bindings, then set this to nil, before loading (when (eq system-type 'windows-nt) (add-hook 'find-file-not-found-functions #'git-commit-file-not-found)) +;;; Local Mode + +(defvar git-commit-mode) + (defconst git-commit-default-usage-message "\ Type \\[with-editor-finish] to finish, \ \\[with-editor-cancel] to cancel, and \ @@ -504,6 +522,12 @@ Used as the local value of `header-line-format', in buffer using (setq git-commit-usage-message nil) ; show a shorter message") (defun git-commit-setup () + ;; If an error occurs when `emacsclient' is used, and it turns out + ;; to not be triggered by something in this function, then another + ;; likely source are functions on `server-switch-hook'. Debugging + ;; is suppressed while running that hook, so it may be necessary to + ;; force debugging by modifying those functions directly. Enabling + ;; `magit-process-record-invocations' may also help. (let ((gitdir default-directory) (cd (and git-commit-cd-to-toplevel (or (car (rassoc default-directory magit--separated-gitdirs)) @@ -568,9 +592,9 @@ Used as the local value of `header-line-format', in buffer using (with-demoted-errors "Error running git-commit-setup-hook: %S" (run-hooks 'git-commit-setup-hook)) (set-buffer-modified-p nil) - (when-let ((format git-commit-header-line-format)) + (when$ git-commit-header-line-format (setq header-line-format - (if (stringp format) (substitute-command-keys format) format))) + (if (stringp $) (substitute-command-keys $) $))) (when git-commit-usage-message (setq with-editor-usage-message git-commit-usage-message)) (with-editor-usage-message)) @@ -585,6 +609,8 @@ used." (put 'git-commit-mode 'permanent-local t) +;;; Setup + (defun git-commit-ensure-comment-gap () "Separate initial empty line from initial comment. If the buffer begins with an empty line followed by a comment, insert @@ -595,25 +621,36 @@ the input isn't tacked to the comment." (when (looking-at (format "\\`\n%s" comment-start)) (open-line 1)))) +(defun git-commit-setup-capf () + "Teach `complete-symbol' about `dabbrev-capf'. +When \"git commit\"'s \"--verbose\" argument is used, this allows +completing modified symbols and other text appearing in the diff." + (require 'dabbrev) + (unless dabbrev--abbrev-char-regexp + ;; Initialize (not "reset") variables. See #5545. + (dabbrev--reset-global-variables)) + (add-hook 'completion-at-point-functions #'dabbrev-capf -90 t)) + (defun git-commit-setup-changelog-support () "Treat ChangeLog entries as unindented paragraphs." (setq-local fill-paragraph-function #'log-edit-fill-entry) (setq-local fill-indent-according-to-mode t) (setq-local paragraph-start (concat paragraph-start "\\|\\*\\|("))) -(defun git-commit-turn-on-auto-fill () +(defun git-commit-setup-auto-fill () "Unconditionally turn on Auto Fill mode. Ensure auto filling happens everywhere, except in the summary line." (auto-fill-mode 1) (setq-local comment-auto-fill-only-comments nil) (when git-commit-need-summary-line - (setq-local auto-fill-function #'git-commit-auto-fill-except-summary))) + (setq-local auto-fill-function #'git-commit--auto-fill-except-summary))) -(defun git-commit-auto-fill-except-summary () +(defun git-commit--auto-fill-except-summary () + "Do not fill summary line." (unless (eq (line-beginning-position) 1) (do-auto-fill))) -(defun git-commit-turn-on-orglink () +(defun git-commit-setup-orglink () "Turn on Orglink mode if it is available. If `git-commit-major-mode' is `org-mode', then silently forgo turning on `orglink-mode'." @@ -623,15 +660,14 @@ turning on `orglink-mode'." (setq-local orglink-match-anywhere t) (orglink-mode 1))) -(defun git-commit-turn-on-flyspell () +(defun git-commit-setup-flyspell () "Unconditionally turn on Flyspell mode. Also check text that is already in the buffer, while avoiding to check most text that Git will strip from the final message, such as the last comment and anything below the cut line (\"--- >8 ---\")." (require 'flyspell) (flyspell-mode 1) - (setq flyspell-generic-check-word-predicate - #'git-commit-flyspell-verify) + (setq flyspell-generic-check-word-predicate #'git-commit--flyspell-verify) (let ((end nil) ;; The "cut line" is defined in "git/wt-status.c". It appears ;; in the commit message when `commit.verbose' is set to true. @@ -647,10 +683,37 @@ comment and anything below the cut line (\"--- >8 ---\")." (setq end (point))) (flyspell-region (point-min) end))) -(defun git-commit-flyspell-verify () +(defun git-commit--flyspell-verify () + "Do not check spelling in comments." (not (= (char-after (line-beginning-position)) (aref comment-start 0)))) +(defun git-commit-collapse-diff () + "Collapse inline diff and add button to allow expanding it." + (save-excursion + (goto-char (point-min)) + (when (re-search-forward (format "%s -+ >8 -+" comment-start) nil t) + (let ((elt '(git-commit-diff t))) + (add-to-invisibility-spec elt) + (make-button (line-beginning-position) (point) + 'face 'git-commit-comment-button + 'keymap (define-keymap :parent button-map + "" #'push-button + "" #'push-button) + 'action (lambda (_) + (if (memq elt buffer-invisibility-spec) + (remove-from-invisibility-spec elt) + (add-to-invisibility-spec elt)) + ;; KLUDGE Force "redisplay". + (when-let ((w1 (selected-window)) + (w2 (next-window))) + (select-window w2) + (select-window w1))))) + (let ((ov (make-overlay (point) (point-max)))) + (overlay-put ov 'invisible 'git-commit-diff))))) + +;;; Finish + (defun git-commit-finish-query-functions (force) (run-hook-with-args-until-failure 'git-commit-finish-query-functions force)) @@ -722,9 +785,9 @@ With a numeric prefix ARG, go forward ARG messages." "Search backward through message history for a match for STRING. Save current message first." (interactive - (list (read-string (format-prompt "Comment substring" - log-edit-last-comment-match) - nil nil log-edit-last-comment-match))) + (list (read-string (format-prompt "Comment substring" + log-edit-last-comment-match) + nil nil log-edit-last-comment-match))) (cl-letf (((symbol-function #'log-edit-previous-comment) (symbol-function #'git-commit-prev-message))) (log-edit-comment-search-backward string))) @@ -733,9 +796,9 @@ Save current message first." "Search forward through message history for a match for STRING. Save current message first." (interactive - (list (read-string (format-prompt "Comment substring" - log-edit-last-comment-match) - nil nil log-edit-last-comment-match))) + (list (read-string (format-prompt "Comment substring" + log-edit-last-comment-match) + nil nil log-edit-last-comment-match))) (cl-letf (((symbol-function #'log-edit-previous-comment) (symbol-function #'git-commit-prev-message))) (log-edit-comment-search-forward string))) @@ -784,6 +847,55 @@ Save current message first." (setq str (replace-match "\n" t t str))) str)))) +;;; Changelog + +(defun git-commit--modified-defuns () + (if (save-excursion + (goto-char (point-min)) + (re-search-forward "^diff --git" nil t)) + (magit-diff--modified-defuns) + (with-temp-buffer + (pcase-let ((`(,rev ,arg) (magit-commit-diff--args))) + (save-excursion + (magit-git-insert "diff" "-p" arg (car (magit-diff-arguments)) rev))) + (magit-diff--modified-defuns)))) + +;;;###autoload +(defun git-commit-insert-changelog-gnu () + "Insert a GNU-style changelog at point while authorig a commit message. + +The modified definitions are extracted from the diff in the message +buffer, which is only available if \"git commit\" was invoked with +\"--verbose\"." + (interactive) + (unless git-commit-mode + (user-error "Not in a commit message buffer")) + ;; Like `change-log-insert-entries'. + (pcase-dolist (`(,file . ,defuns) (git-commit--modified-defuns)) + (if (not defuns) + (insert "* " file ":\n") + (insert "* " file " ") + (dolist (def defuns) + (insert "(" def "):\n"))))) + +;;;###autoload +(defun git-commit-insert-changelog-plain () + "Insert a simple changelog at point while authorig a commit message. + +Defuns are slightly indented and quoted like in elisp docstrings. +The exact format is still subject to change. + +The modified definitions are extracted from the diff in the message +buffer, which is only available if \"git commit\" was invoked with +\"--verbose\"." + (interactive) + (unless git-commit-mode + (user-error "Not in a commit message buffer")) + (pcase-dolist (`(,file . ,defuns) (git-commit--modified-defuns)) + (insert file ":\n") + (dolist (def defuns) + (insert " `" def "'\n")))) + ;;; Trailers (transient-define-prefix git-commit-insert-trailer () @@ -793,19 +905,22 @@ See also manpage git-interpret-trailer(1). This command does not use that Git command, but the initial description still serves as a good introduction." [[:description (##cond (prefix-arg - "Insert ... by someone ") - ("Insert ... by yourself")) + "Insert trailer ... by someone ") + ("Insert trailer ... by yourself")) ("a" "Ack" git-commit-ack) ("m" "Modified" git-commit-modified) ("r" "Reviewed" git-commit-review) ("s" "Signed-off" git-commit-signoff) ("t" "Tested" git-commit-test)] - ["Insert ... by someone" + ["Insert trailer ... by someone" ("C-c" "Cc" git-commit-cc) ("C-r" "Reported" git-commit-reported) ("C-i" "Suggested" git-commit-suggested) ("C-a" "Co-authored" git-commit-co-authored) - ("C-d" "Co-developed" git-commit-co-developed)]]) + ("C-d" "Co-developed" git-commit-co-developed)]] + ["Insert changelog" + ("l g" "GNU-style" git-commit-insert-changelog-gnu) + ("l p" "plain" git-commit-insert-changelog-plain)]) (defun git-commit-ack (name mail) "Insert a trailer acknowledging that you have looked at the commit." @@ -915,20 +1030,20 @@ completion candidates. The input must have the form \"NAME \"." (setq leading-comment-end (point)) (goto-char (point-max)) (cond - ;; Look backwards for existing trailers. - ((re-search-backward (git-commit--trailer-regexp) nil t) - (end-of-line) - (insert ?\n string) - (unless (= (char-after) ?\n) - (insert ?\n))) - ;; Or place the new trailer right before the first non-leading - ;; comments. - (t - (while (re-search-backward (concat "^" comment-start) - leading-comment-end t)) - (unless (looking-back "\n\n" nil) - (insert ?\n)) - (insert string ?\n)))) + ;; Look backwards for existing trailers. + ((re-search-backward (git-commit--trailer-regexp) nil t) + (end-of-line) + (insert ?\n string) + (unless (= (char-after) ?\n) + (insert ?\n))) + ;; Or place the new trailer right before the first non-leading + ;; comments. + (t + (while (re-search-backward (concat "^" comment-start) + leading-comment-end t)) + (unless (looking-back "\n\n" nil) + (insert ?\n)) + (insert string ?\n)))) (unless (or (eobp) (= (char-after) ?\n)) (insert ?\n)))) @@ -1225,6 +1340,19 @@ commit, then the hook is not run at all." 'git-commit-trailer-token "git-commit 4.0.0") +(define-obsolete-function-alias + 'git-commit-turn-on-auto-fill + 'git-commit-setup-auto-fill + "git-commit 4.6.0") +(define-obsolete-function-alias + 'git-commit-turn-on-flyspell + 'git-commit-setup-flyspell + "git-commit 4.6.0") +(define-obsolete-function-alias + 'git-commit-turn-on-orglink + 'git-commit-setup-orglink + "git-commit 4.6.0") + (provide 'git-commit) ;; Local Variables: ;; read-symbol-shorthands: ( @@ -1232,6 +1360,7 @@ commit, then the hook is not run at all." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/git-hooks/applypatch-msg b/elpa/magit-20260422.2206/git-hooks/applypatch-msg similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/applypatch-msg rename to elpa/magit-20260422.2206/git-hooks/applypatch-msg diff --git a/elpa/magit-20251217.1836/git-hooks/commit-msg b/elpa/magit-20260422.2206/git-hooks/commit-msg similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/commit-msg rename to elpa/magit-20260422.2206/git-hooks/commit-msg diff --git a/elpa/magit-20251217.1836/git-hooks/fallthrough b/elpa/magit-20260422.2206/git-hooks/fallthrough similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/fallthrough rename to elpa/magit-20260422.2206/git-hooks/fallthrough diff --git a/elpa/magit-20251217.1836/git-hooks/fsmonitor-watchman b/elpa/magit-20260422.2206/git-hooks/fsmonitor-watchman similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/fsmonitor-watchman rename to elpa/magit-20260422.2206/git-hooks/fsmonitor-watchman diff --git a/elpa/magit-20251217.1836/git-hooks/p4-changelist b/elpa/magit-20260422.2206/git-hooks/p4-changelist similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/p4-changelist rename to elpa/magit-20260422.2206/git-hooks/p4-changelist diff --git a/elpa/magit-20251217.1836/git-hooks/p4-post-changelist b/elpa/magit-20260422.2206/git-hooks/p4-post-changelist similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/p4-post-changelist rename to elpa/magit-20260422.2206/git-hooks/p4-post-changelist diff --git a/elpa/magit-20251217.1836/git-hooks/p4-pre-submit b/elpa/magit-20260422.2206/git-hooks/p4-pre-submit similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/p4-pre-submit rename to elpa/magit-20260422.2206/git-hooks/p4-pre-submit diff --git a/elpa/magit-20251217.1836/git-hooks/p4-prepare-changelist b/elpa/magit-20260422.2206/git-hooks/p4-prepare-changelist similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/p4-prepare-changelist rename to elpa/magit-20260422.2206/git-hooks/p4-prepare-changelist diff --git a/elpa/magit-20251217.1836/git-hooks/post-applypatch b/elpa/magit-20260422.2206/git-hooks/post-applypatch similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-applypatch rename to elpa/magit-20260422.2206/git-hooks/post-applypatch diff --git a/elpa/magit-20251217.1836/git-hooks/post-checkout b/elpa/magit-20260422.2206/git-hooks/post-checkout similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-checkout rename to elpa/magit-20260422.2206/git-hooks/post-checkout diff --git a/elpa/magit-20251217.1836/git-hooks/post-commit b/elpa/magit-20260422.2206/git-hooks/post-commit similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-commit rename to elpa/magit-20260422.2206/git-hooks/post-commit diff --git a/elpa/magit-20251217.1836/git-hooks/post-index-change b/elpa/magit-20260422.2206/git-hooks/post-index-change similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-index-change rename to elpa/magit-20260422.2206/git-hooks/post-index-change diff --git a/elpa/magit-20251217.1836/git-hooks/post-merge b/elpa/magit-20260422.2206/git-hooks/post-merge similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-merge rename to elpa/magit-20260422.2206/git-hooks/post-merge diff --git a/elpa/magit-20251217.1836/git-hooks/post-receive b/elpa/magit-20260422.2206/git-hooks/post-receive similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-receive rename to elpa/magit-20260422.2206/git-hooks/post-receive diff --git a/elpa/magit-20251217.1836/git-hooks/post-rewrite b/elpa/magit-20260422.2206/git-hooks/post-rewrite similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-rewrite rename to elpa/magit-20260422.2206/git-hooks/post-rewrite diff --git a/elpa/magit-20251217.1836/git-hooks/post-update b/elpa/magit-20260422.2206/git-hooks/post-update similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/post-update rename to elpa/magit-20260422.2206/git-hooks/post-update diff --git a/elpa/magit-20251217.1836/git-hooks/pre-applypatch b/elpa/magit-20260422.2206/git-hooks/pre-applypatch similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/pre-applypatch rename to elpa/magit-20260422.2206/git-hooks/pre-applypatch diff --git a/elpa/magit-20251217.1836/git-hooks/pre-auto-gc b/elpa/magit-20260422.2206/git-hooks/pre-auto-gc similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/pre-auto-gc rename to elpa/magit-20260422.2206/git-hooks/pre-auto-gc diff --git a/elpa/magit-20251217.1836/git-hooks/pre-commit b/elpa/magit-20260422.2206/git-hooks/pre-commit similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/pre-commit rename to elpa/magit-20260422.2206/git-hooks/pre-commit diff --git a/elpa/magit-20251217.1836/git-hooks/pre-merge-commit b/elpa/magit-20260422.2206/git-hooks/pre-merge-commit similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/pre-merge-commit rename to elpa/magit-20260422.2206/git-hooks/pre-merge-commit diff --git a/elpa/magit-20251217.1836/git-hooks/pre-push b/elpa/magit-20260422.2206/git-hooks/pre-push similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/pre-push rename to elpa/magit-20260422.2206/git-hooks/pre-push diff --git a/elpa/magit-20251217.1836/git-hooks/pre-rebase b/elpa/magit-20260422.2206/git-hooks/pre-rebase similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/pre-rebase rename to elpa/magit-20260422.2206/git-hooks/pre-rebase diff --git a/elpa/magit-20251217.1836/git-hooks/pre-receive b/elpa/magit-20260422.2206/git-hooks/pre-receive similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/pre-receive rename to elpa/magit-20260422.2206/git-hooks/pre-receive diff --git a/elpa/magit-20251217.1836/git-hooks/prepare-commit-msg b/elpa/magit-20260422.2206/git-hooks/prepare-commit-msg similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/prepare-commit-msg rename to elpa/magit-20260422.2206/git-hooks/prepare-commit-msg diff --git a/elpa/magit-20251217.1836/git-hooks/proc-receive b/elpa/magit-20260422.2206/git-hooks/proc-receive similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/proc-receive rename to elpa/magit-20260422.2206/git-hooks/proc-receive diff --git a/elpa/magit-20251217.1836/git-hooks/push-to-checkout b/elpa/magit-20260422.2206/git-hooks/push-to-checkout similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/push-to-checkout rename to elpa/magit-20260422.2206/git-hooks/push-to-checkout diff --git a/elpa/magit-20251217.1836/git-hooks/reference-transaction b/elpa/magit-20260422.2206/git-hooks/reference-transaction similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/reference-transaction rename to elpa/magit-20260422.2206/git-hooks/reference-transaction diff --git a/elpa/magit-20251217.1836/git-hooks/sendemail-validate b/elpa/magit-20260422.2206/git-hooks/sendemail-validate similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/sendemail-validate rename to elpa/magit-20260422.2206/git-hooks/sendemail-validate diff --git a/elpa/magit-20251217.1836/git-hooks/update b/elpa/magit-20260422.2206/git-hooks/update similarity index 100% rename from elpa/magit-20251217.1836/git-hooks/update rename to elpa/magit-20260422.2206/git-hooks/update diff --git a/elpa/magit-20251217.1836/git-rebase.el b/elpa/magit-20260422.2206/git-rebase.el similarity index 93% rename from elpa/magit-20251217.1836/git-rebase.el rename to elpa/magit-20260422.2206/git-rebase.el index 614887f0..7482847c 100644 --- a/elpa/magit-20251217.1836/git-rebase.el +++ b/elpa/magit-20260422.2206/git-rebase.el @@ -1,6 +1,6 @@ ;;; git-rebase.el --- Edit Git rebase files -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Phil Jackson ;; Maintainer: Jonas Bernoulli @@ -371,14 +371,14 @@ BATCH also ignores commented lines." (and (looking-at (concat re-start re)) type))) git-rebase-line-regexps)] (git-rebase-action - :action-type type - :action (and-let ((action (match-str 1))) - (or (cdr (assoc action git-rebase-short-options)) - action)) - :action-options (match-str 2) - :target (match-str 3) - :trailer (match-str 5) - :comment-p (and (match-str 99) t))) + :action-type type + :action (and-let ((action (match-str 1))) + (or (cdr (assoc action git-rebase-short-options)) + action)) + :action-options (match-str 2) + :target (match-str 3) + :trailer (match-str 5) + :comment-p (and (match-str 99) t))) ((not batch) ;; Use empty object rather than nil to ease handling. (git-rebase-action))))) @@ -399,23 +399,23 @@ of its action type." (with-slots (action-type target trailer comment-p) (git-rebase-current-line) (cond - ((and action (eq action-type 'commit)) - (let ((inhibit-read-only t)) - (magit-delete-line) - (insert (concat action " " target " ")) - (when (magit-git-version>= "2.50.0") - (insert "# ")) - (insert (concat trailer "\n")))) - ((and (not action) action-type) - (let ((inhibit-read-only t)) - (if comment-p - (delete-region beg (+ beg 2)) - (insert comment-start " "))) - (forward-line)) - ;; In the case of --rebase-merges, commit lines may have - ;; other lines with other action types, empty lines, and - ;; "Branch" comments interspersed. Move along. - ((forward-line))))) + ((and action (eq action-type 'commit)) + (let ((inhibit-read-only t)) + (magit-delete-line) + (insert (concat action " " target " ")) + (when (magit-git-version>= "2.50.0") + (insert "# ")) + (insert (concat trailer "\n")))) + ((and (not action) action-type) + (let ((inhibit-read-only t)) + (if comment-p + (delete-region beg (+ beg 2)) + (insert comment-start " "))) + (forward-line)) + ;; In the case of --rebase-merges, commit lines may have + ;; other lines with other action types, empty lines, and + ;; "Branch" comments interspersed. Move along. + ((forward-line))))) (goto-char (cond (git-rebase-auto-advance end-marker) (pt-below-p (1- end-marker)) (beg))) @@ -435,15 +435,15 @@ point or mark. If the region isn't active and FALLBACK is non-nil, return the beginning and end of the current rebase line, if any." (cond - ((use-region-p) - (let ((beg (magit--bol-position (region-beginning))) - (end (magit--eol-position (region-end)))) - (and (git-rebase-line-p beg) - (git-rebase-line-p end) - (list beg (1+ end))))) - ((and fallback (git-rebase-line-p)) - (list (line-beginning-position) - (1+ (line-end-position)))))) + ((use-region-p) + (let ((beg (magit--bol-position (region-beginning))) + (end (magit--eol-position (region-end)))) + (and (git-rebase-line-p beg) + (git-rebase-line-p end) + (list beg (1+ end))))) + ((and fallback (git-rebase-line-p)) + (list (line-beginning-position) + (1+ (line-end-position)))))) (defun git-rebase-move-line-down (n) "Move the current commit (or command) N lines down. @@ -875,22 +875,22 @@ except for the \"pick\" command." (replace-match (make-string 10 ?\s) t t nil 1)) (setq cmd (intern (concat "git-rebase-" (match-str 4)))) (cond - ((not (fboundp cmd)) - (delete-line)) - ((eq cmd 'git-rebase-fixup) - (delete-line) - (git-rebase--insert-descriptions git-rebase-fixup-descriptions)) - (t - (add-text-properties (line-beginning-position) - (1+ (line-end-position)) - '(font-lock-face font-lock-comment-face)) - (replace-match " " t t nil 2) - (replace-match - (string-pad - (save-match-data - (substitute-command-keys (format "\\[%s]" cmd))) - 8) - t t nil 3)))))))))) + ((not (fboundp cmd)) + (delete-line)) + ((eq cmd 'git-rebase-fixup) + (delete-line) + (git-rebase--insert-descriptions git-rebase-fixup-descriptions)) + (t + (add-text-properties (line-beginning-position) + (1+ (line-end-position)) + '(font-lock-face font-lock-comment-face)) + (replace-match " " t t nil 2) + (replace-match + (string-pad + (save-match-data + (substitute-command-keys (format "\\[%s]" cmd))) + 8) + t t nil 3)))))))))) (defun git-rebase--insert-descriptions (alist) (pcase-dolist (`(,cmd . ,desc) alist) @@ -948,6 +948,7 @@ is used as a value for `imenu-extract-index-name-function'." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-apply.el b/elpa/magit-20260422.2206/magit-apply.el similarity index 93% rename from elpa/magit-20251217.1836/magit-apply.el rename to elpa/magit-20260422.2206/magit-apply.el index 75457ce8..d8a31a04 100644 --- a/elpa/magit-20251217.1836/magit-apply.el +++ b/elpa/magit-20260422.2206/magit-apply.el @@ -1,6 +1,6 @@ ;;; magit-apply.el --- Apply Git diffs -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -115,19 +115,19 @@ is a member of `magit-post-unstage-hook-commands'." With a prefix argument fallback to a 3-way merge. Doing so causes the change to be applied to the index as well." (interactive (and current-prefix-arg (list "--3way"))) - (when-let ((s (magit-apply--get-selection))) + (when$ (magit-apply--get-selection) (pcase (list (magit-diff-type) (magit-diff-scope)) (`(,(or 'unstaged 'staged) ,_) (user-error "Change is already in the working tree")) (`(untracked ,(or 'file 'files)) (call-interactively #'magit-am)) - (`(,_ region) (magit-apply-region s args)) - (`(,_ hunk) (magit-apply-hunk s args)) - (`(,_ hunks) (magit-apply-hunks s args)) + (`(,_ region) (magit-apply-region $ args)) + (`(,_ hunk) (magit-apply-hunk $ args)) + (`(,_ hunks) (magit-apply-hunks $ args)) (`(rebase-sequence file) (call-interactively #'magit-patch-apply)) - (`(,_ file) (magit-apply-diff s args)) - (`(,_ files) (magit-apply-diffs s args))))) + (`(,_ file) (magit-apply-diff $ args)) + (`(,_ files) (magit-apply-diffs $ args))))) (defun magit-apply--section-content (section) (buffer-substring-no-properties (if (magit-hunk-section-p section) @@ -310,17 +310,17 @@ at point, stage the file but not its content." "Read one or more files and stage all changes in those files. With prefix argument FORCE, offer ignored files for completion." (interactive - (let* ((choices (if current-prefix-arg - (magit-ignored-files) - (nconc (magit-unstaged-files) - (magit-untracked-files)))) - (default (or (magit-section-value-if 'file) - (magit-file-relative-name))) - (default (car (member default choices)))) - (list (magit-completing-read-multiple - (if current-prefix-arg "Stage ignored file,s: " "Stage file,s: ") - choices nil t nil nil default) - current-prefix-arg))) + (let* ((choices (if current-prefix-arg + (magit-ignored-files) + (nconc (magit-unstaged-files) + (magit-untracked-files)))) + (default (or (magit-section-value-if 'file) + (magit-file-relative-name))) + (default (car (member default choices)))) + (list (magit-completing-read-multiple + (if current-prefix-arg "Stage ignored file,s: " "Stage file,s: ") + choices nil t nil nil default) + current-prefix-arg))) (magit-with-toplevel (magit-stage-1 (and force "--force") files))) @@ -433,12 +433,12 @@ ignored) files." (defun magit-unstage-files (files) "Read one or more files and unstage all changes to those files." (interactive - (let* ((choices (magit-staged-files)) - (default (or (magit-section-value-if 'file) - (magit-file-relative-name))) - (default (car (member default choices)))) - (list (magit-completing-read-multiple "Unstage file,s: " choices - nil t nil nil default)))) + (let* ((choices (magit-staged-files)) + (default (or (magit-section-value-if 'file) + (magit-file-relative-name))) + (default (car (member default choices)))) + (list (magit-completing-read-multiple "Unstage file,s: " choices + nil t nil nil default)))) (magit-with-toplevel (magit-unstage-1 files))) @@ -488,17 +488,17 @@ On a hunk or file with unresolved conflicts prompt which side to keep (while discarding the other). If point is within the text of a side, then keep that side without prompting." (interactive) - (when-let ((s (magit-apply--get-selection))) + (when$ (magit-apply--get-selection) (pcase (list (magit-diff-type) (magit-diff-scope)) (`(committed ,_) (user-error "Cannot discard committed changes")) (`(undefined ,_) (user-error "Cannot discard this change")) (`(untracked list) (magit-discard-untracked)) - (`(,_ region) (magit-discard-region s)) - (`(,_ hunk) (magit-discard-hunk s)) - (`(,_ hunks) (magit-discard-hunks s)) - (`(,_ file) (magit-discard-file s)) - (`(,_ files) (magit-discard-files s)) - (`(,_ list) (magit-discard-files s))))) + (`(,_ region) (magit-discard-region $)) + (`(,_ hunk) (magit-discard-hunk $)) + (`(,_ hunks) (magit-discard-hunks $)) + (`(,_ file) (magit-discard-file $)) + (`(,_ files) (magit-discard-files $)) + (`(,_ list) (magit-discard-files $))))) (defun magit-discard-untracked () (magit-discard-files--delete @@ -642,13 +642,13 @@ of a side, then keep that side without prompting." files)) (dolist (file files) (let ((orig (cadr (assoc file status)))) - (if (file-exists-p file) - (progn - (when-let ((path (file-name-directory orig))) - (make-directory path t)) - (magit-call-git "mv" file orig)) - (magit-call-git "rm" "--cached" "--" file) - (magit-call-git "reset" "--" orig))))) + (cond ((file-exists-p file) + (when$ (file-name-directory orig) + (make-directory $ t)) + (magit-call-git "mv" file orig)) + (t + (magit-call-git "rm" "--cached" "--" file) + (magit-call-git "reset" "--" orig)))))) (defun magit-discard-files--discard (sections new-files) (let ((files (mapcar (##oref % value) sections))) @@ -684,16 +684,16 @@ of a side, then keep that side without prompting." With a prefix argument fallback to a 3-way merge. Doing so causes the change to be applied to the index as well." (interactive (and current-prefix-arg (list "--3way"))) - (when-let ((s (magit-apply--get-selection))) + (when$ (magit-apply--get-selection) (pcase (list (magit-diff-type) (magit-diff-scope)) (`(untracked ,_) (user-error "Cannot reverse untracked changes")) (`(unstaged ,_) (user-error "Cannot reverse unstaged changes")) - (`(,_ region) (magit-reverse-region s args)) - (`(,_ hunk) (magit-reverse-hunk s args)) - (`(,_ hunks) (magit-reverse-hunks s args)) - (`(,_ file) (magit-reverse-file s args)) - (`(,_ files) (magit-reverse-files s args)) - (`(,_ list) (magit-reverse-files s args))))) + (`(,_ region) (magit-reverse-region $ args)) + (`(,_ hunk) (magit-reverse-hunk $ args)) + (`(,_ hunks) (magit-reverse-hunks $ args)) + (`(,_ file) (magit-reverse-file $ args)) + (`(,_ files) (magit-reverse-files $ args)) + (`(,_ list) (magit-reverse-files $ args))))) (defun magit-reverse-region (section args) (magit-confirm 'reverse "Reverse region") @@ -717,9 +717,9 @@ so causes the change to be applied to the index as well." (pcase-let ((`(,binaries ,sections) (let ((bs (magit-binary-files (cond ((derived-mode-p 'magit-revision-mode) - magit-buffer-range) + magit-buffer-diff-range) ((derived-mode-p 'magit-diff-mode) - magit-buffer-range) + magit-buffer-diff-range) ("--cached"))))) (magit--separate (##member (oref % value) bs) sections)))) @@ -822,6 +822,7 @@ a separate commit. A typical workflow would be: ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-autoloads.el b/elpa/magit-20260422.2206/magit-autoloads.el similarity index 66% rename from elpa/magit-20251217.1836/magit-autoloads.el rename to elpa/magit-20260422.2206/magit-autoloads.el index 1e3b10e7..bee57035 100644 --- a/elpa/magit-20251217.1836/magit-autoloads.el +++ b/elpa/magit-20260422.2206/magit-autoloads.el @@ -19,28 +19,47 @@ fundamental-mode log-edit-mode git-commit-elisp-text-mode)))) +(autoload 'git-commit-insert-changelog-gnu "git-commit" +"Insert a GNU-style changelog at point while authorig a commit message. + +The modified definitions are extracted from the diff in the message +buffer, which is only available if \"git commit\" was invoked with +\"--verbose\"." t) +(autoload 'git-commit-insert-changelog-plain "git-commit" +"Insert a simple changelog at point while authorig a commit message. + +Defuns are slightly indented and quoted like in elisp docstrings. +The exact format is still subject to change. + +The modified definitions are extracted from the diff in the message +buffer, which is only available if \"git commit\" was invoked with +\"--verbose\"." t) (register-definition-prefixes "git-commit" '("git-commit-" "global-git-commit-mode")) ;;; Generated autoloads from git-rebase.el -(autoload 'git-rebase-current-line "git-rebase" "\ -Parse current line into a `git-rebase-action' instance. +(autoload 'git-rebase-current-line "git-rebase" +"Parse current line into a `git-rebase-action' instance. If the current line isn't recognized as a rebase line, an instance with all nil values is returned, unless optional BATCH is non-nil, in which case nil is returned. Non-nil BATCH also ignores commented lines. (fn &optional BATCH)") -(autoload 'git-rebase-mode "git-rebase" "\ -Major mode for editing of a Git rebase file. +(autoload 'git-rebase-mode "git-rebase" +"Major mode for editing of a Git rebase file. Rebase files are generated when you run \"git rebase -i\" or run `magit-interactive-rebase'. They describe how Git should perform the rebase. See the documentation for git-rebase (e.g., by running \"man git-rebase\" at the command line) for details. -(fn)" t) +In addition to any hooks its parent mode `special-mode' might have +run, this mode runs the hook `git-rebase-mode-hook', as the final or +penultimate step during initialization. + +\\{git-rebase-mode-map}") (defconst git-rebase-filename-regexp "/git-rebase-todo\\'") (add-to-list 'auto-mode-alist (cons git-rebase-filename-regexp #'git-rebase-mode)) (register-definition-prefixes "git-rebase" '("git-rebase-" "magit-imenu--rebase-")) @@ -48,8 +67,8 @@ running \"man git-rebase\" at the command line) for details. ;;; Generated autoloads from magit.el -(defvar magit-define-global-key-bindings 'default "\ -Which set of key bindings to add to the global keymap, if any. +(defvar magit-define-global-key-bindings 'default +"Which set of key bindings to add to the global keymap, if any. This option controls which set of Magit key bindings, if any, may be added to the global keymap, even before Magit is first used in @@ -96,13 +115,13 @@ doesn't load the libraries that define the customized variables). Setting this variable has no effect if `after-init-hook' has already been run.") (custom-autoload 'magit-define-global-key-bindings "magit" t) -(defun magit-maybe-define-global-key-bindings (&optional force) "\ -See variable `magit-define-global-key-bindings'." (when magit-define-global-key-bindings (let ((map (current-global-map))) (pcase-dolist (`(,key \, def) (cond ((eq magit-define-global-key-bindings 'recommended) '(("C-x g" . magit-status) ("C-c g" . magit-dispatch) ("C-c f" . magit-file-dispatch))) ('(("C-x g" . magit-status) ("C-x M-g" . magit-dispatch) ("C-c M-g" . magit-file-dispatch))))) (when (or force (not (or (lookup-key map (kbd key)) (where-is-internal def (make-sparse-keymap) t)))) (define-key map (kbd key) def)))))) +(defun magit-maybe-define-global-key-bindings (&optional force) +"See variable `magit-define-global-key-bindings'." (when magit-define-global-key-bindings (let ((map (current-global-map))) (pcase-dolist (`(,key \, def) (cond ((eq magit-define-global-key-bindings 'recommended) '(("C-x g" . magit-status) ("C-c g" . magit-dispatch) ("C-c f" . magit-file-dispatch))) ('(("C-x g" . magit-status) ("C-x M-g" . magit-dispatch) ("C-c M-g" . magit-file-dispatch))))) (when (or force (not (or (lookup-key map (kbd key)) (where-is-internal def (make-sparse-keymap) t)))) (define-key map (kbd key) def)))))) (if after-init-time (magit-maybe-define-global-key-bindings) (add-hook 'after-init-hook #'magit-maybe-define-global-key-bindings t)) (autoload 'magit-dispatch "magit" nil t) (autoload 'magit-run "magit" nil t) -(autoload 'magit-git-command "magit" "\ -Execute COMMAND asynchronously; display output. +(autoload 'magit-git-command "magit" +"Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. \"git \" is used as initial input, but can be deleted to run another command. @@ -111,8 +130,8 @@ With a prefix argument COMMAND is run in the top-level directory of the current working tree, otherwise in `default-directory'. (fn COMMAND)" t) -(autoload 'magit-git-command-topdir "magit" "\ -Execute COMMAND asynchronously; display output. +(autoload 'magit-git-command-topdir "magit" +"Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. \"git \" is used as initial input, but can be deleted to run another command. @@ -121,23 +140,23 @@ COMMAND is run in the top-level directory of the current working tree. (fn COMMAND)" t) -(autoload 'magit-shell-command "magit" "\ -Execute COMMAND asynchronously; display output. +(autoload 'magit-shell-command "magit" +"Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. With a prefix argument COMMAND is run in the top-level directory of the current working tree, otherwise in `default-directory'. (fn COMMAND)" t) -(autoload 'magit-shell-command-topdir "magit" "\ -Execute COMMAND asynchronously; display output. +(autoload 'magit-shell-command-topdir "magit" +"Execute COMMAND asynchronously; display output. Interactively, prompt for COMMAND in the minibuffer. COMMAND is run in the top-level directory of the current working tree. (fn COMMAND)" t) -(autoload 'magit-version "magit" "\ -Return the version of Magit currently in use. +(autoload 'magit-version "magit" +"Return the version of Magit currently in use. If optional argument PRINT-DEST is non-nil, also print the used versions of Magit, Transient, Git and Emacs to the output stream @@ -151,13 +170,13 @@ the output in the kill ring. ;;; Generated autoloads from magit-apply.el -(autoload 'magit-stage-files "magit-apply" "\ -Read one or more files and stage all changes in those files. +(autoload 'magit-stage-files "magit-apply" +"Read one or more files and stage all changes in those files. With prefix argument FORCE, offer ignored files for completion. (fn FILES &optional FORCE)" t) -(autoload 'magit-stage-modified "magit-apply" "\ -Stage all changes to files modified in the worktree. +(autoload 'magit-stage-modified "magit-apply" +"Stage all changes to files modified in the worktree. Stage all new content of tracked files and remove tracked files that no longer exist in the working tree from the index also. With a prefix argument also stage previously untracked (but not @@ -165,12 +184,12 @@ ignored) files. (fn &optional ALL)" t) (autoload 'magit-run-post-stage-hook "magit-apply") -(autoload 'magit-unstage-files "magit-apply" "\ -Read one or more files and unstage all changes to those files. +(autoload 'magit-unstage-files "magit-apply" +"Read one or more files and unstage all changes to those files. (fn FILES)" t) -(autoload 'magit-unstage-all "magit-apply" "\ -Remove all changes from the staging area." t) +(autoload 'magit-unstage-all "magit-apply" +"Remove all changes from the staging area." t) (autoload 'magit-run-post-unstage-hook "magit-apply") (register-definition-prefixes "magit-apply" '("magit-")) @@ -179,16 +198,17 @@ Remove all changes from the staging area." t) (defun magit-auto-revert-mode--initialize (symbol value) (internal--define-uninitialized-variable symbol) (if (not load-file-name) (custom-initialize-set symbol value) (defalias 'magit-auto-revert-mode--after-load (apply-partially (lambda (symbol value mode-file file) (when (equal file mode-file) (remove-hook 'after-load-functions 'magit-auto-revert-mode--after-load) (fmakunbound 'magit-auto-revert-mode--after-load) (if after-init-time (custom-initialize-set symbol value) (defalias 'magit-auto-revert-mode--after-init (apply-partially (lambda (symbol value) (remove-hook 'after-init-hook 'magit-auto-revert-mode--after-init) (fmakunbound 'magit-auto-revert-mode--after-init) (custom-initialize-set symbol value)) symbol value)) (add-hook 'after-init-hook 'magit-auto-revert-mode--after-init)))) symbol value load-file-name)) (add-hook 'after-load-functions 'magit-auto-revert-mode--after-load))) (put 'magit-auto-revert-mode 'globalized-minor-mode t) -(defcustom magit-auto-revert-mode (not (or global-auto-revert-mode noninteractive)) "\ -Non-nil if Magit-Auto-Revert mode is enabled. +(defcustom magit-auto-revert-mode (not (or global-auto-revert-mode noninteractive)) +"Non-nil if Magit-Auto-Revert mode is enabled. See the `magit-auto-revert-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `magit-auto-revert-mode'." :set #'custom-set-minor-mode :initialize #'magit-auto-revert-mode--initialize :type 'boolean :group 'magit-auto-revert :group 'magit-essentials :package-version '(magit . "2.4.0") :link '(info-link "(magit)Automatic Reverting of File-Visiting Buffers")) (custom-autoload 'magit-auto-revert-mode "magit-autorevert" nil) -(autoload 'magit-auto-revert-mode "magit-autorevert" "\ -Toggle Auto-Revert mode in many buffers. +(when (bound-and-true-p magit-auto-revert-mode) (add-to-list 'global-minor-modes 'magit-auto-revert-mode)) +(autoload 'magit-auto-revert-mode "magit-autorevert" +"Toggle Auto-Revert mode in many buffers. Specifically, Auto-Revert mode is enabled in all buffers where `magit-turn-on-auto-revert-mode-if-desired' would do it. @@ -208,8 +228,8 @@ See `auto-revert-mode' for more information on Auto-Revert mode. ;;; Generated autoloads from magit-base.el -(autoload 'magit-emacs-Q-command "magit-base" "\ -Show a shell command that runs an uncustomized Emacs with only Magit loaded. +(autoload 'magit-emacs-Q-command "magit-base" +"Show a shell command that runs an uncustomized Emacs with only Magit loaded. See info node `(magit)Debugging Tools' for more information." t) (define-advice Info-follow-nearest-node (:around (fn &optional fork) gitman) (let ((node (Info-get-token (point) "\\*note[ ]+" "\\*note[ @@ -234,8 +254,8 @@ the %s(1) manpage. ;;; Generated autoloads from magit-bisect.el (autoload 'magit-bisect "magit-bisect" nil t) -(autoload 'magit-bisect-start "magit-bisect" "\ -Start a bisect session. +(autoload 'magit-bisect-start "magit-bisect" +"Start a bisect session. Bisecting a bug means to find the commit that introduced it. This command starts such a bisect session by asking for a known @@ -243,30 +263,30 @@ good and a known bad commit. To move the session forward use the other actions from the bisect transient command (\\\\[magit-bisect]). (fn BAD GOOD ARGS)" t) -(autoload 'magit-bisect-reset "magit-bisect" "\ -After bisecting, cleanup bisection state and return to original `HEAD'." t) -(autoload 'magit-bisect-good "magit-bisect" "\ -While bisecting, mark the current commit as good. +(autoload 'magit-bisect-reset "magit-bisect" +"After bisecting, cleanup bisection state and return to original `HEAD'." t) +(autoload 'magit-bisect-good "magit-bisect" +"While bisecting, mark the current commit as good. Use this after you have asserted that the commit does not contain the bug in question." t) -(autoload 'magit-bisect-bad "magit-bisect" "\ -While bisecting, mark the current commit as bad. +(autoload 'magit-bisect-bad "magit-bisect" +"While bisecting, mark the current commit as bad. Use this after you have asserted that the commit does contain the bug in question." t) -(autoload 'magit-bisect-mark "magit-bisect" "\ -While bisecting, mark the current commit with a bisect term. +(autoload 'magit-bisect-mark "magit-bisect" +"While bisecting, mark the current commit with a bisect term. During a bisect using alternate terms, commits can still be marked with `magit-bisect-good' and `magit-bisect-bad', as those commands map to the correct term (\"good\" to --term-old's value and \"bad\" to --term-new's). However, in some cases, it can be difficult to keep that mapping straight in your head; this command provides an interface that exposes the underlying terms." t) -(autoload 'magit-bisect-skip "magit-bisect" "\ -While bisecting, skip the current commit. +(autoload 'magit-bisect-skip "magit-bisect" +"While bisecting, skip the current commit. Use this if for some reason the current commit is not a good one to test. This command lets Git choose a different one." t) -(autoload 'magit-bisect-run "magit-bisect" "\ -Bisect automatically by running commands after each step. +(autoload 'magit-bisect-run "magit-bisect" +"Bisect automatically by running commands after each step. Unlike `git bisect run' this can be used before bisecting has begun. In that case it behaves like `git bisect start; git @@ -289,8 +309,8 @@ bisect run'. ;;; Generated autoloads from magit-branch.el (autoload 'magit-branch "magit" nil t) -(autoload 'magit-checkout "magit-branch" "\ -Checkout COMMIT, updating the index and the working tree. +(autoload 'magit-checkout "magit-branch" +"Checkout COMMIT, updating the index and the working tree. If COMMIT is a local branch, then that becomes the current branch. If it is something else, then `HEAD' becomes detached. Checkout fails if the working tree or the staging area contain @@ -300,18 +320,18 @@ changes. (fn COMMIT &optional ARGS)" t) (function-put 'magit-checkout 'interactive-only 'magit--checkout) -(autoload 'magit-branch-create "magit-branch" "\ -Create BRANCH at branch or revision START-POINT. +(autoload 'magit-branch-create "magit-branch" +"Create BRANCH at branch or revision START-POINT. (fn BRANCH START-POINT)" t) (function-put 'magit-branch-create 'interactive-only 'magit-call-git) -(autoload 'magit-branch-and-checkout "magit-branch" "\ -Create and checkout BRANCH at branch or revision START-POINT. +(autoload 'magit-branch-and-checkout "magit-branch" +"Create and checkout BRANCH at branch or revision START-POINT. (fn BRANCH START-POINT &optional ARGS)" t) (function-put 'magit-branch-and-checkout 'interactive-only 'magit-call-git) -(autoload 'magit-branch-or-checkout "magit-branch" "\ -Hybrid between `magit-checkout' and `magit-branch-and-checkout'. +(autoload 'magit-branch-or-checkout "magit-branch" +"Hybrid between `magit-checkout' and `magit-branch-and-checkout'. Ask the user for an existing branch or revision. If the user input actually can be resolved as a branch or revision, then @@ -324,8 +344,8 @@ does. (fn ARG &optional START-POINT)" t) (function-put 'magit-branch-or-checkout 'interactive-only 'magit-call-git) -(autoload 'magit-branch-checkout "magit-branch" "\ -Checkout an existing or new local branch. +(autoload 'magit-branch-checkout "magit-branch" +"Checkout an existing or new local branch. Read a branch name from the user offering all local branches and a subset of remote branches as candidates. Omit remote branches @@ -350,19 +370,19 @@ when using `magit-branch-and-checkout'. (fn BRANCH &optional START-POINT)" t) (function-put 'magit-branch-checkout 'interactive-only 'magit-call-git) -(autoload 'magit-branch-orphan "magit-branch" "\ -Create and checkout an orphan BRANCH with contents from revision START-POINT. +(autoload 'magit-branch-orphan "magit-branch" +"Create and checkout an orphan BRANCH with contents from revision START-POINT. (fn BRANCH START-POINT)" t) -(autoload 'magit-branch-spinout "magit-branch" "\ -Create new branch from the unpushed commits. +(autoload 'magit-branch-spinout "magit-branch" +"Create new branch from the unpushed commits. Like `magit-branch-spinoff' but remain on the current branch. If there are any uncommitted changes, then behave exactly like `magit-branch-spinoff'. (fn BRANCH &optional FROM)" t) -(autoload 'magit-branch-spinoff "magit-branch" "\ -Create new branch from the unpushed commits. +(autoload 'magit-branch-spinoff "magit-branch" +"Create new branch from the unpushed commits. Create and checkout a new branch starting at and tracking the current branch. That branch in turn is reset to the last commit @@ -392,8 +412,8 @@ branch. If FROM is not reachable from `HEAD' or is reachable from the source branch's upstream, then an error is raised. (fn BRANCH &optional FROM)" t) -(autoload 'magit-branch-reset "magit-branch" "\ -Reset a branch to the tip of another branch or any other commit. +(autoload 'magit-branch-reset "magit-branch" +"Reset a branch to the tip of another branch or any other commit. When the branch being reset is the current branch, then do a hard reset. If there are any uncommitted changes, then the user @@ -407,8 +427,8 @@ then also set the target branch as the upstream of the branch that is being reset. (fn BRANCH TO &optional SET-UPSTREAM)" t) -(autoload 'magit-branch-delete "magit-branch" "\ -Delete one or multiple branches. +(autoload 'magit-branch-delete "magit-branch" +"Delete one or multiple branches. If the region marks multiple branches, then offer to delete those, otherwise prompt for a single branch to be deleted, @@ -421,8 +441,8 @@ confirmation is required by default in certain cases or if a prompt is confusing. (fn BRANCHES &optional FORCE)" t) -(autoload 'magit-branch-rename "magit-branch" "\ -Rename the branch named OLD to NEW. +(autoload 'magit-branch-rename "magit-branch" +"Rename the branch named OLD to NEW. With a prefix argument FORCE, rename even if a branch named NEW already exists. @@ -433,14 +453,14 @@ set `branch.NEW.pushRemote' and maybe rename the push-target on the remote. (fn OLD NEW &optional FORCE)" t) -(autoload 'magit-branch-shelve "magit-branch" "\ -Shelve a BRANCH. +(autoload 'magit-branch-shelve "magit-branch" +"Shelve a BRANCH. Rename \"refs/heads/BRANCH\" to \"refs/shelved/YYYY-MM-DD-BRANCH\", and also rename the respective reflog file. (fn BRANCH)" t) -(autoload 'magit-branch-unshelve "magit-branch" "\ -Unshelve a BRANCH. +(autoload 'magit-branch-unshelve "magit-branch" +"Unshelve a BRANCH. Rename \"refs/shelved/BRANCH\" to \"refs/heads/BRANCH\". If BRANCH is prefixed with \"YYYY-MM-DD\", then drop that part of the name. Also rename the respective reflog file. @@ -454,20 +474,20 @@ Also rename the respective reflog file. (autoload 'magit-bundle "magit-bundle" nil t) (autoload 'magit-bundle-import "magit-bundle" nil t) -(autoload 'magit-bundle-create-tracked "magit-bundle" "\ -Create and track a new bundle. +(autoload 'magit-bundle-create-tracked "magit-bundle" +"Create and track a new bundle. (fn FILE TAG BRANCH REFS ARGS)" t) -(autoload 'magit-bundle-update-tracked "magit-bundle" "\ -Update a bundle that is being tracked using TAG. +(autoload 'magit-bundle-update-tracked "magit-bundle" +"Update a bundle that is being tracked using TAG. (fn TAG)" t) -(autoload 'magit-bundle-verify "magit-bundle" "\ -Check whether FILE is valid and applies to the current repository. +(autoload 'magit-bundle-verify "magit-bundle" +"Check whether FILE is valid and applies to the current repository. (fn FILE)" t) -(autoload 'magit-bundle-list-heads "magit-bundle" "\ -List the refs in FILE. +(autoload 'magit-bundle-list-heads "magit-bundle" +"List the refs in FILE. (fn FILE)" t) (register-definition-prefixes "magit-bundle" '("magit-")) @@ -476,44 +496,44 @@ List the refs in FILE. ;;; Generated autoloads from magit-clone.el (autoload 'magit-clone "magit-clone" nil t) -(autoload 'magit-clone-regular "magit-clone" "\ -Create a clone of REPOSITORY in DIRECTORY. +(autoload 'magit-clone-regular "magit-clone" +"Create a clone of REPOSITORY in DIRECTORY. Then show the status buffer for the new repository. (fn REPOSITORY DIRECTORY ARGS)" t) -(autoload 'magit-clone-shallow "magit-clone" "\ -Create a shallow clone of REPOSITORY in DIRECTORY. +(autoload 'magit-clone-shallow "magit-clone" +"Create a shallow clone of REPOSITORY in DIRECTORY. Then show the status buffer for the new repository. With a prefix argument read the DEPTH of the clone; otherwise use 1. (fn REPOSITORY DIRECTORY ARGS DEPTH)" t) -(autoload 'magit-clone-shallow-since "magit-clone" "\ -Create a shallow clone of REPOSITORY in DIRECTORY. +(autoload 'magit-clone-shallow-since "magit-clone" +"Create a shallow clone of REPOSITORY in DIRECTORY. Then show the status buffer for the new repository. Exclude commits before DATE, which is read from the user. (fn REPOSITORY DIRECTORY ARGS DATE)" t) -(autoload 'magit-clone-shallow-exclude "magit-clone" "\ -Create a shallow clone of REPOSITORY in DIRECTORY. +(autoload 'magit-clone-shallow-exclude "magit-clone" +"Create a shallow clone of REPOSITORY in DIRECTORY. Then show the status buffer for the new repository. Exclude commits reachable from EXCLUDE, which is a branch or tag read from the user. (fn REPOSITORY DIRECTORY ARGS EXCLUDE)" t) -(autoload 'magit-clone-bare "magit-clone" "\ -Create a bare clone of REPOSITORY in DIRECTORY. +(autoload 'magit-clone-bare "magit-clone" +"Create a bare clone of REPOSITORY in DIRECTORY. Then show the status buffer for the new repository. (fn REPOSITORY DIRECTORY ARGS)" t) -(autoload 'magit-clone-mirror "magit-clone" "\ -Create a mirror of REPOSITORY in DIRECTORY. +(autoload 'magit-clone-mirror "magit-clone" +"Create a mirror of REPOSITORY in DIRECTORY. Then show the status buffer for the new repository. (fn REPOSITORY DIRECTORY ARGS)" t) -(autoload 'magit-clone-sparse "magit-clone" "\ -Clone REPOSITORY into DIRECTORY and create a sparse checkout. +(autoload 'magit-clone-sparse "magit-clone" +"Clone REPOSITORY into DIRECTORY and create a sparse checkout. (fn REPOSITORY DIRECTORY ARGS)" t) (register-definition-prefixes "magit-clone" '("magit-")) @@ -522,12 +542,12 @@ Clone REPOSITORY into DIRECTORY and create a sparse checkout. ;;; Generated autoloads from magit-commit.el (autoload 'magit-commit "magit-commit" nil t) -(autoload 'magit-commit-create "magit-commit" "\ -Create a new commit. +(autoload 'magit-commit-create "magit-commit" +"Create a new commit. (fn &optional ARGS)" t) -(autoload 'magit-commit-extend "magit-commit" "\ -Amend staged changes to the last commit, without editing its message. +(autoload 'magit-commit-extend "magit-commit" +"Amend staged changes to the last commit, without editing its message. With a prefix argument do not update the committer date; without an argument update it. The option `magit-commit-extend-override-date' @@ -536,12 +556,12 @@ non-interactively, the optional OVERRIDE-DATE argument controls this behavior, and the option is of no relevance. (fn &optional ARGS OVERRIDE-DATE)" t) -(autoload 'magit-commit-amend "magit-commit" "\ -Amend staged changes (if any) to the last commit, and edit its message. +(autoload 'magit-commit-amend "magit-commit" +"Amend staged changes (if any) to the last commit, and edit its message. (fn &optional ARGS)" t) -(autoload 'magit-commit-reword "magit-commit" "\ -Reword the message of the last commit, without amending its tree. +(autoload 'magit-commit-reword "magit-commit" +"Reword the message of the last commit, without amending its tree. With a prefix argument do not update the committer date; without an argument update it. The option `magit-commit-reword-override-date' @@ -550,8 +570,8 @@ non-interactively, the optional OVERRIDE-DATE argument controls this behavior, and the option is of no relevance. (fn &optional ARGS OVERRIDE-DATE)" t) -(autoload 'magit-commit-fixup "magit-commit" "\ -Create a fixup commit, leaving the original commit message untouched. +(autoload 'magit-commit-fixup "magit-commit" +"Create a fixup commit, leaving the original commit message untouched. If there is a reachable commit at point, target that. Otherwise prompt for a commit. If `magit-commit-squash-confirm' is non-nil, always make @@ -563,8 +583,8 @@ commit, the original message of the targeted commit is used as-is. In other words, call \"git commit --fixup=COMMIT --no-edit\". (fn &optional COMMIT ARGS)" t) -(autoload 'magit-commit-squash "magit-commit" "\ -Create a squash commit, without the user authoring a commit message. +(autoload 'magit-commit-squash "magit-commit" +"Create a squash commit, without the user authoring a commit message. If there is a reachable commit at point, target that. Otherwise prompt for a commit. If `magit-commit-squash-confirm' is non-nil, always make @@ -577,8 +597,8 @@ the changes from the squash commit into account. In other words, call \"git commit --squash=COMMIT --no-edit\". (fn &optional COMMIT ARGS)" t) -(autoload 'magit-commit-alter "magit-commit" "\ -Create a squash commit, authoring the final commit message now. +(autoload 'magit-commit-alter "magit-commit" +"Create a squash commit, authoring the final commit message now. If there is a reachable commit at point, target that. Otherwise prompt for a commit. If `magit-commit-squash-confirm' is non-nil, always make @@ -592,8 +612,8 @@ chance to edit again. In other words, call \"git commit --fixup=amend:COMMIT --edit\". (fn &optional COMMIT ARGS)" t) -(autoload 'magit-commit-augment "magit-commit" "\ -Create a squash commit, authoring a new temporary commit message. +(autoload 'magit-commit-augment "magit-commit" +"Create a squash commit, authoring a new temporary commit message. If there is a reachable commit at point, target that. Otherwise prompt for a commit. If `magit-commit-squash-confirm' is non-nil, always make @@ -607,8 +627,8 @@ the temporary commit message of the squash commit. In other words, call \"git commit --squash=COMMIT --edit\". (fn &optional COMMIT ARGS)" t) -(autoload 'magit-commit-revise "magit-commit" "\ -Reword the message of an existing commit, without editing its tree. +(autoload 'magit-commit-revise "magit-commit" +"Reword the message of an existing commit, without editing its tree. If there is a reachable commit at point, target that. Otherwise prompt for a commit. If `magit-commit-squash-confirm' is non-nil, always make @@ -621,8 +641,8 @@ commit and the tree of the targeted commit. In other words, call \"git commit --fixup=reword:COMMIT --edit\". (fn &optional COMMIT ARGS)" t) -(autoload 'magit-commit-instant-fixup "magit-commit" "\ -Create a fixup commit, and immediately combine it with its target. +(autoload 'magit-commit-instant-fixup "magit-commit" +"Create a fixup commit, and immediately combine it with its target. If there is a reachable commit at point, target that. Otherwise prompt for a commit. If `magit-commit-squash-confirm' is non-nil, always make @@ -633,8 +653,8 @@ Leave the original commit message of the targeted commit untouched. Like `magit-commit-fixup' but also run a `--autofixup' rebase. (fn &optional COMMIT ARGS)" t) -(autoload 'magit-commit-instant-squash "magit-commit" "\ -Create a squash commit, and immediately combine it with its target. +(autoload 'magit-commit-instant-squash "magit-commit" +"Create a squash commit, and immediately combine it with its target. If there is a reachable commit at point, target that. Otherwise prompt for a commit. If `magit-commit-squash-confirm' is non-nil, always make @@ -647,8 +667,8 @@ message of the targeted commit. Like `magit-commit-squash' but also run a `--autofixup' rebase. (fn &optional COMMIT ARGS)" t) -(autoload 'magit-commit-reshelve "magit-commit" "\ -Change committer (and possibly author) date of the last commit. +(autoload 'magit-commit-reshelve "magit-commit" +"Change committer (and possibly author) date of the last commit. The current time is used as the initial minibuffer input and the original author or committer date is available as the previous @@ -662,8 +682,8 @@ is updated: - Non-interactively if UPDATE-AUTHOR is nil. (fn DATE UPDATE-AUTHOR &optional ARGS)" t) -(autoload 'magit-commit-absorb-modules "magit-commit" "\ -Spread modified modules across recent commits. +(autoload 'magit-commit-absorb-modules "magit-commit" +"Spread modified modules across recent commits. (fn PHASE COMMIT)" t) (autoload 'magit-commit-absorb "magit-commit" nil t) @@ -676,8 +696,8 @@ Spread modified modules across recent commits. (autoload 'magit-diff "magit-diff" nil t) (autoload 'magit-diff-refresh "magit-diff" nil t) -(autoload 'magit-diff-dwim "magit-diff" "\ -Show changes for the thing at point. +(autoload 'magit-diff-dwim "magit-diff" +"Show changes for the thing at point. For example, if point is on a commit, show the changes introduced by that commit. Likewise if point is on the section titled \"Unstaged @@ -698,8 +718,8 @@ If this command never does what you want, then ignore it, and instead use the commands that allow you to explicitly specify what you need. (fn &optional ARGS FILES)" t) -(autoload 'magit-diff-range "magit-diff" "\ -Show differences between two commits. +(autoload 'magit-diff-range "magit-diff" +"Show differences between two commits. REV-OR-RANGE should be a range or a single revision. If it is a revision, then show changes in the working tree relative to that @@ -713,44 +733,44 @@ view changes along, starting at the common ancestor of both revisions (i.e., use a \"...\" range). (fn REV-OR-RANGE &optional ARGS FILES)" t) -(autoload 'magit-diff-working-tree "magit-diff" "\ -Show changes between the current working tree and the `HEAD' commit. +(autoload 'magit-diff-working-tree "magit-diff" +"Show changes between the current working tree and the `HEAD' commit. With a prefix argument show changes between the working tree and a commit read from the minibuffer. (fn &optional REV ARGS FILES)" t) -(autoload 'magit-diff-staged "magit-diff" "\ -Show changes between the index and the `HEAD' commit. +(autoload 'magit-diff-staged "magit-diff" +"Show changes between the index and the `HEAD' commit. With a prefix argument show changes between the index and a commit read from the minibuffer. (fn &optional REV ARGS FILES)" t) -(autoload 'magit-diff-unstaged "magit-diff" "\ -Show changes between the working tree and the index. +(autoload 'magit-diff-unstaged "magit-diff" +"Show changes between the working tree and the index. (fn &optional ARGS FILES)" t) -(autoload 'magit-diff-unmerged "magit-diff" "\ -Show changes that are being merged. +(autoload 'magit-diff-unmerged "magit-diff" +"Show changes that are being merged. (fn &optional ARGS FILES)" t) -(autoload 'magit-diff-while-committing "magit-diff" "\ -While committing, show the changes that are about to be committed. +(autoload 'magit-diff-while-committing "magit-diff" +"While committing, show the changes that are about to be committed. While amending, invoking the command again toggles between showing just the new changes or all the changes that will be committed." t) -(autoload 'magit-diff-buffer-file "magit-diff" "\ -Show diff for the blob or file visited in the current buffer. +(autoload 'magit-diff-buffer-file "magit-diff" +"Show diff for the blob or file visited in the current buffer. When the buffer visits a blob, then show the respective commit. When the buffer visits a file, then show the differences between `HEAD' and the working tree. In both cases limit the diff to the file or blob." t) -(autoload 'magit-diff-paths "magit-diff" "\ -Show changes between any two files on disk. +(autoload 'magit-diff-paths "magit-diff" +"Show changes between any two files on disk. (fn A B)" t) -(autoload 'magit-show-commit "magit-diff" "\ -Visit the revision at point in another buffer. +(autoload 'magit-show-commit "magit-diff" +"Visit the revision at point in another buffer. If there is no revision at point or with a prefix argument prompt for a revision. @@ -760,28 +780,28 @@ for a revision. ;;; Generated autoloads from magit-dired.el -(autoload 'magit-dired-jump "magit-dired" "\ -Visit file at point using Dired. +(autoload 'magit-dired-jump "magit-dired" +"Visit file at point using Dired. With a prefix argument, visit in another window. If there is no file at point, then instead visit `default-directory'. (fn &optional OTHER-WINDOW)" t) -(autoload 'magit-dired-stage "magit-dired" "\ -In Dired, staged all marked files or the file at point." t) -(autoload 'magit-dired-unstage "magit-dired" "\ -In Dired, unstaged all marked files or the file at point." t) -(autoload 'magit-dired-log "magit-dired" "\ -In Dired, show log for all marked files or the directory if none are marked. +(autoload 'magit-dired-stage "magit-dired" +"In Dired, staged all marked files or the file at point." t) +(autoload 'magit-dired-unstage "magit-dired" +"In Dired, unstaged all marked files or the file at point." t) +(autoload 'magit-dired-log "magit-dired" +"In Dired, show log for all marked files or the directory if none are marked. (fn &optional FOLLOW)" t) -(autoload 'magit-dired-am-apply-patches "magit-dired" "\ -In Dired, apply the marked (or next ARG) files as patches. +(autoload 'magit-dired-am-apply-patches "magit-dired" +"In Dired, apply the marked (or next ARG) files as patches. If inside a repository, then apply in that. Otherwise prompt for a repository. (fn REPO &optional ARG)" t) -(autoload 'magit-do-async-shell-command "magit-dired" "\ -Open FILE with `dired-do-async-shell-command'. +(autoload 'magit-do-async-shell-command "magit-dired" +"Open FILE with `dired-do-async-shell-command'. Interactively, open the file at point. (fn FILE)" t) @@ -789,115 +809,43 @@ Interactively, open the file at point. ;;; Generated autoloads from magit-ediff.el -(autoload 'magit-ediff "magit-ediff" nil) -(autoload 'magit-ediff-resolve-all "magit-ediff" "\ -Resolve all conflicts in the FILE at point using Ediff. - -If there is no file at point or if it doesn't have any unmerged -changes, then prompt for a file. - -See info node `(magit) Ediffing' for more information about this -and alternative commands. - -(fn FILE)" t) -(autoload 'magit-ediff-resolve-rest "magit-ediff" "\ -Resolve outstanding conflicts in the FILE at point using Ediff. - -If there is no file at point or if it doesn't have any unmerged -changes, then prompt for a file. - -See info node `(magit) Ediffing' for more information about this -and alternative commands. - -(fn FILE)" t) -(autoload 'magit-ediff-stage "magit-ediff" "\ -Stage and unstage changes to FILE using Ediff. -FILE has to be relative to the top directory of the repository. - -(fn FILE)" t) -(autoload 'magit-ediff-compare "magit-ediff" "\ -Compare REVA:FILEA with REVB:FILEB using Ediff. - -FILEA and FILEB have to be relative to the top directory of the -repository. If REVA or REVB is nil, then this stands for the -working tree state. - -If the region is active, use the revisions on the first and last -line of the region. With a prefix argument, instead of diffing -the revisions, choose a revision to view changes along, starting -at the common ancestor of both revisions (i.e., use a \"...\" -range). - -(fn REVA REVB FILEA FILEB)" t) -(autoload 'magit-ediff-dwim "magit-ediff" "\ -Compare, stage, or resolve using Ediff. -This command tries to guess what file, and what commit or range -the user wants to compare, stage, or resolve using Ediff. It -might only be able to guess either the file, or range or commit, -in which case the user is asked about the other. It might not -always guess right, in which case the appropriate `magit-ediff-*' -command has to be used explicitly. If it cannot read the user's -mind at all, then it asks the user for a command to run." t) -(autoload 'magit-ediff-show-staged "magit-ediff" "\ -Show staged changes using Ediff. - -This only allows looking at the changes; to stage, unstage, -and discard changes using Ediff, use `magit-ediff-stage'. - -FILE must be relative to the top directory of the repository. - -(fn FILE)" t) -(autoload 'magit-ediff-show-unstaged "magit-ediff" "\ -Show unstaged changes using Ediff. - -This only allows looking at the changes; to stage, unstage, -and discard changes using Ediff, use `magit-ediff-stage'. - -FILE must be relative to the top directory of the repository. - -(fn FILE)" t) -(autoload 'magit-ediff-show-working-tree "magit-ediff" "\ -Show changes between `HEAD' and working tree using Ediff. -FILE must be relative to the top directory of the repository. - -(fn FILE)" t) -(autoload 'magit-ediff-show-commit "magit-ediff" "\ -Show changes introduced by COMMIT using Ediff. - -(fn COMMIT)" t) -(autoload 'magit-ediff-show-stash "magit-ediff" "\ -Show changes introduced by STASH using Ediff. -`magit-ediff-show-stash-with-index' controls whether a -three-buffer Ediff is used in order to distinguish changes in the -stash that were staged. - -(fn STASH)" t) +(autoload 'magit-ediff "magit-ediff" nil t) +(autoload 'magit-ediff-resolve-all "magit-ediff" nil t) +(autoload 'magit-ediff-resolve-rest "magit-ediff" nil t) +(autoload 'magit-ediff-stage "magit-ediff" nil t) +(autoload 'magit-ediff-compare "magit-ediff" nil t) +(autoload 'magit-ediff-dwim "magit-ediff" nil t) +(autoload 'magit-ediff-show-staged "magit-ediff" nil t) +(autoload 'magit-ediff-show-unstaged "magit-ediff" nil t) +(autoload 'magit-ediff-show-working-tree "magit-ediff" nil t) +(autoload 'magit-ediff-show-commit "magit-ediff" nil t) +(autoload 'magit-ediff-show-stash "magit-ediff" nil t) (register-definition-prefixes "magit-ediff" '("magit-ediff-")) ;;; Generated autoloads from magit-extras.el (autoload 'magit-git-mergetool "magit-extras" nil t) -(autoload 'magit-run-git-gui-blame "magit-extras" "\ -Run `git gui blame' on the given FILENAME and COMMIT. +(autoload 'magit-run-git-gui-blame "magit-extras" +"Run `git gui blame' on the given FILENAME and COMMIT. Interactively run it for the current file and the `HEAD', with a prefix or when the current file cannot be determined let the user choose. When the current buffer is visiting FILENAME instruct blame to center around the line point is on. (fn COMMIT FILENAME &optional LINENUM)" t) -(autoload 'magit-run-git-gui "magit-extras" "\ -Run `git gui' for the current git repository." t) -(autoload 'magit-run-gitk "magit-extras" "\ -Run `gitk' in the current repository." t) -(autoload 'magit-run-gitk-branches "magit-extras" "\ -Run `gitk --branches' in the current repository." t) -(autoload 'magit-run-gitk-all "magit-extras" "\ -Run `gitk --all' in the current repository." t) -(autoload 'magit-project-status "magit-extras" "\ -Run `magit-status' in the current project's root." t) -(autoload 'magit-previous-line "magit-extras" "\ -Like `previous-line' but with Magit-specific shift-selection. +(autoload 'magit-run-git-gui "magit-extras" +"Run `git gui' for the current git repository." t) +(autoload 'magit-run-gitk "magit-extras" +"Run `gitk' in the current repository." t) +(autoload 'magit-run-gitk-branches "magit-extras" +"Run `gitk --branches' in the current repository." t) +(autoload 'magit-run-gitk-all "magit-extras" +"Run `gitk --all' in the current repository." t) +(autoload 'magit-project-status "magit-extras" +"Run `magit-status' in the current project's root." t) +(autoload 'magit-previous-line "magit-extras" +"Like `previous-line' but with Magit-specific shift-selection. Magit's selection mechanism is based on the region but selects an area that is larger than the region. This causes `previous-line' @@ -909,8 +857,8 @@ is a matter of preference. (fn &optional ARG TRY-VSCROLL)" t) (function-put 'magit-previous-line 'interactive-only '"use `forward-line' with negative argument instead.") -(autoload 'magit-next-line "magit-extras" "\ -Like `next-line' but with Magit-specific shift-selection. +(autoload 'magit-next-line "magit-extras" +"Like `next-line' but with Magit-specific shift-selection. Magit's selection mechanism is based on the region but selects an area that is larger than the region. This causes `next-line' @@ -922,38 +870,38 @@ prefer is a matter of preference. (fn &optional ARG TRY-VSCROLL)" t) (function-put 'magit-next-line 'interactive-only 'forward-line) -(autoload 'magit-clean "magit-extras" "\ -Remove untracked files from the working tree. +(autoload 'magit-clean "magit-extras" +"Remove untracked files from the working tree. With a prefix argument also remove ignored files, with two prefix arguments remove ignored files only. (git clean -f -d [-x|-X]) (fn &optional ARG)" t) -(autoload 'magit-generate-changelog "magit-extras" "\ -Insert ChangeLog entries into the current buffer. +(autoload 'magit-generate-changelog "magit-extras" +"Insert ChangeLog entries into the current buffer. The entries are generated from the diff being committed. If prefix argument, AMENDING, is non-nil, include changes in HEAD as well as staged changes in the diff to check. (fn &optional AMENDING)" t) -(autoload 'magit-add-change-log-entry "magit-extras" "\ -Find change log file and add date entry and item for current change. +(autoload 'magit-add-change-log-entry "magit-extras" +"Find change log file and add date entry and item for current change. This differs from `add-change-log-entry' (which see) in that it acts on the current hunk in a Magit buffer instead of on a position in a file-visiting buffer. (fn &optional WHOAMI FILE-NAME OTHER-WINDOW)" t) -(autoload 'magit-add-change-log-entry-other-window "magit-extras" "\ -Find change log file in other window and add entry and item. +(autoload 'magit-add-change-log-entry-other-window "magit-extras" +"Find change log file in other window and add entry and item. This differs from `add-change-log-entry-other-window' (which see) in that it acts on the current hunk in a Magit buffer instead of on a position in a file-visiting buffer. (fn &optional WHOAMI FILE-NAME)" t) -(autoload 'magit-edit-line-commit "magit-extras" "\ -Edit the commit that added the current line. +(autoload 'magit-edit-line-commit "magit-extras" +"Edit the commit that added the current line. With a prefix argument edit the commit that removes the line, if any. The commit is determined using `git blame' and made @@ -962,8 +910,8 @@ from `HEAD', or by checking out the commit (or a branch that points at it) otherwise. (fn &optional TYPE)" t) -(autoload 'magit-diff-edit-hunk-commit "magit-extras" "\ -From a hunk, edit the respective commit and visit the file. +(autoload 'magit-diff-edit-hunk-commit "magit-extras" +"From a hunk, edit the respective commit and visit the file. First visit the file being modified by the hunk at the correct location using `magit-diff-visit-file'. This actually visits a @@ -979,8 +927,8 @@ to be visited. Neither the blob nor the file buffer are killed when finishing the rebase. If that is undesirable, then it might be better to use `magit-rebase-edit-commit' instead of this command." t) -(autoload 'magit-reshelve-since "magit-extras" "\ -Change the author and committer dates of the commits since COMMIT. +(autoload 'magit-reshelve-since "magit-extras" +"Change the author and committer dates of the commits since COMMIT. Ask the user for the first reachable commit whose dates should be changed. Then read the new date for that commit. The initial @@ -996,8 +944,8 @@ Interactively use the value of the \"--gpg-sign\" option in the list returned by `magit-rebase-arguments'. (fn COMMIT KEYID)" t) -(autoload 'magit-pop-revision-stack "magit-extras" "\ -Insert a representation of a revision into the current buffer. +(autoload 'magit-pop-revision-stack "magit-extras" +"Insert a representation of a revision into the current buffer. Pop a revision from the `magit-revision-stack' and insert it into the current buffer according to `magit-pop-revision-stack-format'. @@ -1021,8 +969,8 @@ stack, or with two prefix arguments, then read the repository in the minibuffer too. (fn REV TOPLEVEL)" t) -(autoload 'magit-copy-section-value "magit-extras" "\ -Save the value of the current section for later use. +(autoload 'magit-copy-section-value "magit-extras" +"Save the value of the current section for later use. Save the section value to the `kill-ring', and, provided that the current section is a commit, branch, or tag section, push @@ -1045,8 +993,8 @@ the added or removed lines, depending on the sign of the prefix argument. (fn ARG)" t) -(autoload 'magit-copy-buffer-revision "magit-extras" "\ -Save the revision of the current buffer for later use. +(autoload 'magit-copy-buffer-revision "magit-extras" +"Save the revision of the current buffer for later use. Save the revision shown in the current buffer to the `kill-ring' and push it to the `magit-revision-stack'. @@ -1070,29 +1018,29 @@ above. When `magit-copy-revision-abbreviated' is non-nil, save the abbreviated revision to the `kill-ring' and the `magit-revision-stack'." t) -(autoload 'magit-display-repository-buffer "magit-extras" "\ -Display a Magit buffer belonging to the current Git repository. +(autoload 'magit-display-repository-buffer "magit-extras" +"Display a Magit buffer belonging to the current Git repository. The buffer is displayed using `magit-display-buffer', which see. (fn BUFFER)" t) -(autoload 'magit-switch-to-repository-buffer "magit-extras" "\ -Switch to a Magit buffer belonging to the current Git repository. +(autoload 'magit-switch-to-repository-buffer "magit-extras" +"Switch to a Magit buffer belonging to the current Git repository. (fn BUFFER)" t) -(autoload 'magit-switch-to-repository-buffer-other-window "magit-extras" "\ -Switch to a Magit buffer belonging to the current Git repository. +(autoload 'magit-switch-to-repository-buffer-other-window "magit-extras" +"Switch to a Magit buffer belonging to the current Git repository. (fn BUFFER)" t) -(autoload 'magit-switch-to-repository-buffer-other-frame "magit-extras" "\ -Switch to a Magit buffer belonging to the current Git repository. +(autoload 'magit-switch-to-repository-buffer-other-frame "magit-extras" +"Switch to a Magit buffer belonging to the current Git repository. (fn BUFFER)" t) -(autoload 'magit-abort-dwim "magit-extras" "\ -Abort current operation. +(autoload 'magit-abort-dwim "magit-extras" +"Abort current operation. Depending on the context, this will abort a merge, a rebase, a patch application, a cherry-pick, a revert, or a bisect." t) -(autoload 'magit-back-to-indentation "magit-extras" "\ -Move point to the first non-whitespace character on this line. +(autoload 'magit-back-to-indentation "magit-extras" +"Move point to the first non-whitespace character on this line. In Magit diffs, also skip over - and + at the beginning of the line." t) (register-definition-prefixes "magit-extras" '("magit-")) @@ -1102,52 +1050,52 @@ In Magit diffs, also skip over - and + at the beginning of the line." t) (autoload 'magit-fetch "magit-fetch" nil t) (autoload 'magit-fetch-from-pushremote "magit-fetch" nil t) (autoload 'magit-fetch-from-upstream "magit-fetch" nil t) -(autoload 'magit-fetch-other "magit-fetch" "\ -Fetch from another repository. +(autoload 'magit-fetch-other "magit-fetch" +"Fetch from another repository. (fn REMOTE ARGS)" t) -(autoload 'magit-fetch-branch "magit-fetch" "\ -Fetch a BRANCH from a REMOTE. +(autoload 'magit-fetch-branch "magit-fetch" +"Fetch a BRANCH from a REMOTE. (fn REMOTE BRANCH ARGS)" t) -(autoload 'magit-fetch-refspec "magit-fetch" "\ -Fetch a REFSPEC from a REMOTE. +(autoload 'magit-fetch-refspec "magit-fetch" +"Fetch a REFSPEC from a REMOTE. (fn REMOTE REFSPEC ARGS)" t) -(autoload 'magit-fetch-all "magit-fetch" "\ -Fetch from all remotes. +(autoload 'magit-fetch-all "magit-fetch" +"Fetch from all remotes. (fn ARGS)" t) -(autoload 'magit-fetch-all-prune "magit-fetch" "\ -Fetch from all remotes, and prune. +(autoload 'magit-fetch-all-prune "magit-fetch" +"Fetch from all remotes, and prune. Prune remote tracking branches for branches that have been removed on the respective remote." t) -(autoload 'magit-fetch-all-no-prune "magit-fetch" "\ -Fetch from all remotes." t) +(autoload 'magit-fetch-all-no-prune "magit-fetch" +"Fetch from all remotes." t) (autoload 'magit-fetch-modules "magit-fetch" nil t) (register-definition-prefixes "magit-fetch" '("magit-")) ;;; Generated autoloads from magit-files.el -(autoload 'magit-find-file "magit-files" "\ -View FILE from REV. +(autoload 'magit-find-file "magit-files" +"View FILE from REV. Switch to a buffer visiting blob REV:FILE, creating one if none already exists. If prior to calling this command the current buffer and/or cursor position is about the same file, then go to the line and column corresponding to that location. (fn REV FILE)" t) -(autoload 'magit-find-file-other-window "magit-files" "\ -View FILE from REV, in another window. +(autoload 'magit-find-file-other-window "magit-files" +"View FILE from REV, in another window. Switch to a buffer visiting blob REV:FILE, creating one if none already exists. If prior to calling this command the current buffer and/or cursor position is about the same file, then go to the line and column corresponding to that location. (fn REV FILE)" t) -(autoload 'magit-find-file-other-frame "magit-files" "\ -View FILE from REV, in another frame. +(autoload 'magit-find-file-other-frame "magit-files" +"View FILE from REV, in another frame. Switch to a buffer visiting blob REV:FILE, creating one if none already exists. If prior to calling this command the current buffer and/or cursor position is about the same file, then go to @@ -1155,37 +1103,37 @@ the line and column corresponding to that location. (fn REV FILE)" t) (autoload 'magit-file-dispatch "magit" nil t) -(autoload 'magit-blob-visit-file "magit-files" "\ -View the file from the worktree corresponding to the current blob. +(autoload 'magit-blob-visit-file "magit-files" +"View the file from the worktree corresponding to the current blob. When visiting a blob or the version from the index, then go to the same location in the respective file in the working tree." t) -(autoload 'magit-file-stage "magit-files" "\ -Stage all changes to the file being visited in the current buffer." t) -(autoload 'magit-file-unstage "magit-files" "\ -Unstage all changes to the file being visited in the current buffer." t) -(autoload 'magit-file-untrack "magit-files" "\ -Untrack the selected FILES or one file read in the minibuffer. +(autoload 'magit-file-stage "magit-files" +"Stage all changes to the file being visited in the current buffer." t) +(autoload 'magit-file-unstage "magit-files" +"Unstage all changes to the file being visited in the current buffer." t) +(autoload 'magit-file-untrack "magit-files" +"Untrack the selected FILES or one file read in the minibuffer. With a prefix argument FORCE do so even when the files have staged as well as unstaged changes. (fn FILES &optional FORCE)" t) -(autoload 'magit-file-rename "magit-files" "\ -Rename or move FILE to NEWNAME. +(autoload 'magit-file-rename "magit-files" +"Rename or move FILE to NEWNAME. NEWNAME may be a file or directory name. If FILE isn't tracked in Git, fallback to using `rename-file'. (fn FILE NEWNAME)" t) -(autoload 'magit-file-delete "magit-files" "\ -Delete the selected FILES or one file read in the minibuffer. +(autoload 'magit-file-delete "magit-files" +"Delete the selected FILES or one file read in the minibuffer. With a prefix argument FORCE do so even when the files have uncommitted changes. When the files aren't being tracked in Git, then fallback to using `delete-file'. (fn FILES &optional FORCE)" t) -(autoload 'magit-file-checkout "magit-files" "\ -Checkout FILE from REV. +(autoload 'magit-file-checkout "magit-files" +"Checkout FILE from REV. (fn REV FILE)" t) (register-definition-prefixes "magit-files" '("lsp" "magit-")) @@ -1199,44 +1147,24 @@ Checkout FILE from REV. ;;; Generated autoloads from magit-gitignore.el (autoload 'magit-gitignore "magit-gitignore" nil t) -(autoload 'magit-gitignore-in-topdir "magit-gitignore" "\ -Add the Git ignore RULE to the top-level \".gitignore\" file. -Since this file is tracked, it is shared with other clones of the -repository. Also stage the file. - -(fn RULE)" t) -(autoload 'magit-gitignore-in-subdir "magit-gitignore" "\ -Add the Git ignore RULE to a \".gitignore\" file in DIRECTORY. -Prompt the user for a directory and add the rule to the -\".gitignore\" file in that directory. Since such files are -tracked, they are shared with other clones of the repository. -Also stage the file. - -(fn RULE DIRECTORY)" t) -(autoload 'magit-gitignore-in-gitdir "magit-gitignore" "\ -Add the Git ignore RULE to \"$GIT_DIR/info/exclude\". -Rules in that file only affects this clone of the repository. - -(fn RULE)" t) -(autoload 'magit-gitignore-on-system "magit-gitignore" "\ -Add the Git ignore RULE to the file specified by `core.excludesFile'. -Rules that are defined in that file affect all local repositories. - -(fn RULE)" t) -(autoload 'magit-skip-worktree "magit-gitignore" "\ -Call \"git update-index --skip-worktree -- FILE\". +(autoload 'magit-gitignore-in-topdir "magit-gitignore" nil t) +(autoload 'magit-gitignore-in-subdir "magit-gitignore" nil t) +(autoload 'magit-gitignore-in-gitdir "magit-gitignore" nil t) +(autoload 'magit-gitignore-on-system "magit-gitignore" nil t) +(autoload 'magit-skip-worktree "magit-gitignore" +"Call \"git update-index --skip-worktree -- FILE\". (fn FILE)" t) -(autoload 'magit-no-skip-worktree "magit-gitignore" "\ -Call \"git update-index --no-skip-worktree -- FILE\". +(autoload 'magit-no-skip-worktree "magit-gitignore" +"Call \"git update-index --no-skip-worktree -- FILE\". (fn FILE)" t) -(autoload 'magit-assume-unchanged "magit-gitignore" "\ -Call \"git update-index --assume-unchanged -- FILE\". +(autoload 'magit-assume-unchanged "magit-gitignore" +"Call \"git update-index --assume-unchanged -- FILE\". (fn FILE)" t) -(autoload 'magit-no-assume-unchanged "magit-gitignore" "\ -Call \"git update-index --no-assume-unchanged -- FILE\". +(autoload 'magit-no-assume-unchanged "magit-gitignore" +"Call \"git update-index --no-assume-unchanged -- FILE\". (fn FILE)" t) (register-definition-prefixes "magit-gitignore" '("magit-")) @@ -1247,58 +1175,58 @@ Call \"git update-index --no-assume-unchanged -- FILE\". (autoload 'magit-log "magit-log" nil t) (autoload 'magit-log-refresh "magit-log" nil t) (autoload 'magit-log-current "magit-log" nil t) -(autoload 'magit-log-head "magit-log" "\ -Show log for `HEAD'. +(autoload 'magit-log-head "magit-log" +"Show log for `HEAD'. (fn &optional ARGS FILES)" t) -(autoload 'magit-log-related "magit-log" "\ -Show log for the current branch, its upstream and its push target. +(autoload 'magit-log-related "magit-log" +"Show log for the current branch, its upstream and its push target. When the upstream is a local branch, then also show its own upstream. When `HEAD' is detached, then show log for that, the previously checked out branch and its upstream and push-target. (fn REVS &optional ARGS FILES)" t) -(autoload 'magit-log-other "magit-log" "\ -Show log for one or more revs read from the minibuffer. +(autoload 'magit-log-other "magit-log" +"Show log for one or more revs read from the minibuffer. The user can input any revision or revisions separated by a space, or even ranges, but only branches and tags, and a representation of the commit at point, are available as completion candidates. (fn REVS &optional ARGS FILES)" t) -(autoload 'magit-log-branches "magit-log" "\ -Show log for all local branches and `HEAD'. +(autoload 'magit-log-branches "magit-log" +"Show log for all local branches and `HEAD'. (fn &optional ARGS FILES)" t) -(autoload 'magit-log-matching-branches "magit-log" "\ -Show log for all branches matching PATTERN and `HEAD'. +(autoload 'magit-log-matching-branches "magit-log" +"Show log for all branches matching PATTERN and `HEAD'. (fn PATTERN &optional ARGS FILES)" t) -(autoload 'magit-log-matching-tags "magit-log" "\ -Show log for all tags matching PATTERN and `HEAD'. +(autoload 'magit-log-matching-tags "magit-log" +"Show log for all tags matching PATTERN and `HEAD'. (fn PATTERN &optional ARGS FILES)" t) -(autoload 'magit-log-all-branches "magit-log" "\ -Show log for all local and remote branches and `HEAD'. +(autoload 'magit-log-all-branches "magit-log" +"Show log for all local and remote branches and `HEAD'. (fn &optional ARGS FILES)" t) -(autoload 'magit-log-all "magit-log" "\ -Show log for all references and `HEAD'. +(autoload 'magit-log-all "magit-log" +"Show log for all references and `HEAD'. (fn &optional ARGS FILES)" t) -(autoload 'magit-log-buffer-file "magit-log" "\ -Show log for the blob or file visited in the current buffer. +(autoload 'magit-log-buffer-file "magit-log" +"Show log for the blob or file visited in the current buffer. With a prefix argument or when `--follow' is an active log argument, then follow renames. When the region is active, restrict the log to the lines that the region touches. (fn &optional FOLLOW BEG END)" t) -(autoload 'magit-log-trace-definition "magit-log" "\ -Show log for the definition at point. +(autoload 'magit-log-trace-definition "magit-log" +"Show log for the definition at point. (fn FILE FN COMMIT)" t) -(autoload 'magit-log-merged "magit-log" "\ -Show log for the merge of COMMIT into BRANCH. +(autoload 'magit-log-merged "magit-log" +"Show log for the merge of COMMIT into BRANCH. More precisely, find merge commit M that brought COMMIT into BRANCH, and show the log of the range \"M^1..M\". If COMMIT is @@ -1309,26 +1237,26 @@ This command requires git-when-merged, which is available from https://github.com/mhagger/git-when-merged. (fn COMMIT BRANCH &optional ARGS FILES)" t) -(autoload 'magit-delete-shelved-branch "magit-log" "\ -Delete the shelved BRANCH. +(autoload 'magit-delete-shelved-branch "magit-log" +"Delete the shelved BRANCH. Delete a ref created by `magit-branch-shelve'. (fn BRANCH)" t) -(autoload 'magit-log-move-to-parent "magit-log" "\ -Move to the Nth parent of the current commit. +(autoload 'magit-log-move-to-parent "magit-log" +"Move to the Nth parent of the current commit. (fn &optional N)" t) (autoload 'magit-shortlog "magit-log" nil t) -(autoload 'magit-shortlog-since "magit-log" "\ -Show a history summary for commits since REV. +(autoload 'magit-shortlog-since "magit-log" +"Show a history summary for commits since REV. (fn COMMIT ARGS)" t) -(autoload 'magit-shortlog-range "magit-log" "\ -Show a history summary for commit or range REV-OR-RANGE. +(autoload 'magit-shortlog-range "magit-log" +"Show a history summary for commit or range REV-OR-RANGE. (fn REV-OR-RANGE ARGS)" t) -(autoload 'magit-cherry "magit-log" "\ -Show commits in a branch that are not merged in the upstream branch. +(autoload 'magit-cherry "magit-log" +"Show commits in a branch that are not merged in the upstream branch. (fn HEAD UPSTREAM)" t) (register-definition-prefixes "magit-log" '("magit-")) @@ -1342,8 +1270,8 @@ Show commits in a branch that are not merged in the upstream branch. ;;; Generated autoloads from magit-merge.el (autoload 'magit-merge "magit" nil t) -(autoload 'magit-merge-plain "magit-merge" "\ -Merge commit REV into the current branch; using default message. +(autoload 'magit-merge-plain "magit-merge" +"Merge commit REV into the current branch; using default message. Unless there are conflicts or a prefix argument is used create a merge commit using a generic commit message and without letting @@ -1351,27 +1279,35 @@ the user inspect the result. With a prefix argument pretend the merge failed to give the user the opportunity to inspect the merge. +To create an octopus-merge, separate branches with commas. + (git merge --no-edit|--no-commit [ARGS] REV) (fn REV &optional ARGS NOCOMMIT)" t) -(autoload 'magit-merge-editmsg "magit-merge" "\ -Merge commit REV into the current branch; and edit message. +(autoload 'magit-merge-editmsg "magit-merge" +"Merge commit REV into the current branch; and edit message. + Perform the merge and prepare a commit message but let the user edit it. +To create an octopus-merge, separate branches with commas. + (git merge --edit --no-ff [ARGS] REV) (fn REV &optional ARGS)" t) -(autoload 'magit-merge-nocommit "magit-merge" "\ -Merge commit REV into the current branch; pretending it failed. +(autoload 'magit-merge-nocommit "magit-merge" +"Merge commit REV into the current branch; pretending it failed. + Pretend the merge failed to give the user the opportunity to inspect the merge and change the commit message. +To create an octopus-merge, separate branches with commas. + (git merge --no-commit --no-ff [ARGS] REV) (fn REV &optional ARGS)" t) -(autoload 'magit-merge-dissolve "magit-merge" "\ -Merge the current branch into BRANCH and remove the former. +(autoload 'magit-merge-dissolve "magit-merge" +"Merge the current branch into BRANCH and remove the former. Before merging, force push the source branch to its push-remote, provided the respective remote branch already exists, ensuring @@ -1381,8 +1317,8 @@ if `forge-branch-pullreq' was used to create the merged branch, then also remove the respective remote branch. (fn BRANCH &optional ARGS)" t) -(autoload 'magit-merge-absorb "magit-merge" "\ -Merge BRANCH into the current branch and remove the former. +(autoload 'magit-merge-absorb "magit-merge" +"Merge BRANCH into the current branch and remove the former. Before merging, force push the source branch to its push-remote, provided the respective remote branch already exists, ensuring @@ -1392,18 +1328,18 @@ if `forge-branch-pullreq' was used to create the merged branch, then also remove the respective remote branch. (fn BRANCH &optional ARGS)" t) -(autoload 'magit-merge-squash "magit-merge" "\ -Squash commit REV into the current branch; don't create a commit. +(autoload 'magit-merge-squash "magit-merge" +"Squash commit REV into the current branch; don't create a commit. (git merge --squash REV) (fn REV)" t) -(autoload 'magit-merge-preview "magit-merge" "\ -Preview result of merging REV into the current branch. +(autoload 'magit-merge-preview "magit-merge" +"Preview result of merging REV into the current branch. (fn REV)" t) -(autoload 'magit-merge-abort "magit-merge" "\ -Abort the current merge operation. +(autoload 'magit-merge-abort "magit-merge" +"Abort the current merge operation. (git merge --abort)" t) (register-definition-prefixes "magit-merge" '("magit-")) @@ -1411,8 +1347,8 @@ Abort the current merge operation. ;;; Generated autoloads from magit-mode.el -(autoload 'magit-info "magit-mode" "\ -Visit the Magit manual." t) +(autoload 'magit-info "magit-mode" +"Visit the Magit manual." t) (register-definition-prefixes "magit-mode" '("magit-")) @@ -1427,8 +1363,8 @@ Visit the Magit manual." t) (autoload 'magit-patch "magit-patch" nil t) (autoload 'magit-patch-create "magit-patch" nil t) (autoload 'magit-patch-apply "magit-patch" nil t) -(autoload 'magit-patch-save "magit-patch" "\ -Write current diff into patch FILE. +(autoload 'magit-patch-save "magit-patch" +"Write current diff into patch FILE. What arguments are used to create the patch depends on the value of `magit-patch-save-arguments' and whether a prefix argument is @@ -1451,8 +1387,8 @@ Of course the arguments that are required to actually show the same differences as those shown in the buffer are always used. (fn FILE &optional ARG)" t) -(autoload 'magit-request-pull "magit-patch" "\ -Request upstream to pull from your public repository. +(autoload 'magit-request-pull "magit-patch" +"Request upstream to pull from your public repository. URL is the url of your publicly accessible repository. START is a commit that already is in the upstream repository. @@ -1473,8 +1409,8 @@ is asked to pull. START has to be reachable from that commit. (autoload 'magit-pull "magit-pull" nil t) (autoload 'magit-pull-from-pushremote "magit-pull" nil t) (autoload 'magit-pull-from-upstream "magit-pull" nil t) -(autoload 'magit-pull-branch "magit-pull" "\ -Pull from a branch read in the minibuffer. +(autoload 'magit-pull-branch "magit-pull" +"Pull from a branch read in the minibuffer. (fn SOURCE ARGS)" t) (register-definition-prefixes "magit-pull" '("magit-pull-")) @@ -1485,42 +1421,42 @@ Pull from a branch read in the minibuffer. (autoload 'magit-push "magit-push" nil t) (autoload 'magit-push-current-to-pushremote "magit-push" nil t) (autoload 'magit-push-current-to-upstream "magit-push" nil t) -(autoload 'magit-push-current "magit-push" "\ -Push the current branch to a branch read in the minibuffer. +(autoload 'magit-push-current "magit-push" +"Push the current branch to a branch read in the minibuffer. (fn TARGET ARGS)" t) -(autoload 'magit-push-other "magit-push" "\ -Push an arbitrary branch or commit somewhere. +(autoload 'magit-push-other "magit-push" +"Push an arbitrary branch or commit somewhere. Both the source and the target are read in the minibuffer. (fn SOURCE TARGET ARGS)" t) -(autoload 'magit-push-refspecs "magit-push" "\ -Push one or multiple REFSPECS to a REMOTE. +(autoload 'magit-push-refspecs "magit-push" +"Push one or multiple REFSPECS to a REMOTE. Both the REMOTE and the REFSPECS are read in the minibuffer. To use multiple REFSPECS, separate them with commas. Completion is only available for the part before the colon, or when no colon is used. (fn REMOTE REFSPECS ARGS)" t) -(autoload 'magit-push-matching "magit-push" "\ -Push all matching branches to another repository. +(autoload 'magit-push-matching "magit-push" +"Push all matching branches to another repository. If multiple remotes exist, then read one from the user. If just one exists, use that without requiring confirmation. (fn REMOTE &optional ARGS)" t) -(autoload 'magit-push-tags "magit-push" "\ -Push all tags to another repository. +(autoload 'magit-push-tags "magit-push" +"Push all tags to another repository. If only one remote exists, then push to that. Otherwise prompt for a remote, offering the remote configured for the current branch as default. (fn REMOTE &optional ARGS)" t) -(autoload 'magit-push-tag "magit-push" "\ -Push a tag to another repository. +(autoload 'magit-push-tag "magit-push" +"Push a tag to another repository. (fn TAG REMOTE &optional ARGS)" t) -(autoload 'magit-push-notes-ref "magit-push" "\ -Push a notes ref to another repository. +(autoload 'magit-push-notes-ref "magit-push" +"Push a notes ref to another repository. (fn REF REMOTE &optional ARGS)" t) (autoload 'magit-push-implicitly "magit-push" nil t) @@ -1530,33 +1466,33 @@ Push a notes ref to another repository. ;;; Generated autoloads from magit-reflog.el -(autoload 'magit-reflog-current "magit-reflog" "\ -Display the reflog of the current branch. +(autoload 'magit-reflog-current "magit-reflog" +"Display the reflog of the current branch. If `HEAD' is detached, then show the reflog for that instead." t) -(autoload 'magit-reflog-other "magit-reflog" "\ -Display the reflog of a branch or another ref. +(autoload 'magit-reflog-other "magit-reflog" +"Display the reflog of a branch or another ref. (fn REF)" t) -(autoload 'magit-reflog-head "magit-reflog" "\ -Display the `HEAD' reflog." t) +(autoload 'magit-reflog-head "magit-reflog" +"Display the `HEAD' reflog." t) (register-definition-prefixes "magit-reflog" '("magit-reflog-")) ;;; Generated autoloads from magit-refs.el (autoload 'magit-show-refs "magit-refs" nil t) -(autoload 'magit-show-refs-head "magit-refs" "\ -List and compare references in a dedicated buffer. +(autoload 'magit-show-refs-head "magit-refs" +"List and compare references in a dedicated buffer. Compared with `HEAD'. (fn &optional ARGS)" t) -(autoload 'magit-show-refs-current "magit-refs" "\ -List and compare references in a dedicated buffer. +(autoload 'magit-show-refs-current "magit-refs" +"List and compare references in a dedicated buffer. Compare with the current branch or `HEAD' if it is detached. (fn &optional ARGS)" t) -(autoload 'magit-show-refs-other "magit-refs" "\ -List and compare references in a dedicated buffer. +(autoload 'magit-show-refs-other "magit-refs" +"List and compare references in a dedicated buffer. Compared with a branch read from the user. (fn &optional REF ARGS)" t) @@ -1566,24 +1502,24 @@ Compared with a branch read from the user. ;;; Generated autoloads from magit-remote.el (autoload 'magit-remote "magit-remote" nil t) -(autoload 'magit-remote-add "magit-remote" "\ -Add a remote named REMOTE and fetch it. +(autoload 'magit-remote-add "magit-remote" +"Add a remote named REMOTE and fetch it. (fn REMOTE URL &optional ARGS)" t) -(autoload 'magit-remote-rename "magit-remote" "\ -Rename the remote named OLD to NEW. +(autoload 'magit-remote-rename "magit-remote" +"Rename the remote named OLD to NEW. (fn OLD NEW)" t) -(autoload 'magit-remote-remove "magit-remote" "\ -Delete the remote named REMOTE. +(autoload 'magit-remote-remove "magit-remote" +"Delete the remote named REMOTE. (fn REMOTE)" t) -(autoload 'magit-remote-prune "magit-remote" "\ -Remove stale remote-tracking branches for REMOTE. +(autoload 'magit-remote-prune "magit-remote" +"Remove stale remote-tracking branches for REMOTE. (fn REMOTE)" t) -(autoload 'magit-remote-prune-refspecs "magit-remote" "\ -Remove stale refspecs for REMOTE. +(autoload 'magit-remote-prune-refspecs "magit-remote" +"Remove stale refspecs for REMOTE. A refspec is stale if there no longer exists at least one branch on the remote that would be fetched due to that refspec. A stale @@ -1597,22 +1533,22 @@ Also remove the remote-tracking branches that were created due to the now stale refspecs. Other stale branches are not removed. (fn REMOTE)" t) -(autoload 'magit-remote-set-head "magit-remote" "\ -Set the local representation of REMOTE's default branch. +(autoload 'magit-remote-set-head "magit-remote" +"Set the local representation of REMOTE's default branch. Query REMOTE and set the symbolic-ref refs/remotes//HEAD accordingly. With a prefix argument query for the branch to be used, which allows you to select an incorrect value if you fancy doing that. (fn REMOTE &optional BRANCH)" t) -(autoload 'magit-remote-unset-head "magit-remote" "\ -Unset the local representation of REMOTE's default branch. +(autoload 'magit-remote-unset-head "magit-remote" +"Unset the local representation of REMOTE's default branch. Delete the symbolic-ref \"refs/remotes//HEAD\". (fn REMOTE)" t) (autoload 'magit-update-default-branch "magit-remote" nil t) -(autoload 'magit-remote-unshallow "magit-remote" "\ -Convert a shallow remote into a full one. +(autoload 'magit-remote-unshallow "magit-remote" +"Convert a shallow remote into a full one. If only a single refspec is set and it does not contain a wildcard, then also offer to replace it with the standard refspec. @@ -1624,8 +1560,8 @@ refspec. ;;; Generated autoloads from magit-repos.el -(autoload 'magit-list-repositories "magit-repos" "\ -Display a list of repositories. +(autoload 'magit-list-repositories "magit-repos" +"Display a list of repositories. Use the option `magit-repository-directories' to control which repositories are displayed." t) @@ -1635,45 +1571,45 @@ repositories are displayed." t) ;;; Generated autoloads from magit-reset.el (autoload 'magit-reset "magit" nil t) -(autoload 'magit-reset-mixed "magit-reset" "\ -Reset the `HEAD' and index to COMMIT, but not the working tree. +(autoload 'magit-reset-mixed "magit-reset" +"Reset the `HEAD' and index to COMMIT, but not the working tree. (git reset --mixed COMMIT) (fn COMMIT)" t) -(autoload 'magit-reset-soft "magit-reset" "\ -Reset the `HEAD' to COMMIT, but not the index and working tree. +(autoload 'magit-reset-soft "magit-reset" +"Reset the `HEAD' to COMMIT, but not the index and working tree. (git reset --soft COMMIT) (fn COMMIT)" t) -(autoload 'magit-reset-hard "magit-reset" "\ -Reset the `HEAD', index, and working tree to COMMIT. +(autoload 'magit-reset-hard "magit-reset" +"Reset the `HEAD', index, and working tree to COMMIT. (git reset --hard COMMIT) (fn COMMIT)" t) -(autoload 'magit-reset-keep "magit-reset" "\ -Reset the `HEAD' and index to COMMIT, while keeping uncommitted changes. +(autoload 'magit-reset-keep "magit-reset" +"Reset the `HEAD' and index to COMMIT, while keeping uncommitted changes. (git reset --keep COMMIT) (fn COMMIT)" t) -(autoload 'magit-reset-index "magit-reset" "\ -Reset the index to COMMIT. +(autoload 'magit-reset-index "magit-reset" +"Reset the index to COMMIT. Keep the `HEAD' and working tree as-is, so if COMMIT refers to the head this effectively unstages all changes. (git reset COMMIT .) (fn COMMIT)" t) -(autoload 'magit-reset-worktree "magit-reset" "\ -Reset the worktree to COMMIT. +(autoload 'magit-reset-worktree "magit-reset" +"Reset the worktree to COMMIT. Keep the `HEAD' and index as-is. (fn COMMIT)" t) -(autoload 'magit-reset-quickly "magit-reset" "\ -Reset the `HEAD' and index to COMMIT, and possibly the working tree. +(autoload 'magit-reset-quickly "magit-reset" +"Reset the `HEAD' and index to COMMIT, and possibly the working tree. With a prefix argument reset the working tree otherwise don't. (git reset --mixed|--hard COMMIT) @@ -1684,166 +1620,166 @@ With a prefix argument reset the working tree otherwise don't. ;;; Generated autoloads from magit-sequence.el -(autoload 'magit-sequencer-continue "magit-sequence" "\ -Resume the current cherry-pick or revert sequence." t) -(autoload 'magit-sequencer-skip "magit-sequence" "\ -Skip the stopped at commit during a cherry-pick or revert sequence." t) -(autoload 'magit-sequencer-abort "magit-sequence" "\ -Abort the current cherry-pick or revert sequence. +(autoload 'magit-sequencer-continue "magit-sequence" +"Resume the current cherry-pick or revert sequence." t) +(autoload 'magit-sequencer-skip "magit-sequence" +"Skip the stopped at commit during a cherry-pick or revert sequence." t) +(autoload 'magit-sequencer-abort "magit-sequence" +"Abort the current cherry-pick or revert sequence. This discards all changes made since the sequence started." t) (autoload 'magit-cherry-pick "magit-sequence" nil t) -(autoload 'magit-cherry-copy "magit-sequence" "\ -Copy COMMITS from another branch onto the current branch. +(autoload 'magit-cherry-copy "magit-sequence" +"Copy COMMITS from another branch onto the current branch. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then pick all of them, without prompting. (fn COMMITS &optional ARGS)" t) -(autoload 'magit-cherry-apply "magit-sequence" "\ -Apply the changes in COMMITS but do not commit them. +(autoload 'magit-cherry-apply "magit-sequence" +"Apply the changes in COMMITS but do not commit them. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then apply all of them, without prompting. (fn COMMITS &optional ARGS)" t) -(autoload 'magit-cherry-harvest "magit-sequence" "\ -Move COMMITS from another BRANCH onto the current branch. +(autoload 'magit-cherry-harvest "magit-sequence" +"Move COMMITS from another BRANCH onto the current branch. Remove the COMMITS from BRANCH and stay on the current branch. If a conflict occurs, then you have to fix that and finish the process manually. (fn COMMITS BRANCH &optional ARGS)" t) -(autoload 'magit-cherry-donate "magit-sequence" "\ -Move COMMITS from the current branch onto another existing BRANCH. +(autoload 'magit-cherry-donate "magit-sequence" +"Move COMMITS from the current branch onto another existing BRANCH. Remove COMMITS from the current branch and stay on that branch. If a conflict occurs, then you have to fix that and finish the process manually. `HEAD' is allowed to be detached initially. (fn COMMITS BRANCH &optional ARGS)" t) -(autoload 'magit-cherry-spinout "magit-sequence" "\ -Move COMMITS from the current branch onto a new BRANCH. +(autoload 'magit-cherry-spinout "magit-sequence" +"Move COMMITS from the current branch onto a new BRANCH. Remove COMMITS from the current branch and stay on that branch. If a conflict occurs, then you have to fix that and finish the process manually. (fn COMMITS BRANCH START-POINT &optional ARGS)" t) -(autoload 'magit-cherry-spinoff "magit-sequence" "\ -Move COMMITS from the current branch onto a new BRANCH. +(autoload 'magit-cherry-spinoff "magit-sequence" +"Move COMMITS from the current branch onto a new BRANCH. Remove COMMITS from the current branch and checkout BRANCH. If a conflict occurs, then you have to fix that and finish the process manually. (fn COMMITS BRANCH START-POINT &optional ARGS)" t) (autoload 'magit-revert "magit-sequence" nil t) -(autoload 'magit-revert-and-commit "magit-sequence" "\ -Revert COMMIT by creating a new commit. +(autoload 'magit-revert-and-commit "magit-sequence" +"Revert COMMIT by creating a new commit. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then revert all of them, without prompting. (fn COMMIT &optional ARGS)" t) -(autoload 'magit-revert-no-commit "magit-sequence" "\ -Revert COMMIT by applying it in reverse to the worktree. +(autoload 'magit-revert-no-commit "magit-sequence" +"Revert COMMIT by applying it in reverse to the worktree. Prompt for a commit, defaulting to the commit at point. If the region selects multiple commits, then revert all of them, without prompting. (fn COMMIT &optional ARGS)" t) (autoload 'magit-am "magit-sequence" nil t) -(autoload 'magit-am-apply-patches "magit-sequence" "\ -Apply the patches FILES. +(autoload 'magit-am-apply-patches "magit-sequence" +"Apply the patches FILES. (fn &optional FILES ARGS)" t) -(autoload 'magit-am-apply-maildir "magit-sequence" "\ -Apply the patches from MAILDIR. +(autoload 'magit-am-apply-maildir "magit-sequence" +"Apply the patches from MAILDIR. (fn &optional MAILDIR ARGS)" t) -(autoload 'magit-am-continue "magit-sequence" "\ -Resume the current patch applying sequence." t) -(autoload 'magit-am-skip "magit-sequence" "\ -Skip the stopped at patch during a patch applying sequence." t) -(autoload 'magit-am-abort "magit-sequence" "\ -Abort the current patch applying sequence. +(autoload 'magit-am-continue "magit-sequence" +"Resume the current patch applying sequence." t) +(autoload 'magit-am-skip "magit-sequence" +"Skip the stopped at patch during a patch applying sequence." t) +(autoload 'magit-am-abort "magit-sequence" +"Abort the current patch applying sequence. This discards all changes made since the sequence started." t) (autoload 'magit-rebase "magit-sequence" nil t) (autoload 'magit-rebase-onto-pushremote "magit-sequence" nil t) (autoload 'magit-rebase-onto-upstream "magit-sequence" nil t) -(autoload 'magit-rebase-branch "magit-sequence" "\ -Rebase the current branch onto a branch read in the minibuffer. +(autoload 'magit-rebase-branch "magit-sequence" +"Rebase the current branch onto a branch read in the minibuffer. All commits that are reachable from `HEAD' but not from the selected branch TARGET are being rebased. (fn TARGET ARGS)" t) -(autoload 'magit-rebase-subset "magit-sequence" "\ -Rebase a subset of the current branch's history onto a new base. +(autoload 'magit-rebase-subset "magit-sequence" +"Rebase a subset of the current branch's history onto a new base. Rebase commits from START to `HEAD' onto NEWBASE. START has to be selected from a list of recent commits. (fn NEWBASE START ARGS)" t) -(autoload 'magit-rebase-interactive "magit-sequence" "\ -Start an interactive rebase sequence. +(autoload 'magit-rebase-interactive "magit-sequence" +"Start an interactive rebase sequence. (fn COMMIT ARGS)" t) -(autoload 'magit-rebase-autosquash "magit-sequence" "\ -Combine squash and fixup commits with their intended targets. +(autoload 'magit-rebase-autosquash "magit-sequence" +"Combine squash and fixup commits with their intended targets. By default only squash into commits that are not reachable from the upstream branch. If no upstream is configured or with a prefix argument, prompt for the first commit to potentially squash into. (fn SELECT ARGS)" t) -(autoload 'magit-rebase-edit-commit "magit-sequence" "\ -Edit a single older commit using rebase. +(autoload 'magit-rebase-edit-commit "magit-sequence" +"Edit a single older commit using rebase. (fn COMMIT ARGS)" t) -(autoload 'magit-rebase-reword-commit "magit-sequence" "\ -Reword a single older commit using rebase. +(autoload 'magit-rebase-reword-commit "magit-sequence" +"Reword a single older commit using rebase. (fn COMMIT ARGS)" t) -(autoload 'magit-rebase-remove-commit "magit-sequence" "\ -Remove a single older commit using rebase. +(autoload 'magit-rebase-remove-commit "magit-sequence" +"Remove a single older commit using rebase. (fn COMMIT ARGS)" t) -(autoload 'magit-rebase-continue "magit-sequence" "\ -Restart the current rebasing operation. +(autoload 'magit-rebase-continue "magit-sequence" +"Restart the current rebasing operation. 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. (fn &optional NOEDIT)" t) -(autoload 'magit-rebase-skip "magit-sequence" "\ -Skip the current commit and restart the current rebase operation." t) -(autoload 'magit-rebase-edit "magit-sequence" "\ -Edit the todo list of the current rebase operation." t) -(autoload 'magit-rebase-abort "magit-sequence" "\ -Abort the current rebase operation, restoring the original branch." t) +(autoload 'magit-rebase-skip "magit-sequence" +"Skip the current commit and restart the current rebase operation." t) +(autoload 'magit-rebase-edit "magit-sequence" +"Edit the todo list of the current rebase operation." t) +(autoload 'magit-rebase-abort "magit-sequence" +"Abort the current rebase operation, restoring the original branch." t) (register-definition-prefixes "magit-sequence" '("magit-")) ;;; Generated autoloads from magit-sparse-checkout.el (autoload 'magit-sparse-checkout "magit-sparse-checkout" nil t) -(autoload 'magit-sparse-checkout-enable "magit-sparse-checkout" "\ -Convert the working tree to a sparse checkout. +(autoload 'magit-sparse-checkout-enable "magit-sparse-checkout" +"Convert the working tree to a sparse checkout. (fn &optional ARGS)" t) -(autoload 'magit-sparse-checkout-set "magit-sparse-checkout" "\ -Restrict working tree to DIRECTORIES. +(autoload 'magit-sparse-checkout-set "magit-sparse-checkout" +"Restrict working tree to DIRECTORIES. To extend rather than override the currently configured directories, call `magit-sparse-checkout-add' instead. (fn DIRECTORIES)" t) -(autoload 'magit-sparse-checkout-add "magit-sparse-checkout" "\ -Add DIRECTORIES to the working tree. +(autoload 'magit-sparse-checkout-add "magit-sparse-checkout" +"Add DIRECTORIES to the working tree. To override rather than extend the currently configured directories, call `magit-sparse-checkout-set' instead. (fn DIRECTORIES)" t) -(autoload 'magit-sparse-checkout-reapply "magit-sparse-checkout" "\ -Reapply the sparse checkout rules to the working tree. +(autoload 'magit-sparse-checkout-reapply "magit-sparse-checkout" +"Reapply the sparse checkout rules to the working tree. Some operations such as merging or rebasing may need to check out files that aren't included in the sparse checkout. Call this command to reset to the sparse checkout state." t) -(autoload 'magit-sparse-checkout-disable "magit-sparse-checkout" "\ -Convert sparse checkout to full checkout. +(autoload 'magit-sparse-checkout-disable "magit-sparse-checkout" +"Convert sparse checkout to full checkout. Note that disabling the sparse checkout does not clear the configured directories. Call `magit-sparse-checkout-enable' to restore the previous sparse checkout." t) @@ -1853,55 +1789,55 @@ restore the previous sparse checkout." t) ;;; Generated autoloads from magit-stash.el (autoload 'magit-stash "magit-stash" nil t) -(autoload 'magit-stash-both "magit-stash" "\ -Create a stash of the index and working tree. +(autoload 'magit-stash-both "magit-stash" +"Create a stash of the index and working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to `--include-untracked' while two prefix arguments are equivalent to `--all'. (fn MESSAGE &optional INCLUDE-UNTRACKED)" t) -(autoload 'magit-stash-index "magit-stash" "\ -Create a stash of the index only. +(autoload 'magit-stash-index "magit-stash" +"Create a stash of the index only. Unstaged and untracked changes are not stashed. The stashed changes are applied in reverse to both the index and the worktree. This command can fail when the worktree is not clean. Applying the resulting stash has the inverse effect. (fn MESSAGE)" t) -(autoload 'magit-stash-worktree "magit-stash" "\ -Create a stash of unstaged changes in the working tree. +(autoload 'magit-stash-worktree "magit-stash" +"Create a stash of unstaged changes in the working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to `--include-untracked' while two prefix arguments are equivalent to `--all'. (fn MESSAGE &optional INCLUDE-UNTRACKED)" t) -(autoload 'magit-stash-keep-index "magit-stash" "\ -Create a stash of the index and working tree, keeping index intact. +(autoload 'magit-stash-keep-index "magit-stash" +"Create a stash of the index and working tree, keeping index intact. Untracked files are included according to infix arguments. One prefix argument is equivalent to `--include-untracked' while two prefix arguments are equivalent to `--all'. (fn MESSAGE &optional INCLUDE-UNTRACKED)" t) -(autoload 'magit-snapshot-both "magit-stash" "\ -Create a snapshot of the index and working tree. +(autoload 'magit-snapshot-both "magit-stash" +"Create a snapshot of the index and working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to `--include-untracked' while two prefix arguments are equivalent to `--all'. (fn &optional INCLUDE-UNTRACKED)" t) -(autoload 'magit-snapshot-index "magit-stash" "\ -Create a snapshot of the index only. +(autoload 'magit-snapshot-index "magit-stash" +"Create a snapshot of the index only. Unstaged and untracked changes are not stashed." t) -(autoload 'magit-snapshot-worktree "magit-stash" "\ -Create a snapshot of unstaged changes in the working tree. +(autoload 'magit-snapshot-worktree "magit-stash" +"Create a snapshot of unstaged changes in the working tree. Untracked files are included according to infix arguments. One prefix argument is equivalent to `--include-untracked' while two prefix arguments are equivalent to `--all'. (fn &optional INCLUDE-UNTRACKED)" t) (autoload 'magit-stash-push "magit-stash" nil t) -(autoload 'magit-stash-apply "magit-stash" "\ -Apply a stash to the working tree. +(autoload 'magit-stash-apply "magit-stash" +"Apply a stash to the working tree. When using a Git release before v2.38.0, simply run \"git stash apply\" or with a prefix argument \"git stash apply --index\". @@ -1921,8 +1857,8 @@ that argument or \"--reject\". Customize `magit-no-confirm' if you want to fall back to using \"--3way\", without being prompted. (fn STASH)" t) -(autoload 'magit-stash-pop "magit-stash" "\ -Apply a stash to the working tree, on success remove it from stash list. +(autoload 'magit-stash-pop "magit-stash" +"Apply a stash to the working tree, on success remove it from stash list. When using a Git release before v2.38.0, simply run \"git stash pop\" or with a prefix argument \"git stash pop --index\". @@ -1942,35 +1878,35 @@ that argument or \"--reject\". Customize `magit-no-confirm' if you want to fall back to using \"--3way\", without being prompted. (fn STASH)" t) -(autoload 'magit-stash-drop "magit-stash" "\ -Remove a stash from the stash list. +(autoload 'magit-stash-drop "magit-stash" +"Remove a stash from the stash list. When the region is active offer to drop all contained stashes. (fn STASH)" t) -(autoload 'magit-stash-clear "magit-stash" "\ -Remove all stashes saved in REF's reflog by deleting REF. +(autoload 'magit-stash-clear "magit-stash" +"Remove all stashes saved in REF's reflog by deleting REF. (fn REF)" t) -(autoload 'magit-stash-branch "magit-stash" "\ -Create and checkout a new BRANCH from an existing STASH. +(autoload 'magit-stash-branch "magit-stash" +"Create and checkout a new BRANCH from an existing STASH. The new branch starts at the commit that was current when the stash was created. If the stash applies cleanly, then drop it. (fn STASH BRANCH)" t) -(autoload 'magit-stash-branch-here "magit-stash" "\ -Create and checkout a new BRANCH from an existing STASH. +(autoload 'magit-stash-branch-here "magit-stash" +"Create and checkout a new BRANCH from an existing STASH. Use the current branch or `HEAD' as the starting-point of BRANCH. Then apply STASH, dropping it if it applies cleanly. (fn STASH BRANCH)" t) -(autoload 'magit-stash-format-patch "magit-stash" "\ -Create a patch from STASH. +(autoload 'magit-stash-format-patch "magit-stash" +"Create a patch from STASH. (fn STASH)" t) -(autoload 'magit-stash-list "magit-stash" "\ -List all stashes in a buffer." t) -(autoload 'magit-stash-show "magit-stash" "\ -Show all diffs of a stash in a buffer. +(autoload 'magit-stash-list "magit-stash" +"List all stashes in a buffer." t) +(autoload 'magit-stash-show "magit-stash" +"Show all diffs of a stash in a buffer. (fn STASH &optional ARGS FILES)" t) (register-definition-prefixes "magit-stash" '("magit-")) @@ -1978,8 +1914,8 @@ Show all diffs of a stash in a buffer. ;;; Generated autoloads from magit-status.el -(autoload 'magit-init "magit-status" "\ -Initialize a Git repository, then show its status. +(autoload 'magit-init "magit-status" +"Initialize a Git repository, then show its status. If the directory is below an existing repository, then the user has to confirm that a new one should be created inside. If the @@ -1989,8 +1925,8 @@ has to confirm that it should be reinitialized. Non-interactively DIRECTORY is (re-)initialized unconditionally. (fn DIRECTORY)" t) -(autoload 'magit-status "magit-status" "\ -Show the status of the current Git repository in a buffer. +(autoload 'magit-status "magit-status" +"Show the status of the current Git repository in a buffer. If the current directory isn't located within a Git repository, then prompt for an existing repository or an arbitrary directory, @@ -2023,8 +1959,8 @@ prefix arguments: arguments. (fn &optional DIRECTORY CACHE)" t) -(defalias 'magit #'magit-status "\ -Begin using Magit. +(defalias 'magit #'magit-status +"Begin using Magit. This alias for `magit-status' exists for better discoverability. @@ -2032,12 +1968,12 @@ Instead of invoking this alias for `magit-status' using \"M-x magit RET\", you should bind a key to `magit-status' and read the info node `(magit)Getting Started', which also contains other useful hints.") -(autoload 'magit-status-here "magit-status" "\ -Like `magit-status' but with non-nil `magit-status-goto-file-position'. +(autoload 'magit-status-here "magit-status" +"Like `magit-status' but with non-nil `magit-status-goto-file-position'. Before doing so, save all file-visiting buffers belonging to the current repository without prompting." t) -(autoload 'magit-status-quick "magit-status" "\ -Show the status of the current Git repository, maybe without refreshing. +(autoload 'magit-status-quick "magit-status" +"Show the status of the current Git repository, maybe without refreshing. If the status buffer of the current Git repository exists but isn't being displayed in the selected frame, then display it @@ -2051,8 +1987,8 @@ and additionally cause the buffer to be refresh. To use this function instead of `magit-status', add this to your init file: (global-set-key (kbd \"C-x g\") \\='magit-status-quick)." t) -(autoload 'magit-status-setup-buffer "magit-status" "\ - +(autoload 'magit-status-setup-buffer "magit-status" +" (fn &optional DIRECTORY)") (register-definition-prefixes "magit-status" '("magit-")) @@ -2062,8 +1998,8 @@ init file: (global-set-key (kbd \"C-x g\") \\='magit-status-quick)." t) (autoload 'magit-submodule "magit-submodule" nil t) (autoload 'magit-submodule-add "magit-submodule" nil t) -(autoload 'magit-submodule-read-name-for-path "magit-submodule" "\ - +(autoload 'magit-submodule-read-name-for-path "magit-submodule" +" (fn PATH &optional PREFER-SHORT)") (autoload 'magit-submodule-register "magit-submodule" nil t) @@ -2071,8 +2007,8 @@ init file: (global-set-key (kbd \"C-x g\") \\='magit-status-quick)." t) (autoload 'magit-submodule-update "magit-submodule" nil t) (autoload 'magit-submodule-synchronize "magit-submodule" nil t) (autoload 'magit-submodule-unpopulate "magit-submodule" nil t) -(autoload 'magit-submodule-remove "magit-submodule" "\ -Unregister MODULES and remove their working directories. +(autoload 'magit-submodule-remove "magit-submodule" +"Unregister MODULES and remove their working directories. For safety reasons, do not remove the gitdirs and if a module has uncommitted changes, then do not remove it at all. If a module's @@ -2086,29 +2022,29 @@ are additional safety precautions in place, so you might be able to recover from making a mistake here, but don't count on it. (fn MODULES ARGS TRASH-GITDIRS)" t) -(autoload 'magit-insert-modules "magit-submodule" "\ -Insert submodule sections. +(autoload 'magit-insert-modules "magit-submodule" +"Insert submodule sections. Hook `magit-module-sections-hook' controls which module sections are inserted, and option `magit-module-sections-nested' controls whether they are wrapped in an additional section.") -(autoload 'magit-insert-modules-overview "magit-submodule" "\ -Insert sections for all modules. +(autoload 'magit-insert-modules-overview "magit-submodule" +"Insert sections for all modules. For each section insert the path and the output of `git describe --tags', or, failing that, the abbreviated HEAD commit hash.") -(autoload 'magit-insert-modules-unpulled-from-upstream "magit-submodule" "\ -Insert sections for modules that haven't been pulled from the upstream. +(autoload 'magit-insert-modules-unpulled-from-upstream "magit-submodule" +"Insert sections for modules that haven't been pulled from the upstream. These sections can be expanded to show the respective commits.") -(autoload 'magit-insert-modules-unpulled-from-pushremote "magit-submodule" "\ -Insert sections for modules that haven't been pulled from the push-remote. +(autoload 'magit-insert-modules-unpulled-from-pushremote "magit-submodule" +"Insert sections for modules that haven't been pulled from the push-remote. These sections can be expanded to show the respective commits.") -(autoload 'magit-insert-modules-unpushed-to-upstream "magit-submodule" "\ -Insert sections for modules that haven't been pushed to the upstream. +(autoload 'magit-insert-modules-unpushed-to-upstream "magit-submodule" +"Insert sections for modules that haven't been pushed to the upstream. These sections can be expanded to show the respective commits.") -(autoload 'magit-insert-modules-unpushed-to-pushremote "magit-submodule" "\ -Insert sections for modules that haven't been pushed to the push-remote. +(autoload 'magit-insert-modules-unpushed-to-pushremote "magit-submodule" +"Insert sections for modules that haven't been pushed to the push-remote. These sections can be expanded to show the respective commits.") -(autoload 'magit-list-submodules "magit-submodule" "\ -Display a list of the current repository's populated submodules." t) +(autoload 'magit-list-submodules "magit-submodule" +"Display a list of the current repository's populated submodules." t) (register-definition-prefixes "magit-submodule" '("magit-")) @@ -2117,28 +2053,28 @@ Display a list of the current repository's populated submodules." t) (autoload 'magit-subtree "magit-subtree" nil t) (autoload 'magit-subtree-import "magit-subtree" nil t) (autoload 'magit-subtree-export "magit-subtree" nil t) -(autoload 'magit-subtree-add "magit-subtree" "\ -Add REF from REPOSITORY as a new subtree at PREFIX. +(autoload 'magit-subtree-add "magit-subtree" +"Add REF from REPOSITORY as a new subtree at PREFIX. (fn PREFIX REPOSITORY REF ARGS)" t) -(autoload 'magit-subtree-add-commit "magit-subtree" "\ -Add COMMIT as a new subtree at PREFIX. +(autoload 'magit-subtree-add-commit "magit-subtree" +"Add COMMIT as a new subtree at PREFIX. (fn PREFIX COMMIT ARGS)" t) -(autoload 'magit-subtree-merge "magit-subtree" "\ -Merge COMMIT into the PREFIX subtree. +(autoload 'magit-subtree-merge "magit-subtree" +"Merge COMMIT into the PREFIX subtree. (fn PREFIX COMMIT ARGS)" t) -(autoload 'magit-subtree-pull "magit-subtree" "\ -Pull REF from REPOSITORY into the PREFIX subtree. +(autoload 'magit-subtree-pull "magit-subtree" +"Pull REF from REPOSITORY into the PREFIX subtree. (fn PREFIX REPOSITORY REF ARGS)" t) -(autoload 'magit-subtree-push "magit-subtree" "\ -Extract the history of the subtree PREFIX and push it to REF on REPOSITORY. +(autoload 'magit-subtree-push "magit-subtree" +"Extract the history of the subtree PREFIX and push it to REF on REPOSITORY. (fn PREFIX REPOSITORY REF ARGS)" t) -(autoload 'magit-subtree-split "magit-subtree" "\ -Extract the history of the subtree PREFIX. +(autoload 'magit-subtree-split "magit-subtree" +"Extract the history of the subtree PREFIX. (fn PREFIX COMMIT ARGS)" t) (register-definition-prefixes "magit-subtree" '("magit-")) @@ -2147,15 +2083,15 @@ Extract the history of the subtree PREFIX. ;;; Generated autoloads from magit-tag.el (autoload 'magit-tag "magit" nil t) -(autoload 'magit-tag-create "magit-tag" "\ -Create a new tag with the given NAME at COMMIT. +(autoload 'magit-tag-create "magit-tag" +"Create a new tag with the given NAME at COMMIT. With a prefix argument annotate the tag. (git tag [--annotate] NAME REV) (fn NAME COMMIT &optional ARGS)" t) -(autoload 'magit-tag-delete "magit-tag" "\ -Delete one or more tags. +(autoload 'magit-tag-delete "magit-tag" +"Delete one or more tags. If the region marks multiple tags (and nothing else), then offer to delete those, otherwise prompt for a single tag to be deleted, defaulting to the tag at point. @@ -2163,12 +2099,12 @@ defaulting to the tag at point. (git tag -d TAGS) (fn TAGS)" t) -(autoload 'magit-tag-prune "magit-tag" "\ -Offer to delete tags missing locally from REMOTE, and vice versa. +(autoload 'magit-tag-prune "magit-tag" +"Offer to delete tags missing locally from REMOTE, and vice versa. (fn TAGS REMOTE-TAGS REMOTE)" t) -(autoload 'magit-tag-release "magit-tag" "\ -Create a release tag for `HEAD'. +(autoload 'magit-tag-release "magit-tag" +"Create a release tag for `HEAD'. Assume that release tags match `magit-release-tag-regexp'. @@ -2194,16 +2130,16 @@ that is not the case, propose a message using a reasonable format. ;;; Generated autoloads from magit-wip.el -(defvar magit-wip-mode nil "\ -Non-nil if Magit-Wip mode is enabled. +(defvar magit-wip-mode nil +"Non-nil if Magit-Wip mode is enabled. See the `magit-wip-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `magit-wip-mode'.") (custom-autoload 'magit-wip-mode "magit-wip" nil) -(autoload 'magit-wip-mode "magit-wip" "\ -Automatically save uncommitted changes to work-in-progress refs. +(autoload 'magit-wip-mode "magit-wip" +"Automatically save uncommitted changes to work-in-progress refs. This is a global minor mode. If called interactively, toggle the `Magit-Wip mode' mode. If the prefix argument is positive, enable the @@ -2226,19 +2162,19 @@ disabled. ;;; Generated autoloads from magit-worktree.el (autoload 'magit-worktree "magit-worktree" nil t) -(autoload 'magit-worktree-checkout "magit-worktree" "\ -Checkout COMMIT in a new worktree in DIRECTORY. +(autoload 'magit-worktree-checkout "magit-worktree" +"Checkout COMMIT in a new worktree in DIRECTORY. COMMIT may, but does not have to be, a local branch. Interactively, use `magit-read-worktree-directory-function'. (fn DIRECTORY COMMIT)" t) -(autoload 'magit-worktree-branch "magit-worktree" "\ -Create a new BRANCH and check it out in a new worktree at DIRECTORY. +(autoload 'magit-worktree-branch "magit-worktree" +"Create a new BRANCH and check it out in a new worktree at DIRECTORY. Interactively, use `magit-read-worktree-directory-function'. (fn DIRECTORY BRANCH START-POINT)" t) -(autoload 'magit-worktree-move "magit-worktree" "\ -Move existing WORKTREE directory to DIRECTORY. +(autoload 'magit-worktree-move "magit-worktree" +"Move existing WORKTREE directory to DIRECTORY. (fn WORKTREE DIRECTORY)" t) (register-definition-prefixes "magit-worktree" '("magit-")) diff --git a/elpa/magit-20251217.1836/magit-autorevert.el b/elpa/magit-20260422.2206/magit-autorevert.el similarity index 99% rename from elpa/magit-20251217.1836/magit-autorevert.el rename to elpa/magit-20260422.2206/magit-autorevert.el index 3b0c465a..f684c54f 100644 --- a/elpa/magit-20251217.1836/magit-autorevert.el +++ b/elpa/magit-20260422.2206/magit-autorevert.el @@ -1,6 +1,6 @@ ;;; magit-autorevert.el --- Revert buffers when files in repository change -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli diff --git a/elpa/magit-20251217.1836/magit-base.el b/elpa/magit-20260422.2206/magit-base.el similarity index 92% rename from elpa/magit-20251217.1836/magit-base.el rename to elpa/magit-20260422.2206/magit-base.el index 90a35d80..eff5af0e 100644 --- a/elpa/magit-20251217.1836/magit-base.el +++ b/elpa/magit-20260422.2206/magit-base.el @@ -1,6 +1,6 @@ ;;; magit-base.el --- Early birds -*- lexical-binding:t; coding:utf-8 -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -43,15 +43,6 @@ (require 'llama) ; For (##these ...) see M-x describe-function RET # # RET. (require 'subr-x) -;; For older Emacs releases we depend on an updated `seq' release from -;; GNU ELPA, for `seq-keep'. Unfortunately something else may already -;; have required `seq', before `package' had a chance to put the more -;; recent version earlier on the `load-path'. -(when (and (featurep 'seq) - (not (fboundp 'seq-keep))) - (unload-feature 'seq 'force)) -(require 'seq) - (require 'crm) (require 'magit-section) @@ -494,7 +485,7 @@ and delay of your graphical environment or operating system." (defclass magit-hunk-section (magit-diff-section) ((keymap :initform 'magit-hunk-section-map) (painted :initform nil) - (fontified :initform nil) ;TODO + (fontified :initform nil) (refined :initform nil) (combined :initform nil :initarg :combined) (from-range :initform nil :initarg :from-range) @@ -504,6 +495,9 @@ and delay of your graphical environment or operating system." (heading-highlight-face :initform 'magit-diff-hunk-heading-highlight) (heading-selection-face :initform 'magit-diff-hunk-heading-selection))) +(defun magit--meta-hunk-p (section) + (not (cdr (oref section value)))) + (setf (alist-get 'file magit--section-type-alist) 'magit-file-section) (setf (alist-get 'module magit--section-type-alist) 'magit-module-section) (setf (alist-get 'hunk magit--section-type-alist) 'magit-hunk-section) @@ -824,13 +818,13 @@ ACTION is a member of option `magit-slow-confirm'." (or (cond ((and (not (eq action t)) (or (eq magit-no-confirm t) (memq action magit-no-confirm) - (cl-member-if (pcase-lambda (`(,key ,var . ,sub)) - (and (memq key magit-no-confirm) - (memq action sub) - (or (not var) - (and (boundp var) - (symbol-value var))))) - magit--no-confirm-alist))) + (magit--any (pcase-lambda (`(,key ,var . ,sub)) + (and (memq key magit-no-confirm) + (memq action sub) + (or (not var) + (and (boundp var) + (symbol-value var))))) + magit--no-confirm-alist))) (or (not sitems) items)) ((not sitems) (magit-y-or-n-p prompt action)) @@ -963,32 +957,32 @@ Pad the left side of STRING so that it aligns with the text area." (goto-char (point-min)) (while (search-forward "%" nil t) (cond - ;; Quoted percent sign. - ((eq (char-after) ?%) - (delete-char 1)) - ;; Valid format spec. - ((looking-at "\\([-0-9.]*\\)\\([a-zA-Z]\\)") - (let* ((num (match-str 1)) - (spec (string-to-char (match-str 2))) - (val (assq spec specification))) - (unless val - (error "Invalid format character: `%%%c'" spec)) - (setq val (cdr val)) - ;; Pad result to desired length. - (let ((text (format (concat "%" num "s") val))) - ;; Insert first, to preserve text properties. - (if (next-property-change 0 (concat " " text)) - ;; If the inserted text has properties, then preserve those. - (insert text) - ;; Otherwise preserve FORMAT's properties, like `format-spec'. - (insert-and-inherit text)) - ;; Delete the specifier body. - (delete-region (+ (match-beginning 0) (length text)) - (+ (match-end 0) (length text))) - ;; Delete the percent sign. - (delete-region (1- (match-beginning 0)) (match-beginning 0))))) - ;; Signal an error on bogus format strings. - ((error "Invalid format string")))) + ;; Quoted percent sign. + ((eq (char-after) ?%) + (delete-char 1)) + ;; Valid format spec. + ((looking-at "\\([-0-9.]*\\)\\([a-zA-Z]\\)") + (let* ((num (match-str 1)) + (spec (string-to-char (match-str 2))) + (val (assq spec specification))) + (unless val + (error "Invalid format character: `%%%c'" spec)) + (setq val (cdr val)) + ;; Pad result to desired length. + (let ((text (format (concat "%" num "s") val))) + ;; Insert first, to preserve text properties. + (if (next-property-change 0 (concat " " text)) + ;; If the inserted text has properties, then preserve those. + (insert text) + ;; Otherwise preserve FORMAT's properties, like `format-spec'. + (insert-and-inherit text)) + ;; Delete the specifier body. + (delete-region (+ (match-beginning 0) (length text)) + (+ (match-end 0) (length text))) + ;; Delete the percent sign. + (delete-region (1- (match-beginning 0)) (match-beginning 0))))) + ;; Signal an error on bogus format strings. + ((error "Invalid format string")))) (buffer-string))) ;;; Missing from Emacs @@ -1013,6 +1007,23 @@ This function should be named `version>' and be part of Emacs." This function should be named `version>=' and be part of Emacs." (version-list-<= (version-to-list v2) (version-to-list v1))) +(defun magit--delete-text-properties (string &optional props) + "Delete text properties PROPS from STRING and return it. +If PROPS is nil, remove all properties. To leave STRING unchanged +and return a new string, instead use `magit--remove-text-properties'." + (set-text-properties 0 (length string) props string) + string) + +(defun magit--remove-text-properties (string &optional props) + "Return a copy of STRING with text properties PROPS removed. +If PROPS is nil, remove all properties." + (magit--delete-text-properties (copy-sequence string) props)) + +;;; Emacs Compatibility + +(defalias 'magit--any ; Emacs 31.1 adds member-if + (static-if (fboundp 'member-if) #'member-if #'cl-member-if)) + ;;; Kludges for Emacs Bugs (defun magit-which-function () @@ -1024,6 +1035,20 @@ setting `imenu--index-alist' to nil before calling that function." (setq imenu--index-alist nil) (which-function)) +(static-if (version< emacs-version "31.1") + (define-advice dabbrev-capf (:around (fn) git-commit) + "Backport bugfix from debbug#80645 / a7d05207214 / 31.1. + See #5551, #5556 and #5558 (I wish I had not rushed this)." + (pcase-let ((`(,beg ,end ,table . ,rest) (funcall fn))) + `( ,beg ,end + ,(lambda (&rest args) + (condition-case err + (apply table args) + (user-error + (unless (string-prefix-p "No dynamic expansion" (cadr err)) + (signal (car err) (cdr err)))))) + ,@rest)))) + ;;; Kludges for Custom (defun magit-custom-initialize-reset (symbol exp) @@ -1187,6 +1212,16 @@ Like `message', except that `message-log-max' is bound to nil." (push char quoted)) (concat (nreverse quoted)))) +(defun magit--find-buffer (&rest plist) + "Like `find-buffer' but take multiple VARIABLE-VALUE pairs." + (seq-find (lambda (buf) + (while (and plist + (equal (buffer-local-value (car plist) buf) + (cadr plist))) + (setq plist (cddr plist))) + (not plist)) + (buffer-list))) + ;;; _ (provide 'magit-base) ;; Local Variables: @@ -1195,6 +1230,7 @@ Like `message', except that `message-log-max' is bound to nil." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-bisect.el b/elpa/magit-20260422.2206/magit-bisect.el similarity index 99% rename from elpa/magit-20251217.1836/magit-bisect.el rename to elpa/magit-20260422.2206/magit-bisect.el index 00e094ad..b1b56225 100644 --- a/elpa/magit-20251217.1836/magit-bisect.el +++ b/elpa/magit-20260422.2206/magit-bisect.el @@ -1,6 +1,6 @@ ;;; magit-bisect.el --- Bisect support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -321,6 +321,7 @@ bisect run'." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-blame.el b/elpa/magit-20260422.2206/magit-blame.el similarity index 99% rename from elpa/magit-20251217.1836/magit-blame.el rename to elpa/magit-20260422.2206/magit-blame.el index 078188c2..d037a7a6 100644 --- a/elpa/magit-20251217.1836/magit-blame.el +++ b/elpa/magit-20260422.2206/magit-blame.el @@ -1,6 +1,6 @@ ;;; magit-blame.el --- Blame support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -261,7 +261,7 @@ Also see option `magit-blame-styles'." (or (and (not (and type (not (eq type magit-blame-type)))) (magit-blame-chunk-at (point))) (and type - (let ((rev (or magit-buffer-refname magit-buffer-revision)) + (let ((rev magit-buffer-revision) (file (and (not (derived-mode-p 'dired-mode)) (magit-file-relative-name nil (not magit-buffer-file-name)))) @@ -418,8 +418,8 @@ modes is toggled, then this mode also gets toggled automatically. (magit-blame-mode 1)) (message "Blaming...") (magit-blame-run-process - (and$ (or magit-buffer-refname magit-buffer-revision) - (and (not (equal $ "{index}")) $)) + (and (not (equal magit-buffer-revision "{index}")) + magit-buffer-revision) (magit-file-relative-name nil (not magit-buffer-file-name)) (if (memq magit-blame-type '(final removal)) (cons "--reverse" args) @@ -1006,6 +1006,7 @@ instead of the hash, like `kill-ring-save' would." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-bookmark.el b/elpa/magit-20260422.2206/magit-bookmark.el similarity index 88% rename from elpa/magit-20251217.1836/magit-bookmark.el rename to elpa/magit-20260422.2206/magit-bookmark.el index 8ded15f7..416989da 100644 --- a/elpa/magit-20251217.1836/magit-bookmark.el +++ b/elpa/magit-20260422.2206/magit-bookmark.el @@ -1,6 +1,6 @@ ;;; magit-bookmark.el --- Bookmarks for Magit buffers -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Inspired by an earlier implementation by Yuri Khan. @@ -56,8 +56,8 @@ ;;;; Diff (put 'magit-diff-mode 'magit-bookmark-variables - '(magit-buffer-range-hashed - magit-buffer-typearg + '(magit-buffer-diff-range-oids + magit-buffer-diff-typearg magit-buffer-diff-args magit-buffer-diff-files)) @@ -66,9 +66,10 @@ (pcase (magit-diff-type) ('staged "staged") ('unstaged "unstaged") - ('committed magit-buffer-range) + ('committed magit-buffer-diff-range) ('undefined - (delq nil (list magit-buffer-typearg magit-buffer-range-hashed)))) + (delq nil + (list magit-buffer-diff-typearg magit-buffer-diff-range-oids)))) (if magit-buffer-diff-files (concat " -- " (string-join magit-buffer-diff-files " ")) ""))) @@ -76,7 +77,7 @@ ;;;; Revision (put 'magit-revision-mode 'magit-bookmark-variables - '(magit-buffer-revision-hash + '(magit-buffer-revision-oid magit-buffer-diff-args magit-buffer-diff-files)) @@ -90,7 +91,7 @@ ;;;; Stash (put 'magit-stash-mode 'magit-bookmark-variables - '(magit-buffer-revision-hash + '(magit-buffer-revision-oid magit-buffer-diff-args magit-buffer-diff-files)) @@ -104,20 +105,20 @@ (cl-defmethod magit-bookmark--get-child-value (section &context (major-mode magit-stash-mode)) (string-replace magit-buffer-revision - magit-buffer-revision-hash + magit-buffer-revision-oid (oref section value))) ;;; Log ;;;; Log (put 'magit-log-mode 'magit-bookmark-variables - '(magit-buffer-revisions + '(magit-buffer-log-revisions magit-buffer-log-args magit-buffer-log-files)) (cl-defmethod magit-bookmark-name (&context (major-mode magit-log-mode)) (format "magit-log(%s%s)" - (string-join magit-buffer-revisions " ") + (string-join magit-buffer-log-revisions " ") (if magit-buffer-log-files (concat " -- " (string-join magit-buffer-log-files " ")) ""))) @@ -126,12 +127,12 @@ (put 'magit-cherry-mode 'magit-bookmark-variables '(magit-buffer-refname - magit-buffer-upstream)) + magit-buffer-cherry-upstream)) (cl-defmethod magit-bookmark-name (&context (major-mode magit-cherry-mode)) (format "magit-cherry(%s > %s)" magit-buffer-refname - magit-buffer-upstream)) + magit-buffer-cherry-upstream)) ;;;; Reflog @@ -146,8 +147,8 @@ (put 'magit-status-mode 'magit-bookmark-variables nil) (put 'magit-refs-mode 'magit-bookmark-variables - '(magit-buffer-upstream - magit-buffer-arguments)) + '(magit-buffer-refs-upstream + magit-buffer-refs-args)) (put 'magit-stashes-mode 'magit-bookmark-variables nil) @@ -162,6 +163,7 @@ ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-branch.el b/elpa/magit-20260422.2206/magit-branch.el similarity index 77% rename from elpa/magit-20251217.1836/magit-branch.el rename to elpa/magit-20260422.2206/magit-branch.el index d7c29805..603576b1 100644 --- a/elpa/magit-20251217.1836/magit-branch.el +++ b/elpa/magit-20260422.2206/magit-branch.el @@ -1,6 +1,6 @@ ;;; magit-branch.el --- Branch support -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -153,11 +153,11 @@ to set `magit-branch-prefer-remote-upstream' to a non-nil value. However, I recommend that you use local branches as UPSTREAM." :package-version '(magit . "2.9.0") :group 'magit-commands - :type '(repeat (cons (string :tag "Use upstream") - (choice :tag "For branches" ;??? - (regexp :tag "Matching") - (repeat :tag "Except" - (string :tag "Branch")))))) + :type '(alist :key-type (string :tag "Use upstream") + :value-type (choice :tag "For branches" ;??? + (regexp :tag "Matching") + (repeat :tag "Except" + (string :tag "Branch"))))) (defcustom magit-branch-rename-push-target t "Whether the push-remote setup is preserved when renaming a branch. @@ -314,10 +314,10 @@ branch. This is similar to what `magit-branch-and-checkout' does." (declare (interactive-only magit-call-git)) (interactive - (let ((arg (magit-read-other-branch-or-commit "Checkout"))) - (list arg - (and (not (magit-commit-p arg)) - (magit-read-starting-point "Create and checkout branch" arg))))) + (let ((arg (magit-read-other-branch-or-commit "Checkout"))) + (list arg + (and (not (magit-commit-p arg)) + (magit-read-starting-point "Create and checkout branch" arg))))) (when (string-match "\\`heads/\\(.+\\)" arg) (setq arg (match-str 1 arg))) (if start-point @@ -352,50 +352,50 @@ value of `magit-branch-adjust-remote-upstream-alist', just like when using `magit-branch-and-checkout'." (declare (interactive-only magit-call-git)) (interactive - (let* ((current (magit-get-current-branch)) - (local (magit-list-local-branch-names)) - (remote (seq-filter (##and (string-match "[^/]+/" %) - (not (member (substring % (match-end 0)) - (cons "HEAD" local)))) - (magit-list-remote-branch-names))) - (choices (nconc (delete current local) remote)) - (atpoint (magit-branch-at-point)) - (choice (magit-completing-read - "Checkout branch" choices - nil nil nil 'magit-revision-history - (or (car (member atpoint choices)) - (and atpoint - (car (member (and (string-match "[^/]+/" atpoint) - (substring atpoint (match-end 0))) - choices))))))) - (cond ((member choice remote) - (list (and (string-match "[^/]+/" choice) - (substring choice (match-end 0))) - choice)) - ((member choice local) - (list choice)) - ((list choice (magit-read-starting-point "Create" choice)))))) + (let* ((current (magit-get-current-branch)) + (local (magit-list-local-branch-names)) + (remote (seq-filter (##and (string-match "[^/]+/" %) + (not (member (substring % (match-end 0)) + (cons "HEAD" local)))) + (magit-list-remote-branch-names))) + (choices (nconc (delete current local) remote)) + (atpoint (magit-branch-at-point)) + (choice (magit-completing-read + "Checkout branch" choices + nil nil nil 'magit-revision-history + (or (car (member atpoint choices)) + (and atpoint + (car (member (and (string-match "[^/]+/" atpoint) + (substring atpoint (match-end 0))) + choices))))))) + (cond ((member choice remote) + (list (and (string-match "[^/]+/" choice) + (substring choice (match-end 0))) + choice)) + ((member choice local) + (list choice)) + ((list choice (magit-read-starting-point "Create" choice)))))) (cond - ((not start-point) - (magit--checkout branch (magit-branch-arguments)) - (magit-refresh)) - (t - (when (magit-anything-modified-p t) - (user-error "Cannot checkout when there are uncommitted changes")) - (magit-run-git-async "checkout" (magit-branch-arguments) - "-b" branch start-point) - (set-process-sentinel - magit-this-process - (lambda (process event) - (when (memq (process-status process) '(exit signal)) - (magit-branch-maybe-adjust-upstream branch start-point) - (when (magit-remote-branch-p start-point) - (pcase-let ((`(,remote . ,remote-branch) - (magit-split-branch-name start-point))) - (when (and (equal branch remote-branch) - (not (equal remote (magit-get "remote.pushDefault")))) - (magit-set remote "branch" branch "pushRemote")))) - (magit-process-sentinel process event))))))) + ((not start-point) + (magit--checkout branch (magit-branch-arguments)) + (magit-refresh)) + (t + (when (magit-anything-modified-p t) + (user-error "Cannot checkout when there are uncommitted changes")) + (magit-run-git-async "checkout" (magit-branch-arguments) + "-b" branch start-point) + (set-process-sentinel + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (magit-branch-maybe-adjust-upstream branch start-point) + (when (magit-remote-branch-p start-point) + (pcase-let ((`(,remote . ,remote-branch) + (magit-split-branch-name start-point))) + (when (and (equal branch remote-branch) + (not (equal remote (magit-get "remote.pushDefault")))) + (magit-set remote "branch" branch "pushRemote")))) + (magit-process-sentinel process event))))))) (defun magit-branch-maybe-adjust-upstream (branch start-point) (when-let ((upstream @@ -423,20 +423,20 @@ when using `magit-branch-and-checkout'." (if magit-branch-read-upstream-first (let ((choice (magit-read-starting-point prompt nil default-start))) (cond - ((magit-rev-verify choice) - (list (magit-read-string-ns - (if magit-completing-read--silent-default - (format "%s (starting at `%s')" prompt choice) - "Name for new branch") - (let ((def (string-join (cdr (split-string choice "/")) "/"))) - (and (member choice (magit-list-remote-branch-names)) - (not (member def (magit-list-local-branch-names))) - def))) - choice)) - ((eq magit-branch-read-upstream-first 'fallback) - (list choice - (magit-read-starting-point prompt choice default-start))) - ((user-error "Not a valid starting-point: %s" choice)))) + ((magit-rev-verify choice) + (list (magit-read-string-ns + (if magit-completing-read--silent-default + (format "%s (starting at `%s')" prompt choice) + "Name for new branch") + (let ((def (string-join (cdr (split-string choice "/")) "/"))) + (and (member choice (magit-list-remote-branch-names)) + (not (member def (magit-list-local-branch-names))) + def))) + choice)) + ((eq magit-branch-read-upstream-first 'fallback) + (list choice + (magit-read-starting-point prompt choice default-start))) + ((user-error "Not a valid starting-point: %s" choice)))) (let ((branch (magit-read-string-ns (concat prompt " named")))) (if (magit-branch-p branch) (magit-branch-read-args @@ -511,8 +511,8 @@ from the source branch's upstream, then an error is raised." (if checkout (magit-call-git "checkout" "-b" branch current) (magit-call-git "branch" branch current))) - (when-let ((upstream (magit-get-indirect-upstream-branch current))) - (magit-call-git "branch" "--set-upstream-to" upstream branch)) + (when$ (magit-get-indirect-upstream-branch current) + (magit-call-git "branch" "--set-upstream-to" $ branch)) (when (and tracked (setq base (if from @@ -544,13 +544,13 @@ When resetting to another branch and a prefix argument is used, then also set the target branch as the upstream of the branch that is being reset." (interactive - (let ((branch (magit-read-local-branch "Reset branch" - (magit-local-branch-at-point)))) - (list branch - (magit-read-branch-or-commit (format "Reset %s to" branch) - (magit-get-upstream-branch branch) - branch) - current-prefix-arg))) + (let ((branch (magit-read-local-branch "Reset branch" + (magit-local-branch-at-point)))) + (list branch + (magit-read-branch-or-commit (format "Reset %s to" branch) + (magit-get-upstream-branch branch) + branch) + current-prefix-arg))) (let ((magit-inhibit-refresh t)) (if (equal branch (magit-get-current-branch)) (if (and (magit-anything-modified-p) @@ -560,8 +560,7 @@ that is being reset." (magit-reset-hard to)) (magit-call-git "update-ref" "-m" (format "reset: moving to %s" to) - (magit-git-string "rev-parse" "--symbolic-full-name" - branch) + (magit-ref-fullname branch) to)) (when (and set-upstream (magit-branch-p to)) (magit-set-upstream-branch branch to) @@ -588,24 +587,24 @@ prompt is confusing." ;; `magit-branch-rename'; but it turns out everyone wants to squeeze ;; a bit of extra functionality into this one, including myself. (interactive - (let ((branches (magit-region-values 'branch t)) - (force current-prefix-arg)) - (if (length> branches 1) - (magit-confirm t nil "Delete %d branches" nil branches) - (setq branches - (list (magit-read-branch-prefer-other - (if force "Force delete branch" "Delete branch"))))) - (cond-let - (force) - [[unmerged (seq-remove #'magit-branch-merged-p branches)]] - ((magit-confirm 'delete-unmerged-branch - "Delete unmerged branch %s" - "Delete %d unmerged branches" - 'noabort unmerged) - (setq force branches)) - ((setq branches (cl-set-difference branches unmerged :test #'equal))) - ((user-error "Abort"))) - (list branches force))) + (let ((branches (magit-region-values 'branch t)) + (force current-prefix-arg)) + (if (length> branches 1) + (magit-confirm t nil "Delete %d branches" nil branches) + (setq branches + (list (magit-read-branch-prefer-other + (if force "Force delete branch" "Delete branch"))))) + (cond-let + (force) + [[unmerged (seq-remove #'magit-branch-merged-p branches)]] + ((magit-confirm 'delete-unmerged-branch + "Delete unmerged branch %s" + "Delete %d unmerged branches" + 'noabort unmerged) + (setq force branches)) + ((setq branches (cl-set-difference branches unmerged :test #'equal))) + ((user-error "Abort"))) + (list branches force))) (let ((refs (mapcar #'magit-ref-fullname branches))) ;; If a member of refs is nil, that means that ;; the respective branch name is ambiguous. @@ -614,86 +613,86 @@ prompt is confusing." "%s ambiguous; please cleanup using git directly" (let ((len (length ambiguous))) (cond - ((= len 1) - (format "%s is" (seq-find #'magit-ref-ambiguous-p branches))) - ((= len (length refs)) - (format "These %s names are" len)) - ((format "%s of these names are" len)))))) + ((= len 1) + (format "%s is" (seq-find #'magit-ref-ambiguous-p branches))) + ((= len (length refs)) + (format "These %s names are" len)) + ((format "%s of these names are" len)))))) (cond - ((string-match "^refs/remotes/\\([^/]+\\)" (car refs)) - (let* ((remote (match-str 1 (car refs))) - (offset (1+ (length remote)))) - (cond - ((magit-confirm 'delete-branch-on-remote - (list "Deleting local %s. Also delete on %s" - (magit-ref-fullname (car branches)) - remote) - (list "Deleting %d local refs. Also delete on %s" - (length refs) - remote) - 'noabort refs) - ;; The ref may actually point at another rev on the remote, - ;; but this is better than nothing. - (dolist (ref refs) - (message "Delete %s (was %s)" ref - (magit-rev-parse "--short" ref))) - ;; Assume the branches actually still exist on the remote. - (magit-run-git-async - "push" - (and (or force magit-branch-delete-never-verify) "--no-verify") - remote - (mapcar (##concat ":" (substring % offset)) branches)) - ;; If that is not the case, then this deletes the tracking branches. - (set-process-sentinel - magit-this-process - (apply-partially #'magit-delete-remote-branch-sentinel remote refs))) - (t - (dolist (ref refs) - (message "Delete %s (was %s)" ref - (magit-rev-parse "--short" ref)) - (magit-call-git "update-ref" "-d" ref)) - (magit-refresh))))) - ((length> branches 1) - (setq branches (delete (magit-get-current-branch) branches)) - (mapc #'magit-branch-maybe-delete-pr-remote branches) - (mapc #'magit-branch-unset-pushRemote branches) - (magit-run-git "branch" (if force "-D" "-d") branches)) - (t ; And now for something completely different. - (let* ((branch (car branches)) - (prompt (format "Branch %s is checked out. " branch)) - (target (magit-get-indirect-upstream-branch branch t))) - (when (equal branch (magit-get-current-branch)) - (when (or (equal branch target) - (not target)) - (setq target (magit-main-branch))) - (pcase (if (or (equal branch target) - (not target)) - (magit-read-char-case prompt nil - (?d "[d]etach HEAD & delete" 'detach) - (?a "[a]bort" 'abort)) - (magit-read-char-case prompt nil - (?d "[d]etach HEAD & delete" 'detach) - (?c (format "[c]heckout %s & delete" target) 'target) - (?a "[a]bort" 'abort))) - (`detach (unless (or (equal force '(4)) - (member branch force) - (magit-branch-merged-p branch t)) - (magit-confirm 'delete-unmerged-branch - "Delete unmerged branch %s" "" - nil (list branch))) - (magit-call-git "checkout" "--detach")) - (`target (unless (or (equal force '(4)) - (member branch force) - (magit-branch-merged-p branch target)) - (magit-confirm 'delete-unmerged-branch - "Delete unmerged branch %s" "" - nil (list branch))) - (magit-call-git "checkout" target)) - (`abort (user-error "Abort"))) - (setq force t)) - (magit-branch-maybe-delete-pr-remote branch) - (magit-branch-unset-pushRemote branch) - (magit-run-git "branch" (if force "-D" "-d") branch)))))) + ((string-match "^refs/remotes/\\([^/]+\\)" (car refs)) + (let* ((remote (match-str 1 (car refs))) + (offset (1+ (length remote)))) + (cond + ((magit-confirm 'delete-branch-on-remote + (list "Deleting local %s. Also delete on %s" + (magit-ref-fullname (car branches)) + remote) + (list "Deleting %d local refs. Also delete on %s" + (length refs) + remote) + 'noabort refs) + ;; The ref may actually point at another rev on the remote, + ;; but this is better than nothing. + (dolist (ref refs) + (message "Delete %s (was %s)" ref + (magit-rev-parse "--short" ref))) + ;; Assume the branches actually still exist on the remote. + (magit-run-git-async + "push" "--delete" + (and (or force magit-branch-delete-never-verify) "--no-verify") + remote + (mapcar (##concat "refs/heads/" (substring % offset)) branches)) + ;; If that is not the case, then this deletes the tracking branches. + (set-process-sentinel + magit-this-process + (apply-partially #'magit-delete-remote-branch-sentinel remote refs))) + (t + (dolist (ref refs) + (message "Delete %s (was %s)" ref + (magit-rev-parse "--short" ref)) + (magit-call-git "update-ref" "-d" ref)) + (magit-refresh))))) + ((length> branches 1) + (setq branches (delete (magit-get-current-branch) branches)) + (mapc #'magit-branch-maybe-delete-pr-remote branches) + (mapc #'magit-branch-unset-pushRemote branches) + (magit-run-git "branch" (if force "-D" "-d") branches)) + (t ; And now for something completely different. + (let* ((branch (car branches)) + (prompt (format "Branch %s is checked out. " branch)) + (target (magit-get-indirect-upstream-branch branch t))) + (when (equal branch (magit-get-current-branch)) + (when (or (equal branch target) + (not target)) + (setq target (magit-main-branch))) + (pcase (if (or (equal branch target) + (not target)) + (magit-read-char-case prompt nil + (?d "[d]etach HEAD & delete" 'detach) + (?a "[a]bort" 'abort)) + (magit-read-char-case prompt nil + (?d "[d]etach HEAD & delete" 'detach) + (?c (format "[c]heckout %s & delete" target) 'target) + (?a "[a]bort" 'abort))) + (`detach (unless (or (equal force '(4)) + (member branch force) + (magit-branch-merged-p branch t)) + (magit-confirm 'delete-unmerged-branch + "Delete unmerged branch %s" "" + nil (list branch))) + (magit-call-git "checkout" "--detach")) + (`target (unless (or (equal force '(4)) + (member branch force) + (magit-branch-merged-p branch target)) + (magit-confirm 'delete-unmerged-branch + "Delete unmerged branch %s" "" + nil (list branch))) + (magit-call-git "checkout" target)) + (`abort (user-error "Abort"))) + (setq force t)) + (magit-branch-maybe-delete-pr-remote branch) + (magit-branch-unset-pushRemote branch) + (magit-run-git "branch" (if force "-D" "-d") branch)))))) (put 'magit-branch-delete 'interactive-only t) @@ -758,11 +757,11 @@ the value of `magit-branch-rename-push-target' (which see) maybe set `branch.NEW.pushRemote' and maybe rename the push-target on the remote." (interactive - (let ((branch (magit-read-local-branch "Rename branch"))) - (list branch - (magit-read-string-ns (format "Rename branch '%s' to" branch) - nil 'magit-revision-history) - current-prefix-arg))) + (let ((branch (magit-read-local-branch "Rename branch"))) + (list branch + (magit-read-string-ns (format "Rename branch '%s' to" branch) + nil 'magit-revision-history) + current-prefix-arg))) (when (string-match "\\`heads/\\(.+\\)" old) (setq old (match-str 1 old))) (when (equal old new) @@ -868,11 +867,11 @@ Also rename the respective reflog file." ("a m" magit-branch.autoSetupMerge) ("a r" magit-branch.autoSetupRebase)] (interactive - (list (or (and (not current-prefix-arg) - (not (and magit-branch-direct-configure - (eq transient-current-command 'magit-branch))) - (magit-get-current-branch)) - (magit--read-branch-scope)))) + (list (or (and (not current-prefix-arg) + (not (and magit-branch-direct-configure + (eq transient-current-command 'magit-branch))) + (magit-get-current-branch)) + (magit--read-branch-scope)))) (transient-setup 'magit-branch-configure nil nil :scope branch)) (defun magit--read-branch-scope (&optional obj) @@ -891,7 +890,8 @@ Also rename the respective reflog file." (magit-run-git-with-editor "branch" "--edit-description" branch)) (defclass magit--git-branch:upstream (magit--git-variable) - ((format :initform " %k %m %M\n %r %R"))) + ((format :initform " %k %m %M\n %r %R") + (accessible-format :initform "%k %m is %M and %r is %R"))) (transient-define-infix magit-branch..merge/remote () :class 'magit--git-branch:upstream) @@ -919,7 +919,7 @@ Also rename the respective reflog file." (cl-defmethod transient-format ((obj magit--git-branch:upstream)) (let ((branch (transient-scope))) (format-spec - (oref obj format) + (transient--get-format obj) `((?k . ,(transient-format-key obj)) (?r . ,(format "branch.%s.remote" branch)) (?m . ,(format "branch.%s.merge" branch)) @@ -977,6 +977,7 @@ Also rename the respective reflog file." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-bundle.el b/elpa/magit-20260422.2206/magit-bundle.el similarity index 80% rename from elpa/magit-20251217.1836/magit-bundle.el rename to elpa/magit-20260422.2206/magit-bundle.el index 9ff8c711..f808593c 100644 --- a/elpa/magit-20251217.1836/magit-bundle.el +++ b/elpa/magit-20260422.2206/magit-bundle.el @@ -1,6 +1,6 @@ ;;; magit-bundle.el --- Bundle support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -61,14 +61,14 @@ ("t" "create tracked bundle" magit-bundle-create-tracked) ("u" "update tracked bundle" magit-bundle-update-tracked)] (interactive - (and (eq transient-current-command 'magit-bundle-create) - (list (read-file-name "Create bundle: " nil nil nil - (concat (file-name-nondirectory - (directory-file-name (magit-toplevel))) - ".bundle")) - (magit-completing-read-multiple "Refnames (zero or more): " - (magit-list-refnames)) - (transient-args 'magit-bundle-create)))) + (and (eq transient-current-command 'magit-bundle-create) + (list (read-file-name "Create bundle: " nil nil nil + (concat (file-name-nondirectory + (directory-file-name (magit-toplevel))) + ".bundle")) + (magit-completing-read-multiple "Refnames (zero or more): " + (magit-list-refnames)) + (transient-args 'magit-bundle-create)))) (if file (magit-git-bundle "create" file refs args) (transient-setup 'magit-bundle-create))) @@ -77,17 +77,17 @@ (defun magit-bundle-create-tracked (file tag branch refs args) "Create and track a new bundle." (interactive - (let ((tag (magit-read-tag "Track bundle using tag")) - (branch (magit-read-branch "Bundle branch")) - (refs (magit-completing-read-multiple - "Additional refnames (zero or more): " - (magit-list-refnames)))) - (list (read-file-name "File: " nil nil nil (concat tag ".bundle")) - tag branch - (if (equal branch (magit-get-current-branch)) - (cons "HEAD" refs) - refs) - (transient-args 'magit-bundle-create)))) + (let ((tag (magit-read-tag "Track bundle using tag")) + (branch (magit-read-branch "Bundle branch")) + (refs (magit-completing-read-multiple + "Additional refnames (zero or more): " + (magit-list-refnames)))) + (list (read-file-name "File: " nil nil nil (concat tag ".bundle")) + tag branch + (if (equal branch (magit-get-current-branch)) + (cons "HEAD" refs) + refs) + (transient-args 'magit-bundle-create)))) (magit-git-bundle "create" file (cons branch refs) args) (magit-git "tag" "--force" tag branch "-m" (concat ";; git-bundle tracking\n" @@ -142,6 +142,7 @@ ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-clone.el b/elpa/magit-20260422.2206/magit-clone.el similarity index 97% rename from elpa/magit-20251217.1836/magit-clone.el rename to elpa/magit-20260422.2206/magit-clone.el index 83e9db2e..c25e1ccc 100644 --- a/elpa/magit-20251217.1836/magit-clone.el +++ b/elpa/magit-20260422.2206/magit-clone.el @@ -1,6 +1,6 @@ ;;; magit-clone.el --- Clone a repository -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -337,12 +337,12 @@ Then show the status buffer for the new repository." url-format `((?h . ,host) (?n . ,(cond - ((string-search "/" repo) repo) - ((string-search "." user) - (if-let ((user (magit-get user))) - (concat user "/" repo) - (user-error "Set %S or specify owner explicitly" user))) - ((concat user "/" repo)))))) + ((string-search "/" repo) repo) + ((string-search "." user) + (if-let ((user (magit-get user))) + (concat user "/" repo) + (user-error "Set %S or specify owner explicitly" user))) + ((concat user "/" repo)))))) (user-error "Bogus `magit-clone-url-format' (bad type or missing default)"))) @@ -354,6 +354,7 @@ Then show the status buffer for the new repository." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-commit.el b/elpa/magit-20260422.2206/magit-commit.el similarity index 86% rename from elpa/magit-20251217.1836/magit-commit.el rename to elpa/magit-20260422.2206/magit-commit.el index 53e845d7..912127b4 100644 --- a/elpa/magit-20251217.1836/magit-commit.el +++ b/elpa/magit-20260422.2206/magit-commit.el @@ -1,6 +1,6 @@ ;;; magit-commit.el --- Create Git commits -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -144,6 +144,7 @@ This hook is still experimental.") "Create a new commit or replace an existing commit." :info-manual "(magit)Initiating a Commit" :man-page "git-commit" + :value '("--verbose") ["Arguments" ("-a" "Stage all modified and deleted files" ("-a" "--all")) ("-e" "Allow empty commit" "--allow-empty") @@ -457,49 +458,49 @@ Like `magit-commit-squash' but also run a `--autofixup' rebase." (defun magit-commit-assert (args &optional nopatch strict) (cond - (nopatch (or args (list "--"))) - ((or (magit-anything-staged-p) - (and (magit-anything-unstaged-p) - ;; ^ Everything of nothing is still nothing. - (member "--all" args)) - (and (not strict) - ;; ^ For amend variants that don't make sense otherwise. - (or (member "--amend" args) - (member "--allow-empty" args) - (member "--reset-author" args) - (member "--signoff" args) - (transient-arg-value "--author=" args) - (transient-arg-value "--date=" args)))) - (or args (list "--"))) - ((and (magit-rebase-in-progress-p) - (not (magit-anything-unstaged-p)) - (y-or-n-p "Nothing staged. Continue in-progress rebase? ")) - (setq this-command #'magit-rebase-continue) - (magit-run-git-sequencer "rebase" "--continue") - nil) - ((file-exists-p (expand-file-name "MERGE_MSG" (magit-gitdir))) - (cond ((magit-anything-unmerged-p) - (user-error "Unresolved conflicts")) - ((and (magit-anything-unstaged-p) - (not (y-or-n-p - "Proceed with merge despite unstaged changes? "))) - (user-error "Abort")) - ((or args (list "--"))))) - ((not (magit-anything-unstaged-p)) - (user-error "Nothing staged (or unstaged)")) - (magit-commit-ask-to-stage - (when (eq magit-commit-ask-to-stage 'verbose) - (apply #'magit-diff-unstaged (magit-diff-arguments))) - (prog1 (when (or (eq magit-commit-ask-to-stage 'stage) - (y-or-n-p - "Nothing staged. Commit all uncommitted changes? ")) - (setq this-command 'magit-commit--all) - (cons "--all" (or args (list "--")))) - (when (and (eq magit-commit-ask-to-stage 'verbose) - (derived-mode-p 'magit-diff-mode)) - (magit-mode-bury-buffer)))) - (t - (user-error "Nothing staged")))) + (nopatch (or args (list "--"))) + ((or (magit-anything-staged-p) + (and (magit-anything-unstaged-p) + ;; ^ Everything of nothing is still nothing. + (member "--all" args)) + (and (not strict) + ;; ^ For amend variants that don't make sense otherwise. + (or (member "--amend" args) + (member "--allow-empty" args) + (member "--reset-author" args) + (member "--signoff" args) + (transient-arg-value "--author=" args) + (transient-arg-value "--date=" args)))) + (or args (list "--"))) + ((and (magit-rebase-in-progress-p) + (not (magit-anything-unstaged-p)) + (y-or-n-p "Nothing staged. Continue in-progress rebase? ")) + (setq this-command #'magit-rebase-continue) + (magit-run-git-sequencer "rebase" "--continue") + nil) + ((file-exists-p (expand-file-name "MERGE_MSG" (magit-gitdir))) + (cond ((magit-anything-unmerged-p) + (user-error "Unresolved conflicts")) + ((and (magit-anything-unstaged-p) + (not (y-or-n-p + "Proceed with merge despite unstaged changes? "))) + (user-error "Abort")) + ((or args (list "--"))))) + ((not (magit-anything-unstaged-p)) + (user-error "Nothing staged (or unstaged)")) + (magit-commit-ask-to-stage + (when (eq magit-commit-ask-to-stage 'verbose) + (apply #'magit-diff-unstaged (magit-diff-arguments))) + (prog1 (when (or (eq magit-commit-ask-to-stage 'stage) + (y-or-n-p + "Nothing staged. Commit all uncommitted changes? ")) + (setq this-command 'magit-commit--all) + (cons "--all" (or args (list "--")))) + (when (and (eq magit-commit-ask-to-stage 'verbose) + (derived-mode-p 'magit-diff-mode)) + (magit-mode-bury-buffer)))) + (t + (user-error "Nothing staged")))) ;;;; Reshelve @@ -520,18 +521,18 @@ is updated: - The command was invoked with a prefix argument. - Non-interactively if UPDATE-AUTHOR is nil." (interactive - (let ((update-author (and (magit-rev-author-p "HEAD") - (not current-prefix-arg)))) - (push (magit-rev-format (if update-author "%ad" "%cd") "HEAD" - (concat "--date=format:%F %T %z")) - magit--reshelve-history) - (list (read-string (if update-author - "Change author and committer dates to: " - "Change committer date to: ") - (cons (format-time-string "%F %T %z") 17) - 'magit--reshelve-history) - update-author - (magit-commit-arguments)))) + (let ((update-author (and (magit-rev-author-p "HEAD") + (not current-prefix-arg)))) + (push (magit-rev-format (if update-author "%ad" "%cd") "HEAD" + (concat "--date=format:%F %T %z")) + magit--reshelve-history) + (list (read-string (if update-author + "Change author and committer dates to: " + "Change committer date to: ") + (cons (format-time-string "%F %T %z") 17) + 'magit--reshelve-history) + update-author + (magit-commit-arguments)))) (with-environment-variables (("GIT_COMMITTER_DATE" date)) (magit-run-git "commit" "--amend" "--no-edit" (and update-author (concat "--date=" date)) @@ -548,20 +549,19 @@ is updated: (user-error "There are no modified modules that could be absorbed")) (when commit (setq commit (magit-rebase-interactive-assert commit t))) - (if (and commit (eq phase 'run)) - (progn - (dolist (module modules) - (when-let ((msg (magit-git-string - "log" "-1" "--format=%s" - (concat commit "..") "--" module))) - (magit-git "commit" "-m" (concat "fixup! " msg) - "--only" "--" module))) - (magit-refresh) - t) - (magit-log-select - (lambda (commit) - (magit-commit-absorb-modules 'run commit)) - nil nil nil nil commit)))) + (cond ((and commit (eq phase 'run)) + (dolist (module modules) + (when-let ((msg (magit-git-string + "log" "-1" "--format=%s" + (concat commit "..") "--" module))) + (magit-git "commit" "-m" (concat "fixup! " msg) + "--only" "--" module))) + (magit-refresh) + t) + ((magit-log-select + (lambda (commit) + (magit-commit-absorb-modules 'run commit)) + nil nil nil nil commit))))) ;;;###autoload(autoload 'magit-commit-absorb "magit-commit" nil t) (transient-define-prefix magit-commit-absorb (phase commit args) @@ -669,18 +669,25 @@ an alternative implementation." 'magit-commit--rebase last-command)) (when (and git-commit-mode magit-commit-show-diff) - (when-let ((diff-buffer (magit-get-mode-buffer 'magit-diff-mode))) - ;; This window just started displaying the commit message - ;; buffer. Without this that buffer would immediately be - ;; replaced with the diff buffer. See #2632. + (when-let ((diff-buffer + ;; This signals an error if not inside a Git repository, + ;; but the user may be visiting COMMIT_EDITMSG using a + ;; tool other than git, which can be used outside a Git + ;; repository. See #5527. + (ignore-error magit-outside-git-repo + (magit-get-mode-buffer 'magit-diff-mode)))) + ;; This window just started displaying the commit message buffer. + ;; Without unrecording that buffer would immediately be replaced + ;; with the diff buffer. See #2632. (unrecord-window-buffer nil diff-buffer)) (message "Diffing changes to be committed (C-g to abort diffing)") (let ((inhibit-quit nil)) (condition-case nil - (magit-commit-diff-1) + (with-demoted-errors "Error showing commit diff: %S" + (magit-commit-diff--show)) (quit))))) -(defun magit-commit-diff-1 () +(defun magit-commit-diff--args () (let ((rev nil) (arg "--cached") (command (magit-repository-local-get 'this-commit-command)) @@ -695,6 +702,9 @@ an alternative implementation." (and (file-exists-p f) (length (magit-file-lines f))))) (noalt nil)) (pcase (list staged unstaged command) + ((guard (not (magit-commit-p "HEAD^"))) + (setq rev "HEAD") + (setq arg nil)) ((and `(,_ ,_ magit-commit--rebase) (guard (integerp squash))) (setq rev (format "HEAD~%s" squash))) @@ -715,21 +725,24 @@ an alternative implementation." (setq rev "HEAD") (setq arg nil))) (cond - ((not - (and (eq this-command 'magit-diff-while-committing) - (and-let ((buf (magit-get-mode-buffer - 'magit-diff-mode nil 'selected))) - (and (equal rev (buffer-local-value 'magit-buffer-range buf)) - (equal arg (buffer-local-value 'magit-buffer-typearg buf))))))) - ((eq command 'magit-commit-amend) - (setq rev nil)) - ((or squash - (file-exists-p (expand-file-name "rebase-merge/amend" (magit-gitdir)))) - (setq rev "HEAD^")) - (t - (message "No alternative diff while committing") - (setq noalt t))) - (unless noalt + ((not + (and-let* + ((_(eq this-command 'magit-diff-while-committing)) + (buf (magit-get-mode-buffer 'magit-diff-mode nil 'selected)) + (_(equal rev (buffer-local-value 'magit-buffer-diff-range buf))) + (_(equal arg (buffer-local-value 'magit-buffer-diff-typearg buf))))))) + ((eq command 'magit-commit-amend) + (setq rev nil)) + ((or squash + (file-exists-p (expand-file-name "rebase-merge/amend" (magit-gitdir)))) + (setq rev "HEAD^")) + ((setq noalt t))) + (list rev arg noalt))) + +(defun magit-commit-diff--show () + (pcase-let ((`(,rev ,arg ,noalt) (magit-commit-diff--args))) + (if noalt + (message "No alternative diff while committing") (let ((magit-inhibit-save-previous-winconf 'unset) (magit-display-buffer-noselect t) (display-buffer-overriding-action @@ -858,6 +871,7 @@ Also see `git-commit-post-finish-hook'." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-core.el b/elpa/magit-20260422.2206/magit-core.el similarity index 97% rename from elpa/magit-20251217.1836/magit-core.el rename to elpa/magit-20260422.2206/magit-core.el index 0ea2385c..c0831616 100644 --- a/elpa/magit-20251217.1836/magit-core.el +++ b/elpa/magit-20260422.2206/magit-core.el @@ -1,6 +1,6 @@ ;;; magit-core.el --- Core functionality -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -126,6 +126,7 @@ Each of these options falls into one or more of these categories: ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-diff.el b/elpa/magit-20260422.2206/magit-diff.el similarity index 77% rename from elpa/magit-20251217.1836/magit-diff.el rename to elpa/magit-20260422.2206/magit-diff.el index 3b6ff333..6caeeec6 100644 --- a/elpa/magit-20251217.1836/magit-diff.el +++ b/elpa/magit-20260422.2206/magit-diff.el @@ -1,6 +1,6 @@ ;;; magit-diff.el --- Inspect Git diffs -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -34,18 +34,20 @@ (require 'diff-mode) (require 'image) (require 'smerge-mode) +(require 'which-func) ;; For `magit-diff--get-value' (defvar magit-status-use-buffer-arguments) ;; For `magit-diff-popup' (declare-function magit-stash-show "magit-stash" (stash &optional args files)) ;; For `magit-diff-visit-file' -(declare-function magit-find-file-noselect "magit-files" (rev file &optional revert)) +(declare-function magit-find-file-noselect "magit-files" + (rev file &optional no-restore-position volatile)) (declare-function magit-status-setup-buffer "magit-status" (&optional directory)) ;; For `magit-diff-wash-diff' (defvar magit-log-heading-re) ;; For `magit-diff-while-committing' -(declare-function magit-commit-diff-1 "magit-commit" ()) +(declare-function magit-commit-diff--show "magit-commit" ()) (declare-function magit-commit-message-buffer "magit-commit" ()) ;; For `magit-insert-revision-gravatar' (defvar gravatar-size) @@ -53,6 +55,9 @@ (declare-function magit-current-blame-chunk "magit-blame" (&optional type noerror)) (declare-function magit-blame-mode "magit-blame" (&optional arg)) (defvar magit-blame-mode) +;; For `magit-show-commit--arguments' and `magit-diff-wash-diff' +(defvar magit-buffer-log-args) +(defvar magit-buffer-log-files) ;; For `magit-diff-show-or-scroll' (declare-function git-rebase-current-line "git-rebase" (&optional batch)) ;; For `magit-diff-unmerged' @@ -193,7 +198,7 @@ keep their distinct foreground colors." :type 'boolean) (defcustom magit-diff-refine-hunk nil - "Whether to show word-granularity differences within diff hunks. + "Whether to refine hunks to show word-granularity differences. `nil' Never show fine differences. `all' Show fine differences for all displayed diff hunks. @@ -209,6 +214,33 @@ keep their distinct foreground colors." (put 'magit-diff-refine-hunk 'permanent-local t) +(defcustom magit-diff-fontify-hunk nil + "Whether to apply syntax highlighting to diff hunks. + +`nil' Never fontify diff hunks. +`all' Fontify all diff hunks. +`t' Fontify each hunk once it becomes the current section. + Keep the fontification when another section is selected. + Refreshing the buffer removes all fontification. This + variant is only provided for performance reasons. + +If this is enabled, then `magit-diff-specify-hunk-foreground' should +be disabled. Also consider enabling `magit-diff-use-indicator-faces'. +Emacs has to be restarted, after changing the value of the former. + +This is considered experimental and is disabled by default, because the +fontification is done synchronously, and that can lead to a noticeable +delay. The plan is to make it asynchronous, probably with the help of +the new `futur' package, which itself still under heavy development." + :package-version '(magit . "4.6.0") + :group 'magit-diff + :safe (##memq % '(nil t all)) + :type '(choice (const :tag "No fontification" nil) + (const :tag "Immediately fontify all hunks" all) + (const :tag "Fontify each hunk when moving to it" t))) + +(put 'magit-diff-fontify-hunk 'permanent-local t) + (defcustom magit-diff-refine-ignore-whitespace smerge-refine-ignore-whitespace "Whether to ignore whitespace changes in word-granularity differences." :package-version '(magit . "3.0.0") @@ -301,10 +333,10 @@ If the used INDENT is `tabs', highlight indentation with tabs. If INDENT is an integer, highlight indentation with at least that many spaces. Otherwise, highlight neither." :group 'magit-diff - :type `(repeat (cons (string :tag "Directory regexp") - (choice (const :tag "Tabs" tabs) - (integer :tag "Spaces" :value ,tab-width) - (const :tag "Neither" nil))))) + :type `(alist :key-type (regexp :tag "Directory regexp") + :value-type (choice (const :tag "Tabs" tabs) + (natnum :tag "Spaces" :value ,tab-width) + (const :tag "Neither" nil)))) (defcustom magit-diff-hide-trailing-cr-characters (and (memq system-type '(ms-dos windows-nt)) t) @@ -584,6 +616,7 @@ side. That way you don't lose the ability to visit the old side." :type 'boolean) ;;; Faces +;;;; Headings (defface magit-diff-file-heading '((t :extend t :weight bold)) @@ -643,17 +676,9 @@ side. That way you don't lose the ability to visit the old side." "Face for selected diff hunk headings." :group 'magit-faces) -(defface magit-diff-hunk-region - `((t :inherit bold - :extend ,(ignore-errors (face-attribute 'region :extend)))) - "Face used by `magit-diff-highlight-hunk-region-using-face'. - -This face is overlaid over text that uses other hunk faces, -and those normally set the foreground and background colors. -The `:foreground' and especially the `:background' properties -should be avoided here. Setting the latter would cause the -loss of information. Good properties to set here are `:weight' -and `:slant'." +(defface magit-diff-conflict-heading + '((t :inherit magit-diff-hunk-heading)) + "Face for conflict markers." :group 'magit-faces) (defface magit-diff-conflict-heading-highlight @@ -684,54 +709,99 @@ and `:slant'." "Face for diff hunk heading when lines are marked." :group 'magit-faces) -(defface magit-diff-lines-boundary - '((t :extend t :inherit magit-diff-lines-heading)) - "Face for boundary of marked lines in diff hunk." +(defface magit-diff-our-heading + `((((class color) (background light)) + :extend t + :background "#aa2222" + :foreground "#ffdddd") + (((class color) (background dark)) + :extend t + :background "#ffdddd" + :foreground "#553333")) + "Face for headings of our side in merge conflicts." :group 'magit-faces) -(defface magit-diff-conflict-heading - '((t :inherit magit-diff-hunk-heading)) - "Face for conflict markers." +(defface magit-diff-base-heading + `((((class color) (background light)) + :extend t + :background "#aaaa11" + :foreground "#ffffcc") + (((class color) (background dark)) + :extend t + :background "#ffffcc" + :foreground "#555522")) + "Face for headings of common base in merge conflicts." :group 'magit-faces) -(defface magit-diff-added - '((((class color) (background light)) +(defface magit-diff-their-heading + `((((class color) (background light)) :extend t - :background "#ddffdd" - :foreground "#22aa22") + :background "#22aa22" + :foreground "#ddffdd") (((class color) (background dark)) :extend t - :background "#335533" - :foreground "#ddffdd")) - "Face for lines in a diff that have been added." + :background "#ddffdd" + :foreground "#335533")) + "Face for headings of their side in merge conflicts." + :group 'magit-faces) + +;;;; Lines + +(defcustom magit-diff-specify-hunk-foreground t + "Whether to specify foreground colors for hunk faces. +Setting this only has an effect if done before Magit is loaded." + :package-version '(magit . "4.6.0") + :group 'magit-faces + :type 'boolean) + +(defface magit-diff-context + `((((class color) (background light)) + :extend t + ,@(and magit-diff-specify-hunk-foreground '(:foreground "grey50"))) + (((class color) (background dark)) + :extend t + ,@(and magit-diff-specify-hunk-foreground '(:foreground "grey70")))) + "Face for lines in a diff that are unchanged." :group 'magit-faces) (defface magit-diff-removed - '((((class color) (background light)) + `((((class color) (background light)) :extend t :background "#ffdddd" - :foreground "#aa2222") + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#aa2222"))) (((class color) (background dark)) :extend t :background "#553333" - :foreground "#ffdddd")) + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#ffdddd")))) "Face for lines in a diff that have been removed." :group 'magit-faces) +(defface magit-diff-added + `((((class color) (background light)) + :extend t + :background "#ddffdd" + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#22aa22"))) + (((class color) (background dark)) + :extend t + :background "#335533" + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#ddffdd")))) + "Face for lines in a diff that have been added." + :group 'magit-faces) + (defface magit-diff-our '((t :inherit magit-diff-removed)) "Face for lines in a diff for our side in a conflict." :group 'magit-faces) (defface magit-diff-base - '((((class color) (background light)) + `((((class color) (background light)) :extend t :background "#ffffcc" - :foreground "#aaaa11") + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#aaaa11"))) (((class color) (background dark)) :extend t :background "#555522" - :foreground "#ffffcc")) + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#ffffcc")))) "Face for lines in a diff for the base side in a conflict." :group 'magit-faces) @@ -740,54 +810,58 @@ and `:slant'." "Face for lines in a diff for their side in a conflict." :group 'magit-faces) -(defface magit-diff-context - '((((class color) (background light)) - :extend t - :foreground "grey50") - (((class color) (background dark)) - :extend t - :foreground "grey70")) - "Face for lines in a diff that are unchanged." - :group 'magit-faces) +;;;; Highlights -(defface magit-diff-added-highlight - '((((class color) (background light)) +(defface magit-diff-context-highlight + `((((class color) (background light)) :extend t - :background "#cceecc" - :foreground "#22aa22") + :background "grey95" + ,@(and magit-diff-specify-hunk-foreground '(:foreground "grey50"))) (((class color) (background dark)) :extend t - :background "#336633" - :foreground "#cceecc")) - "Face for lines in a diff that have been added." + :background "grey20" + ,@(and magit-diff-specify-hunk-foreground '(:foreground "grey70")))) + "Face for lines in the current context in a diff." :group 'magit-faces) (defface magit-diff-removed-highlight - '((((class color) (background light)) + `((((class color) (background light)) :extend t :background "#eecccc" - :foreground "#aa2222") + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#aa2222"))) (((class color) (background dark)) :extend t :background "#663333" - :foreground "#eecccc")) + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#eecccc")))) "Face for lines in a diff that have been removed." :group 'magit-faces) +(defface magit-diff-added-highlight + `((((class color) (background light)) + :extend t + :background "#cceecc" + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#22aa22"))) + (((class color) (background dark)) + :extend t + :background "#336633" + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#cceecc")))) + "Face for lines in a diff that have been added." + :group 'magit-faces) + (defface magit-diff-our-highlight '((t :inherit magit-diff-removed-highlight)) "Face for lines in a diff for our side in a conflict." :group 'magit-faces) (defface magit-diff-base-highlight - '((((class color) (background light)) + `((((class color) (background light)) :extend t :background "#eeeebb" - :foreground "#aaaa11") + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#aaaa11"))) (((class color) (background dark)) :extend t :background "#666622" - :foreground "#eeeebb")) + ,@(and magit-diff-specify-hunk-foreground '(:foreground "#eeeebb")))) "Face for lines in a diff for the base side in a conflict." :group 'magit-faces) @@ -796,35 +870,104 @@ and `:slant'." "Face for lines in a diff for their side in a conflict." :group 'magit-faces) -(defface magit-diff-context-highlight - '((((class color) (background light)) - :extend t - :background "grey95" - :foreground "grey50") - (((class color) (background dark)) - :extend t - :background "grey20" - :foreground "grey70")) - "Face for lines in the current context in a diff." +;;;; Indicators + +(defcustom magit-diff-use-indicator-faces nil + "Whether to use separate faces for diff side indicators. +If non-nil, use, for example, `magit-diff-removed-indicator' for the +plus sign at the beginning of a removed line. If nil, use the same +face as for the rest of the line." + :package-version '(magit . "4.6.0") + :group 'magit-faces + :type 'boolean) + +(defface magit-diff-removed-indicator + `((((class color) (background light)) :foreground "#aa2222") + (((class color) (background dark)) :foreground "#eecccc")) + "Face for indicators on lines in a diff that have been removed. +Only used if `magit-diff-use-indicator-faces' is non-nil." :group 'magit-faces) -(defface magit-diff-whitespace-warning - '((t :inherit trailing-whitespace)) - "Face for highlighting whitespace errors added lines." +(defface magit-diff-added-indicator + `((((class color) (background light)) :foreground "#22aa22") + (((class color) (background dark)) :foreground "#cceecc")) + "Face for indicators on lines in a diff that have been added. +Only used if `magit-diff-use-indicator-faces' is non-nil." :group 'magit-faces) -(defface magit-diffstat-added - '((((class color) (background light)) :foreground "#22aa22") - (((class color) (background dark)) :foreground "#448844")) - "Face for addition indicator in diffstat." +(defface magit-diff-our-indicator + '((t :inherit magit-diff-removed-indicator)) + "Face for indicators on lines in a diff for our side in a conflict. +Only used if `magit-diff-use-indicator-faces' is non-nil." + :group 'magit-faces) + +(defface magit-diff-base-indicator + `((((class color) (background light)) :foreground "#aaaa11") + (((class color) (background dark)) :foreground "#ffffcc")) + "Face for indicators on lines in a diff for base side in a conflict. +Only used if `magit-diff-use-indicator-faces' is non-nil." :group 'magit-faces) +(defface magit-diff-their-indicator + '((t :inherit magit-diff-added-indicator)) + "Face for indicators on lines in a diff for their side in a conflict. +Only used if `magit-diff-use-indicator-faces' is non-nil." + :group 'magit-faces) + +;;;; Diffstats + (defface magit-diffstat-removed '((((class color) (background light)) :foreground "#aa2222") (((class color) (background dark)) :foreground "#aa4444")) "Face for removal indicator in diffstat." :group 'magit-faces) +(defface magit-diffstat-added + '((((class color) (background light)) :foreground "#22aa22") + (((class color) (background dark)) :foreground "#448844")) + "Face for addition indicator in diffstat." + :group 'magit-faces) + +;;;; Region + +(defface magit-diff-lines-boundary + '((t :extend t :inherit magit-diff-lines-heading)) + "Face for boundary of marked lines in diff hunk." + :group 'magit-faces) + +(defface magit-diff-hunk-region + `((t :inherit bold + :extend ,(ignore-errors (face-attribute 'region :extend)))) + "Face used by `magit-diff-highlight-hunk-region-using-face'. + +This face is overlaid over text that uses other hunk faces, +and those normally set the foreground and background colors. +The `:foreground' and especially the `:background' properties +should be avoided here. Setting the latter would cause the +loss of information. Good properties to set here are `:weight' +and `:slant'." + :group 'magit-faces) + +;;;; Whitespace + +(defface magit-diff-whitespace-warning + '((t :inherit trailing-whitespace)) + "Face for highlighting whitespace errors added lines." + :group 'magit-faces) + +;;; Variables + +(defvar-local magit-buffer-diff-range nil) +(defvar-local magit-buffer-diff-range-oids nil) +(defvar-local magit-buffer-diff-type nil) +(defvar-local magit-buffer-diff-typearg nil) +(defvar-local magit-buffer-diff-args nil) +(defvar-local magit-buffer-diff-files nil) +(defvar-local magit-buffer-diff-files-suspended nil) + +;; Preserve when refreshing status buffer. +(put 'magit-buffer-diff-files-suspended 'permanent-local t) + ;;; Arguments ;;;; Prefix Classes @@ -963,6 +1106,7 @@ and `:slant'." ("w" "buffer and save defaults" transient-save-and-exit)] ["Toggle" ("t" "hunk refinement" magit-diff-toggle-refine-hunk) + ("T" "hunk fontification" magit-diff-toggle-fontify-hunk) ("F" "file filter" magit-diff-toggle-file-filter) ("b" "buffer lock" magit-toggle-buffer-lock :if-mode (magit-diff-mode magit-revision-mode magit-stash-mode))] @@ -992,12 +1136,11 @@ and `:slant'." :multi-value t) (defun magit-read-files (prompt initial-input history &optional list-fn) - (magit-with-toplevel - (magit-completing-read-multiple prompt - (funcall (or list-fn #'magit-list-files)) - nil nil - (or initial-input (magit-file-at-point)) - history))) + (magit-completing-read-multiple prompt + (funcall (or list-fn #'magit-list-files)) + nil nil + (or initial-input (magit-file-at-point)) + history)) (transient-define-argument magit-diff:-U () :description "Context lines" @@ -1151,33 +1294,33 @@ use the commands that allow you to explicitly specify what you need." (let ((default-directory default-directory) (section (magit-current-section))) (cond - ((magit-section-match 'module section) - (setq default-directory - (expand-file-name - (file-name-as-directory (oref section value)))) - (magit-diff-range (oref section range))) - (t - (when (magit-section-match 'module-commit section) - (setq args nil) - (setq files nil) - (setq default-directory - (expand-file-name - (file-name-as-directory (magit-section-parent-value section))))) - (pcase (magit-diff--dwim) - ('unmerged (magit-diff-unmerged args files)) - ('unstaged (magit-diff-unstaged args files)) - ('staged - (let ((file (magit-file-at-point))) - (if (and file (equal (cddr (car (magit-file-status file))) '(?D ?U))) - ;; File was deleted by us and modified by them. Show the latter. - (magit-diff-unmerged args (list file)) - (magit-diff-staged nil args files)))) - (`(stash . ,value) (magit-stash-show value args)) - (`(commit . ,value) - (magit-diff-range (format "%s^..%s" value value) args files)) - ((and range (pred stringp)) - (magit-diff-range range args files)) - (_ (call-interactively #'magit-diff-range))))))) + ((magit-section-match 'module section) + (setq default-directory + (expand-file-name + (file-name-as-directory (oref section value)))) + (magit-diff-range (oref section range))) + (t + (when (magit-section-match 'module-commit section) + (setq args nil) + (setq files nil) + (setq default-directory + (expand-file-name + (file-name-as-directory (magit-section-parent-value section))))) + (pcase (magit-diff--dwim) + ('unmerged (magit-diff-unmerged args files)) + ('unstaged (magit-diff-unstaged args files)) + ('staged + (let ((file (magit-file-at-point))) + (if (and file (equal (cddr (car (magit-file-status file))) '(?D ?U))) + ;; File was deleted by us and modified by them. Show the latter. + (magit-diff-unmerged args (list file)) + (magit-diff-staged nil args files)))) + (`(stash . ,value) (magit-stash-show value args)) + (`(commit . ,value) + (magit-diff-range (format "%s^..%s" value value) args files)) + ((and range (pred stringp)) + (magit-diff-range range args files)) + (_ (call-interactively #'magit-diff-range))))))) (defun magit-diff--dwim () "Return information for performing DWIM diff. @@ -1199,8 +1342,6 @@ If no DWIM context is found, nil is returned." ([commits (magit-region-values '(commit branch) t)] (deactivate-mark) (concat (car (last commits)) ".." (car commits))) - (magit-buffer-refname - (cons 'commit magit-buffer-refname)) ((derived-mode-p 'magit-stash-mode) (cons 'commit (magit-section-case @@ -1212,11 +1353,11 @@ If no DWIM context is found, nil is returned." (oref parent) (oref parent) (oref value)))))) - ((derived-mode-p 'magit-revision-mode) + (magit-buffer-revision (cons 'commit magit-buffer-revision)) ((derived-mode-p 'magit-diff-mode) (pcase-exhaustive magit-buffer-diff-type - ('committed magit-buffer-range) + ('committed magit-buffer-diff-range) ((or 'unstaged 'staged 'undefined) magit-buffer-diff-type))) ((magit-section-case ([* unstaged] 'unstaged) @@ -1256,17 +1397,17 @@ If no DWIM context is found, nil is returned." (if mbase (let ((base (magit-git-string "merge-base" revA revB))) (cond - ((string= (magit-rev-parse revA) base) - (format "%s..%s" revA revB)) - ((string= (magit-rev-parse revB) base) - (format "%s..%s" revB revA)) - (interactive - (let ((main (magit-completing-read "View changes along" - (list revA revB) - nil t nil nil revB))) - (format "%s...%s" - (if (string= main revB) revA revB) main))) - ((format "%s...%s" revA revB)))) + ((string= (magit-rev-parse revA) base) + (format "%s..%s" revA revB)) + ((string= (magit-rev-parse revB) base) + (format "%s..%s" revB revA)) + (interactive + (let ((main (magit-completing-read "View changes along" + (list revA revB) + nil t nil nil revB))) + (format "%s...%s" + (if (string= main revB) revA revB) main))) + ((format "%s...%s" revA revB)))) (format "%s..%s" revA revB))))) (defun magit-diff-read-range-or-commit (prompt &optional secondary-default mbase) @@ -1309,9 +1450,9 @@ revisions (i.e., use a \"...\" range)." With a prefix argument show changes between the working tree and a commit read from the minibuffer." (interactive - (cons (and current-prefix-arg - (magit-read-branch-or-commit "Diff working tree and commit")) - (magit-diff-arguments))) + (cons (and current-prefix-arg + (magit-read-branch-or-commit "Diff working tree and commit")) + (magit-diff-arguments))) (magit-diff-setup-buffer (or rev "HEAD") nil args files 'committed)) ;;;###autoload @@ -1320,9 +1461,9 @@ a commit read from the minibuffer." With a prefix argument show changes between the index and a commit read from the minibuffer." (interactive - (cons (and current-prefix-arg - (magit-read-branch-or-commit "Diff index and commit")) - (magit-diff-arguments))) + (cons (and current-prefix-arg + (magit-read-branch-or-commit "Diff index and commit")) + (magit-diff-arguments))) (magit-diff-setup-buffer rev "--cached" args files 'staged)) ;;;###autoload @@ -1348,7 +1489,7 @@ be committed." (interactive) (unless (magit-commit-message-buffer) (user-error "No commit in progress")) - (magit-commit-diff-1)) + (magit-commit-diff--show)) ;;;###autoload (defun magit-diff-buffer-file () @@ -1361,8 +1502,8 @@ the file or blob." (interactive) (require 'magit) (if-let ((file (magit-file-relative-name))) - (if magit-buffer-refname - (magit-show-commit magit-buffer-refname + (if magit-buffer-revision + (magit-show-commit magit-buffer-revision (car (magit-show-commit--arguments)) (list file)) (save-buffer) @@ -1405,17 +1546,17 @@ the file or blob." If there is no revision at point or with a prefix argument prompt for a revision." (interactive - (pcase-let* ((mcommit (magit-section-value-if 'module-commit)) - (atpoint (or mcommit - (magit-thing-at-point 'git-revision t) - (magit-branch-or-commit-at-point))) - (`(,args ,files) (magit-show-commit--arguments))) - (list (or (and (not current-prefix-arg) atpoint) - (magit-read-branch-or-commit "Show commit" atpoint)) - args - files - (and mcommit - (magit-section-parent-value (magit-current-section)))))) + (pcase-let* ((mcommit (magit-section-value-if 'module-commit)) + (atpoint (or mcommit + (magit-thing-at-point 'git-revision t) + (magit-branch-or-commit-at-point))) + (`(,args ,files) (magit-show-commit--arguments))) + (list (or (and (not current-prefix-arg) atpoint) + (magit-read-branch-or-commit "Show commit" atpoint)) + args + files + (and mcommit + (magit-section-parent-value (magit-current-section)))))) (require 'magit) (let* ((file (magit-file-relative-name)) (line (and file (line-number-at-pos)))) @@ -1423,13 +1564,13 @@ for a revision." (when module (setq default-directory (expand-file-name (file-name-as-directory module)))) - (unless (magit-commit-p rev) - (user-error "%s is not a commit" rev)) + (unless (magit-commit-oid rev t) + (user-error "%s cannot be dereferenced as a commit" rev)) (when file (save-buffer)) (let ((buf (magit-revision-setup-buffer rev args files))) (when file - (let ((line (magit-diff-visit--offset file (list "-R" rev) line)) + (let ((line (magit-diff-visit--offset line file "-R" rev)) (col (current-column))) (with-current-buffer buf (magit-diff--goto-file-position file line col)))))))) @@ -1454,22 +1595,22 @@ for a revision." (len (cadr range)) (end (+ beg len))) (cond - ((> beg line) - (setq pos (oref diff start))) - ((<= beg line end) - (save-excursion - (goto-char (oref hunk content)) - (let ((l beg)) - (while (or (< l line) - (= (char-after) ?-)) - (unless (= (char-after) ?-) - (cl-incf l)) - (forward-line))) - (setq found (if (= (char-after) ?+) 'line 'hunk)) - (forward-char (1+ column)) - (setq pos (point)))) - ((null hunks) - (setq pos (oref hunk start)))))) + ((> beg line) + (setq pos (oref diff start))) + ((<= beg line end) + (save-excursion + (goto-char (oref hunk content)) + (let ((l beg)) + (while (or (< l line) + (= (char-after) ?-)) + (unless (= (char-after) ?-) + (cl-incf l)) + (forward-line))) + (setq found (if (= (char-after) ?+) 'line 'hunk)) + (forward-char (1+ column)) + (setq pos (point)))) + ((null hunks) + (setq pos (oref hunk start)))))) (and pos (list pos (or found file)))))) @@ -1484,13 +1625,15 @@ for a revision." "Convert diff range type. Change \"revA..revB\" to \"revA...revB\", or vice versa." (interactive) - (cond ((and magit-buffer-range + (cond ((and magit-buffer-diff-range (derived-mode-p 'magit-diff-mode) - (string-match magit-range-re magit-buffer-range)) - (setq magit-buffer-range + (string-match magit-range-re magit-buffer-diff-range)) + (setq magit-buffer-diff-range (replace-match - (if (string= (match-str 2 magit-buffer-range) "..") "..." "..") - t t magit-buffer-range 2)) + (if (string= (match-str 2 magit-buffer-diff-range) "..") + "..." + "..") + t t magit-buffer-diff-range 2)) (magit-refresh)) ((user-error "No range to change")))) @@ -1498,13 +1641,13 @@ Change \"revA..revB\" to \"revA...revB\", or vice versa." "Swap revisions in diff range. Change \"revA..revB\" to \"revB..revA\"." (interactive) - (cond ((and magit-buffer-range + (cond ((and magit-buffer-diff-range (derived-mode-p 'magit-diff-mode) - (string-match magit-range-re magit-buffer-range)) - (setq magit-buffer-range - (concat (match-str 3 magit-buffer-range) - (match-str 2 magit-buffer-range) - (match-str 1 magit-buffer-range))) + (string-match magit-range-re magit-buffer-diff-range)) + (setq magit-buffer-diff-range + (concat (match-str 3 magit-buffer-diff-range) + (match-str 2 magit-buffer-diff-range) + (match-str 1 magit-buffer-diff-range))) (magit-refresh)) ((user-error "No range to swap")))) @@ -1523,15 +1666,15 @@ instead." (transient-infix-read 'magit:--))) (magit-refresh))) (cond - ((derived-mode-p 'magit-log-mode - 'magit-cherry-mode - 'magit-reflog-mode) - (if-let ((buffer (magit-get-mode-buffer 'magit-revision-mode))) - (with-current-buffer buffer (toggle)) - (message "No revision buffer"))) - ((local-variable-p 'magit-buffer-diff-files) - (toggle)) - ((user-error "Cannot toggle file filter in this buffer"))))) + ((derived-mode-p 'magit-log-mode + 'magit-cherry-mode + 'magit-reflog-mode) + (if-let ((buffer (magit-get-mode-buffer 'magit-revision-mode))) + (with-current-buffer buffer (toggle)) + (message "No revision buffer"))) + ((local-variable-p 'magit-buffer-diff-files) + (toggle)) + ((user-error "Cannot toggle file filter in this buffer"))))) (defun magit-diff-less-context (&optional count) "Decrease the context for diff hunks by COUNT lines." @@ -1589,26 +1732,49 @@ instead." "--ignore-blank-space"))) (defun magit-diff-toggle-refine-hunk (&optional style) - "Turn diff-hunk refining on or off. + "Turn hunk refinement on or off, or switch refinement method. -If hunk refining is currently on, then hunk refining is turned off. -If hunk refining is off, then hunk refining is turned on, in -`selected' mode (only the currently selected hunk is refined). +If hunk refinement is currently on, then turn off hunk refinement. +If hunk refinement is off, then turn on immediate hunk refinement. -With a prefix argument, the \"third choice\" is used instead: -If hunk refining is currently on, then refining is kept on, but -the refining mode (`selected' or `all') is switched. -If hunk refining is off, then hunk refining is turned on, in -`all' mode (all hunks refined). +With a prefix argument, an alternative refinement method comes into +play. When using that method, mode hunks are not refined immediately, +instead each hunk is refined once it is selected, and then stays refined +until the next refresh of the buffer. If hunk refinement is currently +on, then toggle between refining all hunks up front or only once they +are selected. If hunk refinement is off, then turn on hunk refinement, +using the eventual refinement method. -Customize variable `magit-diff-refine-hunk' to change the default mode." +Customize option `magit-diff-refine-hunk' to change the default method." (interactive "P") (setq-local magit-diff-refine-hunk (if style - (if (eq magit-diff-refine-hunk 'all) t 'all) - (not magit-diff-refine-hunk))) + (if (eq magit-diff-refine-hunk t) 'all t) + (if magit-diff-refine-hunk nil 'all))) (magit-diff-update-hunk-refinement)) +(defun magit-diff-toggle-fontify-hunk (&optional style) + "Turn hunk fontification on or off, or switch fontification method. + +If hunk fontification is currently on, then turn off hunk fontification. +If hunk fontification is off, then turn on immediate hunk fontification. + +With a prefix argument, an alternative fontification method comes into +play. When using that method, mode hunks are not refined immediately, +instead each hunk is refined once it is selected, and then stays refined +until the next refresh of the buffer. If hunk fontification is currently +on, then toggle between refining all hunks up front or only once they +are selected. If hunk fontification is off, then turn on fontification, +using the eventual fontification method. + +Customize option `magit-diff-fontify-hunk' to change the default method." + (interactive "P") + (setq-local magit-diff-fontify-hunk + (if style + (if (eq magit-diff-fontify-hunk t) 'all t) + (if magit-diff-fontify-hunk nil 'all))) + (magit-diff--update-hunk-syntax)) + ;;;; Visit Commands ;;;;; Dwim Variants @@ -1758,7 +1924,8 @@ the Magit-Status buffer for DIRECTORY." (pcase-let* ((`(,old ,new) (magit-diff-visit--sides)) (goto-from (and (not goto-file) (magit-diff-on-removed-line-p))) - (goto-file (or goto-file (equal magit-buffer-typearg "--no-index"))) + (goto-file (or goto-file + (equal magit-buffer-diff-typearg "--no-index"))) (`(,rev ,file) (if goto-from old new)) (buffer (magit-find-file-noselect (if goto-file "{worktree}" rev) file))) @@ -1777,7 +1944,7 @@ the Magit-Status buffer for DIRECTORY." (magit-split-range spec t)) (`(,(or 'commit 'stash) . ,rev) (cons (magit-rev-abbrev (concat rev "^")) - (magit--abbrev-if-hash rev))) + (magit--abbrev-if-oid rev))) ('staged (cons (magit-rev-abbrev "HEAD") "{index}")) ('unstaged (cons (if (magit-anything-staged-p nil old-file) "{index}" @@ -1787,7 +1954,7 @@ the Magit-Status buffer for DIRECTORY." ('unmerged (cons "{worktree}" "{worktree}")) ('undefined (cons "{worktree}" "{worktree}")) ;--no-index (_ (error "BUG: Unexpected diff type %s" spec))))) - (when (equal magit-buffer-typearg "--no-index") + (when (equal magit-buffer-diff-typearg "--no-index") (setq old-file (concat "/" old-file)) (setq new-file (concat "/" new-file))) (list (list old-rev old-file) @@ -1798,13 +1965,15 @@ the Magit-Status buffer for DIRECTORY." (line (magit-diff-hunk-line hunk goto-from)) (column (magit-diff-hunk-column hunk goto-from))) (with-current-buffer buffer - (when (and goto-file (not (equal rev "{worktree}"))) - (setq line (magit-diff-visit--offset - file (if (equal rev "{index}") nil rev) line))) (save-restriction (widen) (goto-char (point-min)) - (forward-line (1- line)) + (forward-line + (1- (pcase rev + ((guard (not goto-file)) line) + ("{worktree}" line) + ("{index}" (magit-diff-visit--offset line file)) + (_ (magit-diff-visit--offset line file rev))))) (move-to-column column) (point))))) @@ -1838,12 +2007,15 @@ the Magit-Status buffer for DIRECTORY." (max 0 (- (+ (current-column) 2) (length (oref section value)))))) -(defun magit-diff-visit--offset (file rev line) +(defun magit-diff-visit--offset (line file &rest args) (let ((offset 0)) (with-temp-buffer (save-excursion (magit-with-toplevel - (magit-git-insert "diff" rev "--" file))) + (cond ((stringp file) + (magit-git-insert "diff" args "--" file)) + ((magit-git-version< "2.50")) + ((apply #'magit--diff-pair (current-buffer) file))))) (catch 'found (while (re-search-forward "^@@ -\\([0-9]+\\),\\([0-9]+\\) \\+\\([0-9]+\\),\\([0-9]+\\) @@.*\n" @@ -1864,6 +2036,80 @@ the Magit-Status buffer for DIRECTORY." (throw 'found nil)))))) (+ line offset))) +(defun magit--diff-pair (buffer a b &optional file) + (with-temp-buffer + (insert (format ":100644 100644 %s %s M\0%s\0" a b (or file "blob"))) + (call-process-region (point-min) (point-max) + (magit-git-executable) nil buffer nil + "diff-pairs" "-z"))) + +;;;;; Modified + +(defun magit-diff--modified-defuns () + (let (value eof) + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "^diff --git" nil t) + (save-excursion + (setq eof (and (re-search-forward "^diff --git" nil t) + (match-beginning 0)))) + (let (-rev +rev) + (while (progn (forward-line) (looking-at "^[a-z]")) + (when (looking-at "^index \\([^.]+\\)\\.\\.\\([^ ]+\\)") + (setq -rev (magit-rev-parse (match-string 1))) + (setq +rev (magit-rev-parse (match-string 2))))) + (pcase-let* + ((-file (and (looking-at "^--- a/\\(.+\\)") + (prog1 (match-str 1) (forward-line)))) + (+file (and (looking-at "^\\+\\+\\+ b/\\(.+\\)") + (prog1 (match-str 1) (forward-line)))) + (`(,-lines ,+lines) (magit-diff--modified-lines eof)) + (-defuns (and -lines (magit-diff--modified-defuns-1 + -rev -file -lines))) + (+defuns (and +lines (magit-diff--modified-defuns-1 + +rev +file +lines)))) + (if (equal -file +file) + (when$ (nconc +defuns -defuns) + (push (cons +file (delete-dups $)) value)) + (when -defuns (push (cons -file -defuns) value)) + (when +defuns (push (cons +file +defuns) value))))))) + (nreverse value))) + +(defun magit-diff--modified-defuns-1 (rev file lines) + (with-current-buffer (magit-find-file-noselect rev file t t) + (save-excursion + (save-restriction + (widen) + (let (defuns) + (while-let ((line (pop lines))) + (goto-char (point-min)) + (forward-line line) + (when-let ((def (which-function))) + (cl-pushnew def defuns :test #'equal) + (when-let ((end (condition-case nil (end-of-defun) + (:success (line-number-at-pos)) + (error nil)))) + (while (and lines (> end (car lines))) + (pop lines))))) + (nreverse defuns)))))) + +(defun magit-diff--modified-lines (bound) + (let (-lines +lines) + (while (re-search-forward + "^@@ -\\([0-9]+\\),[^ ]+ \\+\\([0-9]+\\),[^ ]+ @@.*\n" bound t) + (let ((-line (string-to-number (match-string 1))) + (+line (string-to-number (match-string 2)))) + (while (and (not (eobp)) + (memq (char-after) '(?\s ?- ?+))) + (pcase (char-after) + (?\s (cl-incf -line) + (cl-incf +line)) + (?- (push (cl-incf -line) -lines)) + (?+ (push (cl-incf +line) +lines))) + (forward-line)))) + (list (nreverse -lines) + (nreverse +lines)))) + ;;;; Scroll Commands (defun magit-diff-show-or-scroll-up () @@ -1889,57 +2135,57 @@ commit or stash at point, then prompt for a commit." (magit-diff-show-or-scroll #'scroll-down)) (defun magit-diff-show-or-scroll (fn) - (let (rev cmd buf win) + (let (rev cmd buf) (cond - ((and (bound-and-true-p magit-blame-mode) - (fboundp 'magit-current-blame-chunk)) - (setq rev (oref (magit-current-blame-chunk) orig-rev)) - (setq cmd #'magit-show-commit) - (setq buf (magit-get-mode-buffer 'magit-revision-mode))) - ((derived-mode-p 'git-rebase-mode) - (with-slots (action-type target) - (git-rebase-current-line) - (if (not (eq action-type 'commit)) - (user-error "No commit on this line") - (setq rev target) + ((and (bound-and-true-p magit-blame-mode) + (fboundp 'magit-current-blame-chunk)) + (setq rev (oref (magit-current-blame-chunk) orig-rev)) + (setq cmd #'magit-show-commit) + (setq buf (magit-get-mode-buffer 'magit-revision-mode))) + ((derived-mode-p 'git-rebase-mode) + (with-slots (action-type target) + (git-rebase-current-line) + (if (not (eq action-type 'commit)) + (user-error "No commit on this line") + (setq rev target) + (setq cmd #'magit-show-commit) + (setq buf (magit-get-mode-buffer 'magit-revision-mode))))) + ((magit-section-case + (branch + (setq rev (magit-ref-maybe-qualify (oref it value))) + (setq cmd #'magit-show-commit) + (setq buf (magit-get-mode-buffer 'magit-revision-mode))) + (commit + (setq rev (oref it value)) (setq cmd #'magit-show-commit) - (setq buf (magit-get-mode-buffer 'magit-revision-mode))))) - ((magit-section-case - (branch - (setq rev (magit-ref-maybe-qualify (oref it value))) - (setq cmd #'magit-show-commit) - (setq buf (magit-get-mode-buffer 'magit-revision-mode))) - (commit - (setq rev (oref it value)) - (setq cmd #'magit-show-commit) - (setq buf (magit-get-mode-buffer 'magit-revision-mode))) - (tag - (setq rev (magit-rev-hash (oref it value))) - (setq cmd #'magit-show-commit) - (setq buf (magit-get-mode-buffer 'magit-revision-mode))) - (stash - (setq rev (oref it value)) - (setq cmd #'magit-stash-show) - (setq buf (magit-get-mode-buffer 'magit-stash-mode)))))) - (if rev - (if (and buf - (setq win (get-buffer-window buf)) - (with-current-buffer buf - (and (equal rev magit-buffer-revision) - (equal (magit-rev-parse rev) - magit-buffer-revision-hash)))) - (with-selected-window win - (condition-case nil - (funcall fn) - (error - (goto-char (pcase fn - ('scroll-up (point-min)) - ('scroll-down (point-max))))))) - (let ((magit-display-buffer-noselect t)) - (if (eq cmd #'magit-show-commit) - (apply #'magit-show-commit rev (magit-show-commit--arguments)) - (funcall cmd rev)))) - (call-interactively #'magit-show-commit)))) + (setq buf (magit-get-mode-buffer 'magit-revision-mode))) + (tag + (setq rev (magit-commit-oid (oref it value))) + (setq cmd #'magit-show-commit) + (setq buf (magit-get-mode-buffer 'magit-revision-mode))) + (stash + (setq rev (oref it value)) + (setq cmd #'magit-stash-show) + (setq buf (magit-get-mode-buffer 'magit-stash-mode)))))) + (cond-let* + ((not rev) + (call-interactively #'magit-show-commit)) + ([_ buf] + [win (get-buffer-window buf)] + [_ (equal (buffer-local-value 'magit-buffer-revision buf) rev)] + [_ (equal (buffer-local-value 'magit-buffer-revision-oid buf) + (magit-rev-parse rev))] + (with-selected-window win + (condition-case nil + (funcall fn) + (error + (pcase-exhaustive fn + ('scroll-up (goto-char (point-min))) + ('scroll-down (goto-char (point-max)))))))) + [[magit-display-buffer-noselect t]] + ((eq cmd #'magit-show-commit) + (apply #'magit-show-commit rev (magit-show-commit--arguments))) + ((funcall cmd rev))))) ;;;; Section Commands @@ -2102,8 +2348,8 @@ Staging and applying changes is documented in info node &optional type locked) (require 'magit) (magit-setup-buffer #'magit-diff-mode locked - (magit-buffer-range range) - (magit-buffer-typearg typearg) + (magit-buffer-diff-range range) + (magit-buffer-diff-typearg typearg) (magit-buffer-diff-type type) (magit-buffer-diff-args args) (magit-buffer-diff-files files) @@ -2112,20 +2358,21 @@ Staging and applying changes is documented in info node (defun magit-diff-refresh-buffer () "Refresh the current `magit-diff-mode' buffer." (magit-set-header-line-format - (if (equal magit-buffer-typearg "--no-index") + (if (equal magit-buffer-diff-typearg "--no-index") (apply #'format "Differences between %s and %s" magit-buffer-diff-files) - (concat (cond (magit-buffer-range - (if (string-match-p "\\(\\.\\.\\|\\^-\\)" - magit-buffer-range) - (format "Changes in %s" magit-buffer-range) - (let ((msg "Changes from %s to %s") - (end (if (equal magit-buffer-typearg "--cached") - "index" - "working tree"))) - (if (member "-R" magit-buffer-diff-args) - (format msg end magit-buffer-range) - (format msg magit-buffer-range end))))) - ((equal magit-buffer-typearg "--cached") + (concat (cond (magit-buffer-diff-range + (cond-let + ((string-match-p "\\(\\.\\.\\|\\^-\\)" + magit-buffer-diff-range) + (format "Changes in %s" magit-buffer-diff-range)) + [[msg "Changes from %s to %s"] + [end (if (equal magit-buffer-diff-typearg "--cached") + "index" + "working tree")]] + ((member "-R" magit-buffer-diff-args) + (format msg end magit-buffer-diff-range)) + ((format msg magit-buffer-diff-range end)))) + ((equal magit-buffer-diff-typearg "--cached") "Staged changes") ((and (magit-repository-local-get 'this-commit-command) (not (magit-anything-staged-p))) @@ -2136,17 +2383,19 @@ Staging and applying changes is documented in info node (1 (concat " in file " (car magit-buffer-diff-files))) (_ (concat " in files " (string-join magit-buffer-diff-files ", "))))))) - (setq magit-buffer-range-hashed - (and magit-buffer-range (magit-hash-range magit-buffer-range))) + (setq magit-buffer-diff-range-oids + (and magit-buffer-diff-range + (magit-hash-range magit-buffer-diff-range))) (magit-insert-section (diffbuf) (magit-run-section-hook 'magit-diff-sections-hook))) (cl-defmethod magit-buffer-value (&context (major-mode magit-diff-mode)) - (nconc (cond (magit-buffer-range - (delq nil (list magit-buffer-range magit-buffer-typearg))) - ((equal magit-buffer-typearg "--cached") - (list 'staged)) - ((list 'unstaged magit-buffer-typearg))) + (nconc (cond + (magit-buffer-diff-range + (delq nil (list magit-buffer-diff-range magit-buffer-diff-typearg))) + ((equal magit-buffer-diff-typearg "--cached") + (list 'staged)) + ((list 'unstaged magit-buffer-diff-typearg))) (and magit-buffer-diff-files (cons "--" magit-buffer-diff-files)))) (cl-defmethod magit-menu-common-value ((_section magit-diff-section)) @@ -2238,9 +2487,9 @@ keymap is the parent of their keymaps." (defun magit-insert-diff () "Insert the diff into this `magit-diff-mode' buffer." (magit--insert-diff t - "diff" magit-buffer-range "-p" "--no-prefix" + "diff" magit-buffer-diff-range "-p" "--no-prefix" (and (member "--stat" magit-buffer-diff-args) "--numstat") - magit-buffer-typearg + magit-buffer-diff-typearg magit-buffer-diff-args "--" magit-buffer-diff-files)) @@ -2255,7 +2504,7 @@ keymap is the parent of their keymaps." (unless (equal cmd "merge-tree") (push "--ita-visible-in-index" args)) (setq args (magit-diff--maybe-add-stat-arguments args)) - (when (cl-member-if (##string-prefix-p "--color-moved" %) args) + (when (magit--any (##string-prefix-p "--color-moved" %) args) (push "--color=always" args) (setq magit-git-global-arguments (append magit-diff--reset-non-color-moved @@ -2310,7 +2559,7 @@ keymap is the parent of their keymaps." (defun magit-diff-wash-diffs (args &optional limit) (run-hooks 'magit-diff-wash-diffs-hook) (when (member "--show-signature" args) - (magit-diff-wash-signature magit-buffer-revision-hash)) + (magit-diff-wash-signature magit-buffer-revision-oid)) (when (member "--stat" args) (magit-diff-wash-diffstat)) (when (re-search-forward magit-diff-headline-re limit t) @@ -2320,29 +2569,29 @@ keymap is the parent of their keymaps." (defun magit-diff-wash-signature (object) (cond - ((looking-at "^No signature") - (delete-line)) - ((looking-at "^gpg: ") - (let (title end) - (save-excursion - (while (looking-at "^gpg: ") - (cond - ((looking-at "^gpg: Good signature from") - (setq title (magit--propertize-face - (buffer-substring (point) (line-end-position)) - 'magit-signature-good))) - ((looking-at "^gpg: Can't check signature") - (setq title (magit--propertize-face - (buffer-substring (point) (line-end-position)) - '(italic bold))))) - (forward-line)) - (setq end (point-marker))) - (magit-insert-section (signature object title) - (when title - (magit-insert-heading title)) - (goto-char end) - (set-marker end nil) - (insert "\n")))))) + ((looking-at "^No signature") + (delete-line)) + ((looking-at "^gpg: ") + (let (title end) + (save-excursion + (while (looking-at "^gpg: ") + (cond + ((looking-at "^gpg: Good signature from") + (setq title (magit--propertize-face + (buffer-substring (point) (line-end-position)) + 'magit-signature-good))) + ((looking-at "^gpg: Can't check signature") + (setq title (magit--propertize-face + (buffer-substring (point) (line-end-position)) + '(italic bold))))) + (forward-line)) + (setq end (point-marker))) + (magit-insert-section (signature object title) + (when title + (magit-insert-heading title)) + (goto-char end) + (set-marker end nil) + (insert "\n")))))) (defun magit-diff-wash-diffstat () (let (heading (beg (point))) @@ -2390,139 +2639,140 @@ keymap is the parent of their keymaps." (if (looking-at "^$") (forward-line) (insert "\n")))))) (defun magit-diff-wash-diff (args) - (when (cl-member-if (##string-prefix-p "--color-moved" %) args) + (when (magit--any (##string-prefix-p "--color-moved" %) args) (require 'ansi-color) (ansi-color-apply-on-region (point-min) (point-max))) (cond - ((looking-at "^Submodule") - (magit-diff-wash-submodule)) - ((looking-at "^\\* Unmerged path \\(.*\\)") - (let ((file (magit-decode-git-path (match-str 1)))) - (magit-delete-line) - (unless (and (derived-mode-p 'magit-status-mode) - (not (member "--cached" args))) - (magit-insert-section (file file) - (insert (propertize - (format "unmerged %s%s" file - (pcase (cddr (car (magit-file-status file))) - ('(?D ?D) " (both deleted)") - ('(?D ?U) " (deleted by us)") - ('(?U ?D) " (deleted by them)") - ('(?A ?A) " (both added)") - ('(?A ?U) " (added by us)") - ('(?U ?A) " (added by them)") - ('(?U ?U) ""))) - 'font-lock-face 'magit-diff-file-heading)) - (insert ?\n)))) - t) - ((looking-at magit-diff-conflict-headline-re) - (let ((long-status (match-str 0)) - (status "BUG") - file orig base) - (if (equal long-status "merged") - (progn (setq status long-status) - (setq long-status nil)) - (setq status (pcase-exhaustive long-status - ("added in remote" "new file") - ("added in both" "new file") - ("added in local" "new file") - ("removed in both" "removed") - ("changed in both" "changed") - ("removed in local" "removed") - ("removed in remote" "removed")))) - (magit-delete-line) - (while (looking-at - "^ \\([^ ]+\\) +[0-9]\\{6\\} \\([a-z0-9]\\{40,\\}\\) \\(.+\\)$") - (magit-bind-match-strings (side _blob name) nil - (pcase side - ("result" (setq file name)) - ("our" (setq orig name)) - ("their" (setq file name)) - ("base" (setq base name)))) - (magit-delete-line)) - (when orig (setq orig (magit-decode-git-path orig))) - (when file (setq file (magit-decode-git-path file))) - (magit-diff-insert-file-section - (or file base) orig status nil nil nil nil long-status))) - ;; The files on this line may be ambiguous due to whitespace. - ;; That's okay. We can get their names from subsequent headers. - ((looking-at "^diff --\ + ((looking-at "^Submodule") + (magit-diff-wash-submodule)) + ((looking-at "^\\* Unmerged path \\(.*\\)") + (let ((file (magit-decode-git-path (match-str 1)))) + (magit-delete-line) + (unless (and (derived-mode-p 'magit-status-mode) + (not (member "--cached" args))) + (magit-insert-section (file file) + (insert (propertize + (format "unmerged %s%s" file + (pcase (cddr (car (magit-file-status file))) + ('(?D ?D) " (both deleted)") + ('(?D ?U) " (deleted by us)") + ('(?U ?D) " (deleted by them)") + ('(?A ?A) " (both added)") + ('(?A ?U) " (added by us)") + ('(?U ?A) " (added by them)") + ('(?U ?U) ""))) + 'font-lock-face 'magit-diff-file-heading)) + (insert ?\n)))) + t) + ((looking-at magit-diff-conflict-headline-re) + (let ((long-status (match-str 0)) + (status "BUG") + file orig base) + (cond ((equal long-status "merged") + (setq status long-status) + (setq long-status nil)) + ((setq status + (pcase-exhaustive long-status + ("added in remote" "new file") + ("added in both" "new file") + ("added in local" "new file") + ("removed in both" "removed") + ("changed in both" "changed") + ("removed in local" "removed") + ("removed in remote" "removed"))))) + (magit-delete-line) + (while (looking-at + "^ \\([^ ]+\\) +[0-9]\\{6\\} \\([a-z0-9]\\{40,\\}\\) \\(.+\\)$") + (magit-bind-match-strings (side _blob name) nil + (pcase side + ("result" (setq file name)) + ("our" (setq orig name)) + ("their" (setq file name)) + ("base" (setq base name)))) + (magit-delete-line)) + (when orig (setq orig (magit-decode-git-path orig))) + (when file (setq file (magit-decode-git-path file))) + (magit-diff-insert-file-section + (or file base) orig status nil nil nil nil long-status))) + ;; The files on this line may be ambiguous due to whitespace. + ;; That's okay. We can get their names from subsequent headers. + ((looking-at "^diff --\ \\(?:\\(?1:git\\) \\(?:\\(?2:.+?\\) \\2\\)?\ \\|\\(?:cc\\|combined\\) \\(?3:.+\\)\\)") - (let ((status (cond ((equal (match-str 1) "git") "modified") - ((derived-mode-p 'magit-revision-mode) "resolved") - (t "unmerged"))) - (orig nil) - (file (or (match-str 2) (match-str 3))) - (header (list (buffer-substring-no-properties - (line-beginning-position) (1+ (line-end-position))))) - (modes nil) - (rename nil) - (binary nil)) - (magit-delete-line) - (while (not (or (eobp) - (looking-at magit-diff-headline-re) - (looking-at magit-log-heading-re))) - (cond - ((looking-at "old mode \\(?:[^\n]+\\)\nnew mode \\(?:[^\n]+\\)\n") - (setq modes (match-str 0))) - ((looking-at "deleted file .+\n") - (setq status "deleted")) - ((looking-at "new file .+\n") - (setq status "new file")) - ((looking-at "rename from \\(.+\\)\nrename to \\(.+\\)\n") - (setq rename (match-str 0)) - (setq orig (match-str 1)) - (setq file (match-str 2)) - (setq status "renamed")) - ((looking-at "copy from \\(.+\\)\ncopy to \\(.+\\)\n") - (setq orig (match-str 1)) - (setq file (match-str 2)) - (setq status "new file")) - ((looking-at "similarity index .+\n")) - ((looking-at "dissimilarity index .+\n")) - ((looking-at "index .+\n")) - ((looking-at "--- \\(.+?\\)\t?\n") - (unless (equal (match-str 1) "/dev/null") - (setq orig (match-str 1)))) - ((looking-at "\\+\\+\\+ \\(.+?\\)\t?\n") - (unless (equal (match-str 1) "/dev/null") - (setq file (match-str 1)))) - ((looking-at "Binary files .+ and .+ differ\n") - (setq binary t)) - ((looking-at "Binary files differ\n") - (setq binary t)) - ;; TODO Use all combined diff extended headers. - ((looking-at "mode .+\n")) - ((error "BUG: Unknown extended header: %S" - (buffer-substring (point) (line-end-position))))) - ;; These headers are treated as some sort of special hunk. - (unless (or (string-prefix-p "old mode" (match-str 0)) - (string-prefix-p "rename" (match-str 0))) - (push (match-str 0) header)) - (magit-delete-match)) - (when orig - (setq orig (magit-decode-git-path orig))) - (setq file (magit-decode-git-path file)) - (setq header (nreverse header)) - ;; KLUDGE `git-log' ignores `--no-prefix' when `-L' is used. - (when (and (derived-mode-p 'magit-log-mode) - (seq-some (##string-prefix-p "-L" %) - magit-buffer-log-args)) - (when orig - (setq orig (substring orig 2))) - (setq file (substring file 2)) - (setq header (list (save-excursion - (string-match "diff [^ ]+" (car header)) - (format "%s %s %s\n" - (match-str 0 (car header)) - (or orig file) - (or file orig))) - (format "--- %s\n" (or orig "/dev/null")) - (format "+++ %s\n" (or file "/dev/null"))))) - (setq header (string-join header)) - (magit-diff-insert-file-section - file orig status modes rename header binary nil))))) + (let ((status (cond ((equal (match-str 1) "git") "modified") + ((derived-mode-p 'magit-revision-mode) "resolved") + (t "unmerged"))) + (orig nil) + (file (or (match-str 2) (match-str 3))) + (header (list (buffer-substring-no-properties + (line-beginning-position) (1+ (line-end-position))))) + (modes nil) + (rename nil) + (binary nil)) + (magit-delete-line) + (while (not (or (eobp) + (looking-at magit-diff-headline-re) + (looking-at magit-log-heading-re))) + (cond + ((looking-at "old mode \\(?:[^\n]+\\)\nnew mode \\(?:[^\n]+\\)\n") + (setq modes (match-str 0))) + ((looking-at "deleted file .+\n") + (setq status "deleted")) + ((looking-at "new file .+\n") + (setq status "new file")) + ((looking-at "rename from \\(.+\\)\nrename to \\(.+\\)\n") + (setq rename (match-str 0)) + (setq orig (match-str 1)) + (setq file (match-str 2)) + (setq status "renamed")) + ((looking-at "copy from \\(.+\\)\ncopy to \\(.+\\)\n") + (setq orig (match-str 1)) + (setq file (match-str 2)) + (setq status "new file")) + ((looking-at "similarity index .+\n")) + ((looking-at "dissimilarity index .+\n")) + ((looking-at "index .+\n")) + ((looking-at "--- \\(.+?\\)\t?\n") + (unless (equal (match-str 1) "/dev/null") + (setq orig (match-str 1)))) + ((looking-at "\\+\\+\\+ \\(.+?\\)\t?\n") + (unless (equal (match-str 1) "/dev/null") + (setq file (match-str 1)))) + ((looking-at "Binary files .+ and .+ differ\n") + (setq binary t)) + ((looking-at "Binary files differ\n") + (setq binary t)) + ;; TODO Use all combined diff extended headers. + ((looking-at "mode .+\n")) + ((error "BUG: Unknown extended header: %S" + (buffer-substring (point) (line-end-position))))) + ;; These headers are treated as some sort of special hunk. + (unless (or (string-prefix-p "old mode" (match-str 0)) + (string-prefix-p "rename" (match-str 0))) + (push (match-str 0) header)) + (magit-delete-match)) + (when orig + (setq orig (magit-decode-git-path orig))) + (setq file (magit-decode-git-path file)) + (setq header (nreverse header)) + ;; KLUDGE `git-log' ignores `--no-prefix' when `-L' is used. + (when (and (derived-mode-p 'magit-log-mode) + (seq-some (##string-prefix-p "-L" %) + magit-buffer-log-args)) + (when orig + (setq orig (substring orig 2))) + (setq file (substring file 2)) + (setq header (list (save-excursion + (string-match "diff [^ ]+" (car header)) + (format "%s %s %s\n" + (match-str 0 (car header)) + (or orig file) + (or file orig))) + (format "--- %s\n" (or orig "/dev/null")) + (format "+++ %s\n" (or file "/dev/null"))))) + (setq header (string-join header)) + (magit-diff-insert-file-section + file orig status modes rename header binary nil))))) (defun magit-diff-insert-file-section (file orig status modes rename header binary long-status) @@ -2605,56 +2855,56 @@ function errors." (magit-delete-line) (setq modified t)) (cond - ((and (looking-at "^Submodule \\([^ ]+\\) \\([^ :]+\\)\\( (rewind)\\)?:$") - (equal (match-str 1) module)) - (magit-bind-match-strings (_module range rewind) nil - (magit-delete-line) - (while (looking-at "^ \\([<>]\\) \\(.*\\)$") - (magit-delete-line)) - (when rewind - (setq range (replace-regexp-in-string "[^.]\\(\\.\\.\\)[^.]" - "..." range t t 1))) - (magit-insert-section (module module t) - (magit-insert-heading - (magit-format-file 'module module 'magit-diff-file-heading - "modified") - " (" - (cond (rewind "rewind") - ((string-search "..." range) "non-ff") - ("new commits")) - (and (or modified untracked) - (concat ", " - (and modified "modified") - (and modified untracked " and ") - (and untracked "untracked") - " content")) - ")") - (magit-insert-section-body - (let ((default-directory - (file-name-as-directory - (expand-file-name module (magit-toplevel))))) - (magit-git-wash (apply-partially #'magit-log-wash-log 'module) - "log" "--oneline" "--left-right" range) - (delete-char -1)))))) - ((and (looking-at "^Submodule \\([^ ]+\\) \\([^ ]+\\) (\\([^)]+\\))$") - (equal (match-str 1) module)) - (magit-bind-match-strings (_module _range msg) nil - (magit-delete-line) - (magit-insert-section (module module) - (magit-insert-heading - (magit-format-file 'module module 'magit-diff-file-heading - "submodule") - " (" msg ")")))) - (t - (magit-insert-section (module module) - (magit-insert-heading - (magit-format-file 'module module 'magit-diff-file-heading - "modified") - " (" - (and modified "modified") - (and modified untracked " and ") - (and untracked "untracked") - " content)"))))))) + ((and (looking-at "^Submodule \\([^ ]+\\) \\([^ :]+\\)\\( (rewind)\\)?:$") + (equal (match-str 1) module)) + (magit-bind-match-strings (_module range rewind) nil + (magit-delete-line) + (while (looking-at "^ \\([<>]\\) \\(.*\\)$") + (magit-delete-line)) + (when rewind + (setq range (replace-regexp-in-string "[^.]\\(\\.\\.\\)[^.]" + "..." range t t 1))) + (magit-insert-section (module module t) + (magit-insert-heading + (magit-format-file 'module module 'magit-diff-file-heading + "modified") + " (" + (cond (rewind "rewind") + ((string-search "..." range) "non-ff") + ("new commits")) + (and (or modified untracked) + (concat ", " + (and modified "modified") + (and modified untracked " and ") + (and untracked "untracked") + " content")) + ")") + (magit-insert-section-body + (let ((default-directory + (file-name-as-directory + (expand-file-name module (magit-toplevel))))) + (magit-git-wash (apply-partially #'magit-log-wash-log 'module) + "log" "--oneline" "--left-right" range) + (delete-char -1)))))) + ((and (looking-at "^Submodule \\([^ ]+\\) \\([^ ]+\\) (\\([^)]+\\))$") + (equal (match-str 1) module)) + (magit-bind-match-strings (_module _range msg) nil + (magit-delete-line) + (magit-insert-section (module module) + (magit-insert-heading + (magit-format-file 'module module 'magit-diff-file-heading + "submodule") + " (" msg ")")))) + (t + (magit-insert-section (module module) + (magit-insert-heading + (magit-format-file 'module module 'magit-diff-file-heading + "modified") + " (" + (and modified "modified") + (and modified untracked " and ") + (and untracked "untracked") + " content)"))))))) (defun magit-diff-wash-hunk () (when (looking-at "^@\\{2,\\} \\(.+?\\) @\\{2,\\}\\(?: \\(.*\\)\\)?") @@ -2733,16 +2983,16 @@ Staging and applying changes is documented in info node (defun magit-revision-setup-buffer (rev args files) (magit-setup-buffer #'magit-revision-mode nil (magit-buffer-revision rev) - (magit-buffer-range (format "%s^..%s" rev rev)) + (magit-buffer-diff-range (format "%s^..%s" rev rev)) (magit-buffer-diff-type 'committed) (magit-buffer-diff-args args) (magit-buffer-diff-files files) (magit-buffer-diff-files-suspended nil))) (defun magit-revision-refresh-buffer () - (setq magit-buffer-revision-hash (magit-rev-hash magit-buffer-revision)) + (setq magit-buffer-revision-oid (magit-commit-oid magit-buffer-revision)) (magit-set-header-line-format - (concat (magit-object-type magit-buffer-revision-hash) + (concat (magit-object-type magit-buffer-revision) " " magit-buffer-revision (pcase (length magit-buffer-diff-files) (0) @@ -2771,7 +3021,7 @@ Staging and applying changes is documented in info node This function only inserts anything when `magit-show-commit' is called with a tag as argument, when that is called with a commit or a ref which is not a branch, then it inserts nothing." - (when (equal (magit-object-type magit-buffer-revision) "tag") + (when (magit-tag-p magit-buffer-revision) (magit-insert-section (taginfo) (let ((beg (point))) ;; "git verify-tag -v" would output what we need, but the gpg @@ -2806,15 +3056,14 @@ or a ref which is not a branch, then it inserts nothing." (goto-char (match-beginning 0)) (goto-char (point-max))) (insert ?\n)) - (if (re-search-forward "-----BEGIN PGP SIGNATURE-----" nil t) - (progn - (let ((beg (match-beginning 0))) - (re-search-forward "-----END PGP SIGNATURE-----\n") - (delete-region beg (point))) - (save-excursion - (magit-process-git t "verify-tag" magit-buffer-revision)) - (magit-diff-wash-signature magit-buffer-revision)) - (goto-char (point-max))) + (cond ((re-search-forward "-----BEGIN PGP SIGNATURE-----" nil t) + (let ((beg (match-beginning 0))) + (re-search-forward "-----END PGP SIGNATURE-----\n") + (delete-region beg (point))) + (save-excursion + (magit-process-git t "verify-tag" magit-buffer-revision)) + (magit-diff-wash-signature magit-buffer-revision)) + ((goto-char (point-max)))) (insert ?\n)))) (defvar-keymap magit-commit-message-section-map @@ -3091,7 +3340,7 @@ Refer to user option `magit-revision-insert-related-refs-display-alist'." (defun magit-merge-preview-setup-buffer (rev) (magit-setup-buffer #'magit-merge-preview-mode nil (magit-buffer-revision rev) - (magit-buffer-range (format "%s^..%s" rev rev)))) + (magit-buffer-diff-range (format "%s^..%s" rev rev)))) (defun magit-merge-preview-refresh-buffer () (let* ((branch (magit-get-current-branch)) @@ -3126,14 +3375,14 @@ It the SECTION has a different type, then do nothing." (while (looking-at "^[ @]") (forward-line)) (let ((beg (magit-point))) (list (cond - ((looking-at "^[-+]") - (forward-line) - (while (looking-at "^[-+]") (forward-line)) - (while (looking-at "^ ") (forward-line)) - (forward-line -1) - (regexp-quote (buffer-substring-no-properties - beg (line-end-position)))) - (t)))))))) + ((looking-at "^[-+]") + (forward-line) + (while (looking-at "^[-+]") (forward-line)) + (while (looking-at "^ ") (forward-line)) + (forward-line -1) + (regexp-quote (buffer-substring-no-properties + beg (line-end-position)))) + (t)))))))) (cl-defmethod magit-section-goto-successor ((section magit-hunk-section) line char &optional arg) @@ -3234,21 +3483,19 @@ Do not confuse this with `magit-diff-scope' (which see)." (when-let ((section (or section (magit-current-section)))) (cond ((derived-mode-p 'magit-revision-mode 'magit-stash-mode) 'committed) ((derived-mode-p 'magit-diff-mode) - (let ((range magit-buffer-range) - (const magit-buffer-typearg)) - (cond (magit-buffer-diff-type) - ((equal const "--no-index") 'undefined) - ((or (not range) - (equal range "HEAD") - (magit-rev-eq range "HEAD")) - (if (equal const "--cached") - 'staged - 'unstaged)) - ((equal const "--cached") - (if (magit-rev-head-p range) - 'staged - 'undefined)) ; i.e., committed and staged - ('committed)))) + (cond + (magit-buffer-diff-type) + ((equal magit-buffer-diff-typearg "--no-index") + 'undefined) + ((not magit-buffer-diff-range) + 'undefined) + ((string-search "." magit-buffer-diff-range) + 'committed) + ((magit-rev-head-p magit-buffer-diff-range) + (if (equal magit-buffer-diff-typearg "--cached") + 'staged + 'unstaged)) + ('committed))) ((derived-mode-p 'magit-status-mode) (pcase (oref section type) ((and type (or 'staged 'unstaged 'tracked 'untracked)) @@ -3356,7 +3603,7 @@ actually a `diff' but a `diffstat' section." (magit-diff-on-removed-line-p) (oref file-section source)) (oref file-section value)))) - (if (equal magit-buffer-typearg "--no-index") + (if (equal magit-buffer-diff-typearg "--no-index") (concat "/" file) (expand-file-name file (magit-toplevel))))) @@ -3369,46 +3616,78 @@ actually a `diff' but a `diffstat' section." (let ((end (oref section end)) (merging (looking-at "@@@")) (diff-type (magit-diff-type)) - (stage nil) + (sign-face-side nil) + (line-face-side nil) (tab-width (magit-diff-tab-width (magit-section-parent-value section)))) (forward-line) (while (< (point) end) - (when (and magit-diff-hide-trailing-cr-characters - (char-equal ?\r (char-before (line-end-position)))) - (put-text-property (1- (line-end-position)) (line-end-position) - 'invisible t)) - (put-text-property - (point) (1+ (line-end-position)) 'font-lock-face - (cond - ((looking-at "^\\+\\+?\\([<=|>]\\)\\{7\\}") - (setq stage (pcase (list (match-str 1) highlight) - ('("<" nil) 'magit-diff-our) - ('("<" t) 'magit-diff-our-highlight) - ('("|" nil) 'magit-diff-base) - ('("|" t) 'magit-diff-base-highlight) - ('("=" nil) 'magit-diff-their) - ('("=" t) 'magit-diff-their-highlight) - ('(">" nil) nil))) - (if highlight - 'magit-diff-conflict-heading-highlight - 'magit-diff-conflict-heading)) - ((looking-at (if merging "^\\(\\+\\| \\+\\)" "^\\+")) - (magit-diff-paint-tab merging tab-width) - (magit-diff-paint-whitespace merging 'added diff-type) - (or stage - (if highlight 'magit-diff-added-highlight 'magit-diff-added))) - ((looking-at (if merging "^\\(-\\| -\\)" "^-")) - (magit-diff-paint-tab merging tab-width) - (magit-diff-paint-whitespace merging 'removed diff-type) - (if highlight 'magit-diff-removed-highlight 'magit-diff-removed)) - (t - (magit-diff-paint-tab merging tab-width) - (magit-diff-paint-whitespace merging 'context diff-type) - (if highlight 'magit-diff-context-highlight 'magit-diff-context)))) + (let ((bol (point)) + (eol (line-end-position)) + (sign-face nil) + (line-face nil)) + (when (and magit-diff-hide-trailing-cr-characters + (char-equal ?\r (char-before eol))) + (put-text-property (1- eol) eol 'invisible t)) + (cond + ((looking-at "^\\+\\+?\\([<=|>]\\)\\{7\\}") + (setq line-face + (pcase (match-str 1) + ("<" 'magit-diff-our-heading) + ("|" 'magit-diff-base-heading) + ("=" 'magit-diff-their-heading) + (">" 'magit-diff-their-heading))) + (setq sign-face-side + (pcase (match-str 1) + ("<" 'magit-diff-our-indicator) + ("|" 'magit-diff-base-indicator) + ("=" 'magit-diff-their-indicator) + (">" nil))) + (setq line-face-side + (pcase (list (match-str 1) highlight) + ('("<" nil) 'magit-diff-our) + ('("<" t) 'magit-diff-our-highlight) + ('("|" nil) 'magit-diff-base) + ('("|" t) 'magit-diff-base-highlight) + ('("=" nil) 'magit-diff-their) + ('("=" t) 'magit-diff-their-highlight) + ;; `(">" ,_) results in bogus warning. + ('(">" nil) nil) + ('(">" t) nil)))) + ((looking-at (if merging "^\\(\\+\\| \\+\\)" "^\\+")) + (magit-diff-paint-tab merging tab-width) + (magit-diff-paint-whitespace merging 'added diff-type) + (cond (line-face-side + (setq sign-face sign-face-side) + (setq line-face line-face-side)) + (t + (setq sign-face 'magit-diff-added-indicator) + (setq line-face (if highlight + 'magit-diff-added-highlight + 'magit-diff-added))))) + ((looking-at (if merging "^\\(-\\| -\\)" "^-")) + (magit-diff-paint-tab merging tab-width) + (magit-diff-paint-whitespace merging 'removed diff-type) + (setq sign-face 'magit-diff-removed-indicator) + (setq line-face (if highlight + 'magit-diff-removed-highlight + 'magit-diff-removed))) + (t + (magit-diff-paint-tab merging tab-width) + (magit-diff-paint-whitespace merging 'context diff-type) + (setq line-face (if highlight + 'magit-diff-context-highlight + 'magit-diff-context)))) + (put-text-property bol (1+ eol) 'font-lock-face line-face) + (when (and sign-face magit-diff-use-indicator-faces) + (magit--add-face-text-property + bol (+ bol (if merging 2 1)) sign-face))) (forward-line))) - (when (eq magit-diff-refine-hunk 'all) - (magit-diff-update-hunk-refinement section)) + (unless (magit--meta-hunk-p section) + (when (eq magit-diff-fontify-hunk 'all) + (magit-diff--update-hunk-syntax section)) + (when (eq magit-diff-refine-hunk 'all) + (magit-diff-update-hunk-refinement section))) (oset section painted (if highlight 'highlight 'plain))) ;;;; Whitespace @@ -3482,8 +3761,11 @@ actually a `diff' but a `diffstat' section." ;;;; Refinement (cl-defmethod magit-section--refine ((section magit-hunk-section)) - (when (eq magit-diff-refine-hunk t) - (magit-diff-update-hunk-refinement section))) + (unless (magit--meta-hunk-p section) + (when (eq magit-diff-fontify-hunk t) + (magit-diff--update-hunk-syntax section)) + (when (eq magit-diff-refine-hunk t) + (magit-diff-update-hunk-refinement section)))) (defun magit-diff-update-hunk-refinement (&optional section allow-remove) (if section @@ -3514,6 +3796,53 @@ actually a `diff' but a `diffstat' section." (dolist (child (oref section children)) (update child)))))) +;;;; Syntax + +(defun magit-diff--update-hunk-syntax (&optional hunk) + (if hunk + (pcase-let (((eieio fontified content end) hunk)) + (unless fontified + (oset hunk fontified t) + (save-excursion + (goto-char content) + (pcase-let* + ((`(,old ,new) (magit-diff-visit--sides)) + (old (apply #'magit-diff--get-hunk-syntax hunk 'old old)) + (new (apply #'magit-diff--get-hunk-syntax hunk 'new new))) + (while (< (point) end) + (pcase-dolist (`(,b ,e ,face) + (pcase (char-after (point)) + (?- (pop old)) + (?+ (pop new)) + (?\s (pop old) + (pop new)))) + (let ((o (make-overlay (+ (point) 1 b) (+ (point) 1 e) nil t))) + (overlay-put o 'evaporate t) + (overlay-put o 'face face))) + (forward-line 1)))))) + (named-let update ((section magit-root-section)) + (if (magit-section-match 'hunk section) + (unless (magit--meta-hunk-p section) + (magit-diff--update-hunk-syntax section)) + (dolist (child (oref section children)) + (update child)))))) + +(defun magit-diff--get-hunk-syntax (hunk side rev file) + (let ((args (magit-diff--get-hunk-text hunk (eq side 'old)))) + (unless (listp (car (cadr args))) ; TODO Support unmerged changes. + (with-current-buffer (magit-find-file-noselect rev file t t) + (save-excursion + (apply #'diff-syntax-fontify-props nil args)))))) + +(defun magit-diff--get-hunk-text (hunk from) + (pcase-let* (((eieio start end from-range to-range) hunk) + (`(,line ,lines) (if from from-range to-range))) + (with-demoted-errors "Error getting hunk text: %S" + (list (string-trim-right + (diff-hunk-text (buffer-substring-no-properties start end) + (not from) nil)) + (list line lines))))) + ;;; Hunk Region (defun magit-diff-hunk-region-beginning () @@ -3648,10 +3977,11 @@ If `magit-diff-visit-previous-blob' is nil, then always return nil." (setq section (oref section parent))) (and (magit-file-section-p section) (let ((header (oref section header))) - (if no-rename - (replace-regexp-in-string - "^--- \\(.+\\)" (oref section value) header t t 1) - header)))) + (if (or (not no-rename) + (string-match-p "^--- /dev/null" header)) + header + (replace-regexp-in-string + "^--- \\(.+\\)" (oref section value) header t t 1))))) (defun magit-diff-hunk-region-header (section) (let ((patch (magit-diff-hunk-region-patch section))) @@ -3691,6 +4021,7 @@ If `magit-diff-visit-previous-blob' is nil, then always return nil." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-dired.el b/elpa/magit-20260422.2206/magit-dired.el similarity index 97% rename from elpa/magit-20251217.1836/magit-dired.el rename to elpa/magit-20260422.2206/magit-dired.el index b7384e27..be67f9fa 100644 --- a/elpa/magit-20251217.1836/magit-dired.el +++ b/elpa/magit-20260422.2206/magit-dired.el @@ -1,6 +1,6 @@ ;;; magit-dired.el --- Dired support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -116,6 +116,7 @@ Interactively, open the file at point." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-ediff.el b/elpa/magit-20260422.2206/magit-ediff.el similarity index 67% rename from elpa/magit-20251217.1836/magit-ediff.el rename to elpa/magit-20260422.2206/magit-ediff.el index 015eade5..2c5a9520 100644 --- a/elpa/magit-20251217.1836/magit-ediff.el +++ b/elpa/magit-20260422.2206/magit-ediff.el @@ -1,6 +1,6 @@ ;;; magit-ediff.el --- Ediff extension for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -42,19 +42,17 @@ :group 'magit-extensions) (defcustom magit-ediff-quit-hook - (list #'magit-ediff-cleanup-auxiliary-buffers - #'magit-ediff-restore-previous-winconf) + (list #'magit-ediff-restore-previous-winconf) "Hooks to run after finishing Ediff, when that was invoked using Magit. The hooks are run in the Ediff control buffer. This is similar to `ediff-quit-hook' but takes the needs of Magit into account. The `ediff-quit-hook' is ignored by Ediff sessions which were invoked using Magit." - :package-version '(magit . "2.2.0") + :package-version '(magit . "4.6.0") :group 'magit-ediff :type 'hook :get #'magit-hook-custom-get - :options (list #'magit-ediff-cleanup-auxiliary-buffers - #'magit-ediff-restore-previous-winconf)) + :options (list #'magit-ediff-restore-previous-winconf)) (defcustom magit-ediff-dwim-resolve-function #'magit-ediff-resolve-rest "The function `magit-ediff-dwim' uses to resolve conflicts." @@ -115,7 +113,7 @@ recommend you do not further complicate that by enabling this.") (defvar magit-ediff-previous-winconf nil) -;;;###autoload(autoload 'magit-ediff "magit-ediff" nil) +;;;###autoload(autoload 'magit-ediff "magit-ediff" nil t) (transient-define-prefix magit-ediff () "Show differences using the Ediff package." :info-manual "(ediff)" @@ -132,86 +130,8 @@ recommend you do not further complicate that by enabling this.") ("r" "Show range" magit-ediff-compare) ("z" "Show stash" magit-ediff-show-stash)]]) -(defmacro magit-ediff-buffers (a b &optional c setup quit file) - "Run Ediff on two or three buffers. -This is a wrapper around `ediff-buffers-internal'. - -A, B and C have the form (GET-BUFFER CREATE-BUFFER). If -GET-BUFFER returns a non-nil value, then that buffer is used and -it is not killed when exiting Ediff. Otherwise CREATE-BUFFER -must return a buffer and that is killed when exiting Ediff. - -If non-nil, SETUP must be a function. It is called without -arguments after Ediff is done setting up buffers. - -If non-nil, QUIT must be a function. It is added to -`ediff-quit-hook' and is called without arguments. - -If FILE is non-nil, then perform a merge. The merge result -is put in FILE." - (let (get make kill (char ?A)) - (dolist (spec (list a b c)) - (if (not spec) - (push nil make) - (pcase-let ((`(,g ,m) spec)) - (let ((b (intern (format "buf%c" char)))) - (push `(,b ,g) get) - ;; This is an unfortunate complication that I have added for - ;; the benefit of one user. Pretend we used this instead: - ;; (push `(or ,b ,m) make) - (push `(if ,b - (if magit-ediff-use-indirect-buffers - (prog1 (make-indirect-buffer - ,b - (generate-new-buffer-name (buffer-name ,b)) - t) - (setq ,b nil)) - ,b) - ,m) - make) - (push `(unless ,b - ;; For merge jobs Ediff switches buffer names around. - ;; See (if ediff-merge-job ...) in `ediff-setup'. - (let ((var ,(if (and file (= char ?C)) - 'ediff-ancestor-buffer - (intern (format "ediff-buffer-%c" char))))) - (ediff-kill-buffer-carefully var))) - kill)) - (cl-incf char)))) - (setq get (nreverse get)) - (setq make (nreverse make)) - (setq kill (nreverse kill)) - (let ((mconf (gensym "conf")) - (mfile (gensym "file"))) - `(magit-with-toplevel - (let ((,mconf (current-window-configuration)) - (,mfile ,file) - ,@get) - (ediff-buffers-internal - ,@make - (list ,@(and setup (list setup)) - (lambda () - ;; We do not want to kill buffers that existed before - ;; Ediff was invoked, so we cannot use Ediff's default - ;; quit functions. Ediff splits quitting across two - ;; hooks for merge jobs but we only ever use one. - (setq-local ediff-quit-merge-hook nil) - (setq-local ediff-quit-hook - (list - ,@(and quit (list quit)) - (lambda () - ,@kill - (let ((magit-ediff-previous-winconf ,mconf)) - (run-hooks 'magit-ediff-quit-hook))))))) - (pcase (list ,(and c t) (and ,mfile t)) - ('(nil nil) 'ediff-buffers) - ('(nil t) 'ediff-merge-buffers) - ('(t nil) 'ediff-buffers3) - ('(t t) 'ediff-merge-buffers-with-ancestor)) - ,mfile)))))) - -;;;###autoload -(defun magit-ediff-resolve-all (file) +;;;###autoload(autoload 'magit-ediff-resolve-all "magit-ediff" nil t) +(transient-define-suffix magit-ediff-resolve-all (file) "Resolve all conflicts in the FILE at point using Ediff. If there is no file at point or if it doesn't have any unmerged @@ -219,16 +139,17 @@ changes, then prompt for a file. See info node `(magit) Ediffing' for more information about this and alternative commands." + :inapt-if-not #'magit-anything-unmerged-p (interactive (list (magit-read-unmerged-file))) (magit-with-toplevel (let* ((dir (magit-gitdir)) (revA (or (magit-name-branch "HEAD") - (magit-commit-p "HEAD"))) + (magit-commit-oid "HEAD"))) (revB (cl-find-if (##file-exists-p (expand-file-name % dir)) '("MERGE_HEAD" "CHERRY_PICK_HEAD" "REVERT_HEAD"))) (revB (or (magit-name-branch revB) - (magit-commit-p revB))) - (revC (magit-commit-p (magit-git-string "merge-base" revA revB))) + (magit-commit-oid revB))) + (revC (magit-commit-oid (magit-git-string "merge-base" revA revB))) (fileA (magit--rev-file-name file revA revB)) (fileB (magit--rev-file-name file revB revA)) (fileC (or (magit--rev-file-name file revC revA) @@ -256,7 +177,7 @@ and alternative commands." ,(format ">>>>>>> %s" revB))))) (quit (lambda () ;; For merge jobs Ediff switches buffer names around. - ;; At this point `ediff-buffer-C' no longer refer to + ;; At this point `ediff-buffer-C' no longer refers to ;; the ancestor buffer but to the merge result buffer. ;; See (if ediff-merge-job ...) in `ediff-setup'. (when (buffer-live-p ediff-buffer-C) @@ -266,24 +187,14 @@ and alternative commands." (goto-char (point-min)) (unless (re-search-forward "^<<<<<<< " nil t) (magit-stage-files (list file))))))))) - (cond (fileC - (magit-ediff-buffers - ((magit-get-revision-buffer revA fileA) - (magit-find-file-noselect revA fileA)) - ((magit-get-revision-buffer revB fileB) - (magit-find-file-noselect revB fileB)) - ((magit-get-revision-buffer revC fileC) - (magit-find-file-noselect revC fileC)) - setup quit file)) - ((magit-ediff-buffers - ((magit-get-revision-buffer revA fileA) - (magit-find-file-noselect revA fileA)) - ((magit-get-revision-buffer revB fileB) - (magit-find-file-noselect revB fileB)) - nil setup quit file))))))) - -;;;###autoload -(defun magit-ediff-resolve-rest (file) + (magit-ediff-buffers + (magit-ediff--find-file revA fileA) + (magit-ediff--find-file revB fileB) + (and fileC (magit-ediff--find-file revC fileC)) + setup quit file))))) + +;;;###autoload(autoload 'magit-ediff-resolve-rest "magit-ediff" nil t) +(transient-define-suffix magit-ediff-resolve-rest (file) "Resolve outstanding conflicts in the FILE at point using Ediff. If there is no file at point or if it doesn't have any unmerged @@ -291,6 +202,7 @@ changes, then prompt for a file. See info node `(magit) Ediffing' for more information about this and alternative commands." + :inapt-if-not #'magit-anything-unmerged-p (interactive (list (magit-read-unmerged-file))) (magit-with-toplevel (with-current-buffer (find-file-noselect file) @@ -314,36 +226,38 @@ and alternative commands." (let ((magit-ediff-previous-winconf smerge-ediff-windows)) (run-hooks 'magit-ediff-quit-hook))))))) -;;;###autoload -(defun magit-ediff-stage (file) +;;;###autoload(autoload 'magit-ediff-stage "magit-ediff" nil t) +(transient-define-suffix magit-ediff-stage (file) "Stage and unstage changes to FILE using Ediff. FILE has to be relative to the top directory of the repository." + :inapt-if-not #'magit-anything-modified-p (interactive - (let ((files (magit-tracked-files))) - (list (magit-completing-read "Selectively stage file" files nil t nil nil - (car (member (magit-current-file) files)))))) + (let ((files (magit-tracked-files))) + (list (magit-completing-read "Selectively stage file" files nil t nil nil + (car (member (magit-current-file) files)))))) (magit-with-toplevel - (let* ((bufA (magit-get-revision-buffer "HEAD" file)) - (bufB (magit-get-revision-buffer "{index}" file)) - (lockB (and bufB (buffer-local-value 'buffer-read-only bufB))) - (bufC (get-file-buffer file)) + (let* ((bufC (magit-ediff--find-file "{worktree}" file)) ;; Use the same encoding for all three buffers or we ;; may end up changing the file in an unintended way. - (bufC* (or bufC (find-file-noselect file))) (coding-system-for-read - (buffer-local-value 'buffer-file-coding-system bufC*)) - (bufA* (magit-find-file-noselect "HEAD" file t)) - (bufB* (magit-find-file-index-noselect file t))) - (with-current-buffer bufB* (setq buffer-read-only nil)) + (buffer-local-value 'buffer-file-coding-system bufC)) + (bufA (magit-ediff--find-file "HEAD" file)) + (bufB (magit-ediff--find-file "{index}" file)) + (lockB (buffer-local-value 'buffer-read-only bufB)) + (modeB (buffer-local-value 'magit-blob-mode bufB))) + (with-current-buffer bufB + ;; Make writable and don't shadow self-insert-command. + (magit-blob-mode -1)) (magit-ediff-buffers - (bufA bufA*) - (bufB bufB*) - (bufC bufC*) - nil + bufA bufB bufC nil (lambda () (when (buffer-live-p ediff-buffer-B) (when lockB - (with-current-buffer bufB (setq buffer-read-only t))) + (with-current-buffer bufB + (if modeB + (magit-blob-mode 1) + (setq-local buffer-read-only t) + (setq-local read-only-mode--state t)))) (when (buffer-modified-p ediff-buffer-B) (with-current-buffer ediff-buffer-B (magit-update-index)))) @@ -353,13 +267,12 @@ FILE has to be relative to the top directory of the repository." (when (y-or-n-p (format "Save file %s? " buffer-file-name)) (save-buffer))))))))) -;;;###autoload -(defun magit-ediff-compare (revA revB fileA fileB) +;;;###autoload(autoload 'magit-ediff-compare "magit-ediff" nil t) +(transient-define-suffix magit-ediff-compare (revA revB fileA fileB) "Compare REVA:FILEA with REVB:FILEB using Ediff. FILEA and FILEB have to be relative to the top directory of the -repository. If REVA or REVB is nil, then this stands for the -working tree state. +repository. If the region is active, use the revisions on the first and last line of the region. With a prefix argument, instead of diffing @@ -367,15 +280,13 @@ the revisions, choose a revision to view changes along, starting at the common ancestor of both revisions (i.e., use a \"...\" range)." (interactive - (pcase-let ((`(,revA ,revB) (magit-ediff-compare--read-revisions - nil current-prefix-arg))) - (nconc (list revA revB) - (magit-ediff-read-files revA revB)))) + (pcase-let ((`(,revA ,revB) (magit-ediff-compare--read-revisions + nil current-prefix-arg))) + (nconc (list revA revB) + (magit-ediff-read-files revA revB)))) (magit-ediff-buffers - ((if revA (magit-get-revision-buffer revA fileA) (get-file-buffer fileA)) - (if revA (magit-find-file-noselect revA fileA) (find-file-noselect fileA))) - ((if revB (magit-get-revision-buffer revB fileB) (get-file-buffer fileB)) - (if revB (magit-find-file-noselect revB fileB) (find-file-noselect fileB))))) + (magit-ediff--find-file revA fileA) + (magit-ediff--find-file revB fileB))) (defun magit-ediff-compare--read-revisions (&optional arg mbase) (let ((input (or arg (magit-diff-read-range-or-commit @@ -383,12 +294,14 @@ range)." nil mbase)))) (if-let ((range (magit-split-range input))) (list (car range) (cdr range)) - (list input nil)))) + (list input "{worktree}")))) (defun magit-ediff-read-files (revA revB &optional fileB) "Read file in REVB, return it and the corresponding file in REVA. When FILEB is non-nil, use this as REVB's file instead of prompting for it." + (when (equal revA "{worktree}") (setq revA nil)) + (when (equal revB "{worktree}") (setq revB nil)) (unless (and fileB (member fileB (magit-revision-files revB))) (setq fileB (or (and fileB @@ -416,8 +329,8 @@ prompting for it." revA revB))) fileB)) -;;;###autoload -(defun magit-ediff-dwim () +;;;###autoload(autoload 'magit-ediff-dwim "magit-ediff" nil t) +(transient-define-suffix magit-ediff-dwim () "Compare, stage, or resolve using Ediff. This command tries to guess what file, and what commit or range the user wants to compare, stage, or resolve using Ediff. It @@ -459,7 +372,7 @@ mind at all, then it asks the user for a command to run." (pcase (magit-diff-type) ('committed (pcase-let ((`(,a ,b) (magit-ediff-compare--read-revisions - magit-buffer-range))) + magit-buffer-diff-range))) (setq revA a) (setq revB b))) ((guard (not magit-ediff-dwim-show-on-hunks)) @@ -490,55 +403,52 @@ mind at all, then it asks the user for a command to run." (funcall command file)) ((call-interactively command))))))) -;;;###autoload -(defun magit-ediff-show-staged (file) +;;;###autoload(autoload 'magit-ediff-show-staged "magit-ediff" nil t) +(transient-define-suffix magit-ediff-show-staged (file) "Show staged changes using Ediff. This only allows looking at the changes; to stage, unstage, and discard changes using Ediff, use `magit-ediff-stage'. FILE must be relative to the top directory of the repository." + :inapt-if-not #'magit-anything-staged-p (interactive - (list (magit-read-file-choice "Show staged changes for file" - (magit-staged-files) - "No staged files"))) - (magit-ediff-buffers ((magit-get-revision-buffer "HEAD" file) - (magit-find-file-noselect "HEAD" file)) - ((get-buffer (concat file ".~{index}~")) - (magit-find-file-index-noselect file t)))) - -;;;###autoload -(defun magit-ediff-show-unstaged (file) + (list (magit-read-file-choice "Show staged changes for file" + (magit-staged-files) + "No staged files"))) + (magit-ediff-buffers (magit-ediff--find-file "HEAD" file) + (magit-ediff--find-file "{index}" file))) + +;;;###autoload(autoload 'magit-ediff-show-unstaged "magit-ediff" nil t) +(transient-define-suffix magit-ediff-show-unstaged (file) "Show unstaged changes using Ediff. This only allows looking at the changes; to stage, unstage, and discard changes using Ediff, use `magit-ediff-stage'. FILE must be relative to the top directory of the repository." + :inapt-if-not #'magit-anything-unstaged-p (interactive - (list (magit-read-file-choice "Show unstaged changes for file" - (magit-unstaged-files) - "No unstaged files"))) - (magit-ediff-buffers ((get-buffer (concat file ".~{index}~")) - (magit-find-file-index-noselect file t)) - ((get-file-buffer file) - (find-file-noselect file)))) - -;;;###autoload -(defun magit-ediff-show-working-tree (file) + (list (magit-read-file-choice "Show unstaged changes for file" + (magit-unstaged-files) + "No unstaged files"))) + (magit-ediff-buffers (magit-ediff--find-file "{index}" file) + (magit-ediff--find-file "{worktree}" file))) + +;;;###autoload(autoload 'magit-ediff-show-working-tree "magit-ediff" nil t) +(transient-define-suffix magit-ediff-show-working-tree (file) "Show changes between `HEAD' and working tree using Ediff. FILE must be relative to the top directory of the repository." + :inapt-if-not #'magit-anything-modified-p (interactive - (list (magit-read-file-choice "Show changes in file" - (magit-changed-files "HEAD") - "No changed files"))) - (magit-ediff-buffers ((magit-get-revision-buffer "HEAD" file) - (magit-find-file-noselect "HEAD" file)) - ((get-file-buffer file) - (find-file-noselect file)))) - -;;;###autoload -(defun magit-ediff-show-commit (commit) + (list (magit-read-file-choice "Show changes in file" + (magit-modified-files) + "No changed files"))) + (magit-ediff-buffers (magit-ediff--find-file "HEAD" file) + (magit-ediff--find-file "{worktree}" file))) + +;;;###autoload(autoload 'magit-ediff-show-commit "magit-ediff" nil t) +(transient-define-suffix magit-ediff-show-commit (commit) "Show changes introduced by COMMIT using Ediff." (interactive (list (magit-read-branch-or-commit "Revision"))) (let ((revA (concat commit "^")) @@ -547,12 +457,13 @@ FILE must be relative to the top directory of the repository." revA revB (magit-ediff-read-files revA revB (magit-current-file))))) -;;;###autoload -(defun magit-ediff-show-stash (stash) +;;;###autoload(autoload 'magit-ediff-show-stash "magit-ediff" nil t) +(transient-define-suffix magit-ediff-show-stash (stash) "Show changes introduced by STASH using Ediff. -`magit-ediff-show-stash-with-index' controls whether a -three-buffer Ediff is used in order to distinguish changes in the -stash that were staged." +`magit-ediff-show-stash-with-index' controls whether a three-buffer +Ediff is used in order to distinguish changes in the stash that were +staged." + :inapt-if-not #'magit-list-stashes (interactive (list (magit-read-stash "Stash"))) (pcase-let* ((revA (concat stash "^1")) (revB (concat stash "^2")) @@ -562,15 +473,64 @@ stash that were staged." (if (and magit-ediff-show-stash-with-index (member fileA (magit-changed-files revB revA))) (magit-ediff-buffers - ((magit-get-revision-buffer revA fileA) - (magit-find-file-noselect revA fileA)) - ((magit-get-revision-buffer revB fileB) - (magit-find-file-noselect revB fileB)) - ((magit-get-revision-buffer revC fileC) - (magit-find-file-noselect revC fileC))) + (magit-ediff--find-file revA fileA) + (magit-ediff--find-file revB fileB) + (magit-ediff--find-file revC fileC)) (magit-ediff-compare revA revC fileA fileC)))) -(defun magit-ediff-cleanup-auxiliary-buffers () +;;; Setup + +(defun magit-ediff-buffers (a b &optional c setup quit file) + "Run Ediff on two or three buffers A, B and C. + +If optional FILE is non-nil, then perform a merge. The merge result +is put in FILE. + +Neutralize the hooks `ediff-quit-hook' and `ediff-quit-merge-hook' +because they usually feature functions that do not work for Magit. +Instead run optional QUIT (if non-nil), `magit-ediff--cleanup-buffers' +and `magit-ediff-quit-hook', with no arguments. + +Optional SETUP, if non-nil, is called with no arguments after Ediff +is done setting up buffers." + (magit-with-toplevel + (ediff-buffers-internal + a b c + (let ((winconf (current-window-configuration))) + (list (lambda () + (when setup + (funcall setup)) + (setq-local ediff-quit-merge-hook nil) + (setq-local ediff-quit-hook nil) + (when quit + (add-hook 'ediff-quit-hook quit nil t)) + (add-hook 'ediff-quit-hook #'magit-ediff--cleanup-buffers t t) + (add-hook 'ediff-quit-hook + (lambda () + (let ((magit-ediff-previous-winconf winconf)) + (run-hooks 'magit-ediff-quit-hook))) + t t)))) + (pcase (list (and c t) (and file t)) + ('(nil nil) 'ediff-buffers) + ('(nil t) 'ediff-merge-buffers) + ('(t nil) 'ediff-buffers3) + ('(t t) 'ediff-merge-buffers-with-ancestor)) + file))) + +(defun magit-ediff--find-file (rev file) + (let ((buffer (magit-find-file-noselect rev file t 'ediff))) + (when magit-ediff-use-indirect-buffers + (setq buffer (make-indirect-buffer + buffer (generate-new-buffer-name (buffer-name buffer)) t))) + buffer)) + +;;; Quit + +(defun magit-ediff--cleanup-buffers () + (magit-ediff--bury-buffer ediff-buffer-A) + (magit-ediff--bury-buffer ediff-buffer-B) + (magit-ediff--bury-buffer ediff-buffer-C) + (magit-ediff--bury-buffer ediff-ancestor-buffer) (let* ((ctl-buf ediff-control-buffer) (ctl-win (ediff-get-visible-buffer-window ctl-buf)) (ctl-frm ediff-control-frame) @@ -596,6 +556,11 @@ stash that were staged." (when (frame-live-p main-frame) (select-frame main-frame)))) +(defun magit-ediff--bury-buffer (buffer) + (when (and (ediff-buffer-live-p buffer) + (eq (buffer-local-value 'magit-buffer--volatile buffer) 'ediff)) + (kill-buffer (get-buffer buffer)))) + (defun magit-ediff-restore-previous-winconf () (set-window-configuration magit-ediff-previous-winconf)) @@ -607,6 +572,7 @@ stash that were staged." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-extras.el b/elpa/magit-20260422.2206/magit-extras.el similarity index 86% rename from elpa/magit-20251217.1836/magit-extras.el rename to elpa/magit-20260422.2206/magit-extras.el index fce0ae13..e863f688 100644 --- a/elpa/magit-20251217.1836/magit-extras.el +++ b/elpa/magit-20260422.2206/magit-extras.el @@ -1,6 +1,6 @@ ;;; magit-extras.el --- Additional functionality for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -60,11 +60,11 @@ alternative commands." ["Actions" (" m" "Invoke mergetool" magit-git-mergetool)] (interactive - (if (and (not (eq transient-current-command 'magit-git-mergetool)) - current-prefix-arg) - (list nil nil t) - (list (magit-read-unmerged-file "Resolve") - (transient-args 'magit-git-mergetool)))) + (if (and (not (eq transient-current-command 'magit-git-mergetool)) + current-prefix-arg) + (list nil nil t) + (list (magit-read-unmerged-file "Resolve") + (transient-args 'magit-git-mergetool)))) (if transient (transient-setup 'magit-git-mergetool) (magit-run-git-async "mergetool" "--gui" args "--" file))) @@ -131,18 +131,18 @@ prefix or when the current file cannot be determined let the user choose. When the current buffer is visiting FILENAME instruct blame to center around the line point is on." (interactive - (let (revision filename) - (when (or current-prefix-arg - (progn - (setq revision "HEAD") - (not (setq filename (magit-file-relative-name nil 'tracked))))) - (setq revision (magit-read-branch-or-commit "Blame from revision")) - (setq filename (magit-read-file-from-rev revision "Blame file"))) - (list revision filename - (and (equal filename - (ignore-errors - (magit-file-relative-name buffer-file-name))) - (line-number-at-pos))))) + (let (revision filename) + (when (or current-prefix-arg + (progn + (setq revision "HEAD") + (not (setq filename (magit-file-relative-name nil 'tracked))))) + (setq revision (magit-read-branch-or-commit "Blame from revision")) + (setq filename (magit-read-file-from-rev revision "Blame file"))) + (list revision filename + (and (equal filename + (ignore-errors + (magit-file-relative-name buffer-file-name))) + (line-number-at-pos))))) (magit-with-toplevel (magit-process-git 0 "gui" "blame" (and linenum (list (format "--line=%d" linenum))) @@ -447,69 +447,69 @@ list returned by `magit-rebase-arguments'." (user-error "Refusing to reshelve detached head"))) (backup (concat "refs/original/refs/heads/" current))) (cond - ((not commit) - (when (and (magit-ref-p backup) - (not (magit-y-or-n-p - (format "Backup ref %s already exists. Override? " - backup)))) - (user-error "Abort")) - (magit-log-select - (lambda (rev) - (magit-reshelve-since rev keyid)) - "Type %p on a commit to reshelve it and the commits above it,")) - (t - (cl-flet ((adjust (time offset) - (format-time-string - "%F %T %z" - (+ (floor time) - (* offset 60) - (- (car (decode-time time))))))) - (let* ((start (concat commit "^")) - (range (concat start ".." current)) - (time-rev (adjust (float-time (string-to-number - (magit-rev-format "%at" start))) - 1)) - (time-now (adjust (float-time) - (- (string-to-number - (magit-git-string "rev-list" "--count" - range)))))) - (push time-rev magit--reshelve-history) - (let ((date (floor - (float-time - (date-to-time - (read-string "Date for first commit: " - time-now 'magit--reshelve-history)))))) - (with-environment-variables (("FILTER_BRANCH_SQUELCH_WARNING" "1")) - (magit-with-toplevel - (magit-run-git-async - "filter-branch" "--force" "--env-filter" - (format - "case $GIT_COMMIT in %s\nesac" - (mapconcat - (lambda (rev) - (prog1 - (concat - (format "%s) " rev) - (and (not magit-reshelve-since-committer-only) - (format "export GIT_AUTHOR_DATE=\"%s\"; " date)) - (format "export GIT_COMMITTER_DATE=\"%s\";;" date)) - (cl-incf date 60))) - (magit-git-lines "rev-list" "--reverse" range) - " ")) - (and keyid - (list "--commit-filter" - (format "git commit-tree --gpg-sign=%s \"$@\";" - keyid))) - range "--")) - (set-process-sentinel - magit-this-process - (lambda (process event) - (when (memq (process-status process) '(exit signal)) - (if (> (process-exit-status process) 0) - (magit-process-sentinel process event) - (process-put process 'inhibit-refresh t) - (magit-process-sentinel process event) - (magit-run-git "update-ref" "-d" backup))))))))))))) + ((not commit) + (when (and (magit-ref-p backup) + (not (magit-y-or-n-p + (format "Backup ref %s already exists. Override? " + backup)))) + (user-error "Abort")) + (magit-log-select + (lambda (rev) + (magit-reshelve-since rev keyid)) + "Type %p on a commit to reshelve it and the commits above it,")) + (t + (cl-flet ((adjust (time offset) + (format-time-string + "%F %T %z" + (+ (floor time) + (* offset 60) + (- (car (decode-time time))))))) + (let* ((start (concat commit "^")) + (range (concat start ".." current)) + (time-rev (adjust (float-time (string-to-number + (magit-rev-format "%at" start))) + 1)) + (time-now (adjust (float-time) + (- (string-to-number + (magit-git-string "rev-list" "--count" + range)))))) + (push time-rev magit--reshelve-history) + (let ((date (floor + (float-time + (date-to-time + (read-string "Date for first commit: " + time-now 'magit--reshelve-history)))))) + (with-environment-variables (("FILTER_BRANCH_SQUELCH_WARNING" "1")) + (magit-with-toplevel + (magit-run-git-async + "filter-branch" "--force" "--env-filter" + (format + "case $GIT_COMMIT in %s\nesac" + (mapconcat + (lambda (rev) + (prog1 + (concat + (format "%s) " rev) + (and (not magit-reshelve-since-committer-only) + (format "export GIT_AUTHOR_DATE=\"%s\"; " date)) + (format "export GIT_COMMITTER_DATE=\"%s\";;" date)) + (cl-incf date 60))) + (magit-git-lines "rev-list" "--reverse" range) + " ")) + (and keyid + (list "--commit-filter" + (format "git commit-tree --gpg-sign=%s \"$@\";" + keyid))) + range "--")) + (set-process-sentinel + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (if (> (process-exit-status process) 0) + (magit-process-sentinel process event) + (process-put process 'inhibit-refresh t) + (magit-process-sentinel process event) + (magit-run-git "update-ref" "-d" backup))))))))))))) ;;; Revision Stack @@ -593,16 +593,16 @@ revision). If not called inside a repository and with an empty stack, or with two prefix arguments, then read the repository in the minibuffer too." (interactive - (if (or current-prefix-arg (not magit-revision-stack)) - (let ((default-directory - (or (and (not (= (prefix-numeric-value current-prefix-arg) 16)) - (or (magit-toplevel) - (cadr (car magit-revision-stack)))) - (magit-read-repository)))) - (list (magit-read-branch-or-commit "Insert revision") - default-directory)) - (push (caar magit-revision-stack) magit-revision-history) - (pop magit-revision-stack))) + (if (or current-prefix-arg (not magit-revision-stack)) + (let ((default-directory + (or (and (not (= (prefix-numeric-value current-prefix-arg) 16)) + (or (magit-toplevel) + (cadr (car magit-revision-stack)))) + (magit-read-repository)))) + (list (magit-read-branch-or-commit "Insert revision") + default-directory)) + (push (caar magit-revision-stack) magit-revision-history) + (pop magit-revision-stack))) (unless rev (user-error "Revision stack is empty")) (pcase-let ((`(,pnt-format ,eob-format ,idx-format) @@ -737,9 +737,9 @@ abbreviated revision to the `kill-ring' and the (cl-case major-mode (magit-diff-mode (if (string-match "\\.\\.\\.?\\(.+\\)" - magit-buffer-range) - (match-str 1 magit-buffer-range) - magit-buffer-range)) + magit-buffer-diff-range) + (match-str 1 magit-buffer-diff-range) + magit-buffer-diff-range)) (magit-status-mode "HEAD")))] [_(magit-commit-p rev)] (setq rev (magit-rev-parse @@ -833,6 +833,7 @@ In Magit diffs, also skip over - and + at the beginning of the line." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-fetch.el b/elpa/magit-20260422.2206/magit-fetch.el similarity index 90% rename from elpa/magit-20251217.1836/magit-fetch.el rename to elpa/magit-20260422.2206/magit-fetch.el index bbd136aa..7a60d2a1 100644 --- a/elpa/magit-20251217.1836/magit-fetch.el +++ b/elpa/magit-20260422.2206/magit-fetch.el @@ -1,6 +1,6 @@ ;;; magit-fetch.el --- Download objects and refs -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -81,10 +81,10 @@ push-remote." (remote (magit-get-push-remote branch)) (v (magit--push-remote-variable branch t))) (cond - ((member remote (magit-list-remotes)) remote) - (remote - (format "%s, replacing invalid" v)) - ((format "%s, setting that" v))))) + ((member remote (magit-list-remotes)) remote) + (remote + (format "%s, replacing invalid" v)) + ((format "%s, setting that" v))))) ;;;###autoload(autoload 'magit-fetch-from-upstream "magit-fetch" nil t) (transient-define-suffix magit-fetch-from-upstream (remote args) @@ -117,20 +117,20 @@ results in an error." (defun magit-fetch-branch (remote branch args) "Fetch a BRANCH from a REMOTE." (interactive - (let ((remote (magit-read-remote-or-url "Fetch from remote or url"))) - (list remote - (magit-read-remote-branch "Fetch branch" remote) - (magit-fetch-arguments)))) + (let ((remote (magit-read-remote-or-url "Fetch from remote or url"))) + (list remote + (magit-read-remote-branch "Fetch branch" remote) + (magit-fetch-arguments)))) (magit-git-fetch remote (cons branch args))) ;;;###autoload (defun magit-fetch-refspec (remote refspec args) "Fetch a REFSPEC from a REMOTE." (interactive - (let ((remote (magit-read-remote-or-url "Fetch from remote or url"))) - (list remote - (magit-read-refspec "Fetch using refspec" remote) - (magit-fetch-arguments)))) + (let ((remote (magit-read-remote-or-url "Fetch from remote or url"))) + (list remote + (magit-read-refspec "Fetch using refspec" remote) + (magit-fetch-arguments)))) (magit-git-fetch remote (cons refspec args))) ;;;###autoload @@ -188,6 +188,7 @@ with a prefix argument." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-files.el b/elpa/magit-20260422.2206/magit-files.el similarity index 54% rename from elpa/magit-20251217.1836/magit-files.el rename to elpa/magit-20260422.2206/magit-files.el index fde39225..41158955 100644 --- a/elpa/magit-20251217.1836/magit-files.el +++ b/elpa/magit-20260422.2206/magit-files.el @@ -1,6 +1,6 @@ ;;; magit-files.el --- Finding files -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -31,10 +31,21 @@ (require 'magit) +(declare-function ediff-quit "ediff-util" (reverse-default-keep-variants)) + ;;; Find Blob -(defvar magit-find-file-hook nil) -(add-hook 'magit-find-file-hook #'magit-blob-mode) +(define-obsolete-variable-alias 'magit-find-file-hook + 'magit-find-blob-hook "Magit 4.6.0") + +(define-obsolete-variable-alias 'magit-find-index-hook + 'magit-find-blob-hook "Magit 4.6.0") + +(defvar magit-find-blob-hook (list #'magit-blob-mode)) + +(defvar-local magit-buffer-blob-oid--init nil) +(defvar-local magit-buffer--volatile nil) +(put 'magit-buffer--volatile 'permanent-local t) ;;;###autoload (defun magit-find-file (rev file) @@ -44,7 +55,7 @@ already exists. If prior to calling this command the current buffer and/or cursor position is about the same file, then go to the line and column corresponding to that location." (interactive (magit-find-file-read-args "Find file")) - (magit-find-file--internal rev file #'pop-to-buffer-same-window)) + (pop-to-buffer-same-window (magit-find-file-noselect rev file))) ;;;###autoload (defun magit-find-file-other-window (rev file) @@ -54,7 +65,7 @@ already exists. If prior to calling this command the current buffer and/or cursor position is about the same file, then go to the line and column corresponding to that location." (interactive (magit-find-file-read-args "Find file in other window")) - (magit-find-file--internal rev file #'switch-to-buffer-other-window)) + (switch-to-buffer-other-window (magit-find-file-noselect rev file))) ;;;###autoload (defun magit-find-file-other-frame (rev file) @@ -64,140 +75,257 @@ already exists. If prior to calling this command the current buffer and/or cursor position is about the same file, then go to the line and column corresponding to that location." (interactive (magit-find-file-read-args "Find file in other frame")) - (magit-find-file--internal rev file #'switch-to-buffer-other-frame)) + (switch-to-buffer-other-frame (magit-find-file-noselect rev file))) (defun magit-find-file-read-args (prompt) - (let ((pseudo-revs '("{worktree}" "{index}"))) - (let ((rev (magit-completing-read "Find file from revision" - (append pseudo-revs - (magit-list-refnames nil t)) - nil 'any nil 'magit-revision-history - (or (magit-branch-or-commit-at-point) - (magit-get-current-branch))))) - (list rev - (magit-read-file-from-rev (if (member rev pseudo-revs) "HEAD" rev) - prompt))))) - -(defun magit-find-file--internal (rev file fn) - (let ((buf (magit-find-file-noselect rev file)) - line col) - (when-let ((visited-file (magit-file-relative-name))) - (setq line (line-number-at-pos)) - (setq col (current-column)) - (cond - ((not (equal visited-file file))) - ((equal magit-buffer-revision rev)) - ((equal rev "{worktree}") - (setq line (magit-diff-visit--offset file magit-buffer-revision line))) - ((equal rev "{index}") - (setq line (magit-diff-visit--offset file nil line))) - (magit-buffer-revision - (setq line (magit-diff-visit--offset - file (concat magit-buffer-revision ".." rev) line))) - ((setq line (magit-diff-visit--offset file (list "-R" rev) line))))) - (funcall fn buf) - (when line - (with-current-buffer buf - (widen) - (goto-char (point-min)) - (forward-line (1- line)) - (move-to-column col))) - buf)) - -(defun magit-find-file-noselect (rev file &optional revert) + (let* ((pseudo-revs '("{worktree}" "{index}")) + (rev (magit-completing-read "Find file from revision" + (append pseudo-revs + (magit-list-refnames nil t)) + nil 'any nil 'magit-revision-history + (or (magit-branch-or-commit-at-point) + (magit-get-current-branch))))) + (list rev + (magit-read-file-from-rev (if (member rev pseudo-revs) "HEAD" rev) + prompt)))) + +(defun magit-find-file-noselect (rev file &optional no-restore-position volatile) "Read FILE from REV into a buffer and return the buffer. -REV is a revision or one of \"{worktree}\" or \"{index}\". FILE must -be relative to the top directory of the repository. Non-nil REVERT -means to revert the buffer. If `ask-revert', then only after asking. -A non-nil value for REVERT is ignored if REV is \"{worktree}\"." - (let* ((topdir (magit-toplevel)) - (absolute (file-name-absolute-p file)) - (file-abs (if absolute file (expand-file-name file topdir))) - (file-rel (if absolute (file-relative-name file topdir) file)) - (defdir (file-name-directory file-abs)) - (rev (magit--abbrev-if-hash rev))) - (if (equal rev "{worktree}") - (let ((revert-without-query - (if (and$ (find-buffer-visiting file-abs) - (buffer-local-value 'auto-revert-mode $)) - (cons "." revert-without-query) - revert-without-query))) - (find-file-noselect file-abs)) - (with-current-buffer (magit-get-revision-buffer-create rev file-rel) - (when (or (not magit-buffer-file-name) - (if (eq revert 'ask-revert) - (y-or-n-p (format "%s already exists; revert it? " - (buffer-name)))) - revert) - (setq magit-buffer-revision rev) - (setq magit-buffer-refname rev) - (setq magit-buffer-file-name file-abs) - (setq default-directory (if (file-exists-p defdir) defdir topdir)) - (setq-local revert-buffer-function #'magit-revert-rev-file-buffer) - (revert-buffer t t) - (run-hooks (if (equal rev "{index}") - 'magit-find-index-hook - 'magit-find-file-hook))) - (current-buffer))))) - -(defun magit-get-revision-buffer-create (rev file) - (magit-get-revision-buffer rev file t)) - -(defun magit-get-revision-buffer (rev file &optional create) - (funcall (if create #'get-buffer-create #'get-buffer) - (format "%s.~%s~" file (subst-char-in-string ?/ ?_ rev)))) - -(defun magit-revert-rev-file-buffer (_ignore-auto noconfirm) - (when (or noconfirm - (and (not (buffer-modified-p)) - (catch 'found - (dolist (regexp revert-without-query) - (when (string-match regexp magit-buffer-file-name) - (throw 'found t))))) - (yes-or-no-p (format "Revert buffer from Git %s? " - (if (equal magit-buffer-refname "{index}") - "index" - (concat "revision " magit-buffer-refname))))) - (let* ((inhibit-read-only t) - (default-directory (magit-toplevel)) - (file (file-relative-name magit-buffer-file-name)) - (coding-system-for-read (or coding-system-for-read 'undecided))) - (erase-buffer) - (magit-git-insert "cat-file" "-p" - (if (equal magit-buffer-refname "{index}") - (concat ":" file) - (concat magit-buffer-refname ":" file))) - (setq buffer-file-coding-system last-coding-system-used)) - (let ((buffer-file-name magit-buffer-file-name) - (after-change-major-mode-hook - (seq-difference after-change-major-mode-hook - '(global-diff-hl-mode-enable-in-buffer ; Emacs >= 30 - global-diff-hl-mode-enable-in-buffers ; Emacs < 30 - eglot--maybe-activate-editing-mode) - #'eq))) +REV is a revision or one of \"{worktree}\" or \"{index}\". +Non-interactively REV can also be a blob object." + (let* ((rev (pcase rev + ('nil "{worktree}") + ((and "{index}" + (guard (length> (magit--file-index-stages file) 1))) + "{worktree}") + (rev rev))) + (topdir (magit-toplevel)) + (file (expand-file-name file topdir)) + (file-relative (file-relative-name file topdir)) + (buffer + (cond-let + ((equal rev "{worktree}") + (let ((revert-without-query + (if (and$ (find-buffer-visiting file) + (buffer-local-value 'auto-revert-mode $)) + (cons "." revert-without-query) + revert-without-query))) + (find-file-noselect file volatile))) + ((not topdir) + (error "%s is not inside a Git repository" file)) + ([defdir (file-name-directory file)] + [rev (magit--abbrev-if-oid rev)] + (unless (file-in-directory-p file topdir) + (error "%s is not inside Git repository %s" file topdir)) + (with-current-buffer + (magit--get-blob-buffer rev file-relative volatile) + (if (magit-blob-p rev) + (setq magit-buffer-blob-oid--init (magit-rev-parse rev)) + (setq magit-buffer-revision rev)) + (setq magit-buffer-file-name file) + (setq default-directory + (if (file-exists-p defdir) defdir topdir)) + (setq-local revert-buffer-function #'magit--revert-blob-buffer) + (setq-local buffer-read-only t) + (setq-local read-only-mode--state t) + (magit--refresh-blob-buffer) + (current-buffer))) + ((error "Unexpected error"))))) + (when (and (not no-restore-position) + (equal (magit-file-relative-name) file-relative)) + (let ((pos (magit-find-file--position))) + (with-current-buffer buffer + (apply #'magit-find-file--restore-position pos)))) + buffer)) + +(defun magit--get-blob-buffer (obj file &optional volatile) + ;; If OBJ is a commit, is assummed to be abbreviated. + ;; FILE is assumed to be relative to the top-level. + (cond-let + ([buf (if (magit-blob-p obj) + (magit--find-buffer 'magit-buffer-blob-oid (magit-rev-parse obj) + 'magit-buffer-file-name file) + (magit--find-buffer 'magit-buffer-revision obj + 'magit-buffer-file-name file))] + (with-current-buffer buf + (when (and (not volatile) magit-buffer--volatile) + (setq magit-buffer--volatile nil) + (rename-buffer (magit--blob-buffer-name obj file)) + (magit--blob-cache-remove buf))) + buf) + ([buf (get-buffer-create (magit--blob-buffer-name obj file volatile))] + (with-current-buffer buf + (setq magit-buffer--volatile volatile) + (magit--blob-cache-put buf)) + (buffer-enable-undo buf) + buf))) + +(defun magit--blob-buffer-name (obj file &optional volatile) + (format "%s%s.~%s~" + (if volatile " " "") + (or file (and (magit-blob-p obj) "{blob}")) + (subst-char-in-string ?/ ?_ obj))) + +(defun magit--revert-blob-buffer (_ignore-auto _noconfirm) + (let ((pos (magit-find-file--position))) + (magit--refresh-blob-buffer t) + (apply #'magit-find-file--restore-position pos))) + +(defun magit--refresh-blob-buffer (&optional force) + (let ((old-blob-oid magit-buffer-blob-oid)) + (cond + (magit-buffer-revision + (setq magit-buffer-revision-oid + (magit-commit-oid magit-buffer-revision t)) + (setq magit-buffer-blob-oid + (magit-blob-oid magit-buffer-revision magit-buffer-file-name))) + (magit-buffer-blob-oid--init + (setq magit-buffer-blob-oid magit-buffer-blob-oid--init) + (setq magit-buffer-blob-oid--init nil))) + (when (or force (not (equal old-blob-oid magit-buffer-blob-oid))) + (let ((inhibit-read-only t)) + (erase-buffer) + (save-excursion + (magit--insert-blob-contents magit-buffer-revision + (magit-file-relative-name)))) + (magit--blob-normal-mode)))) + +(defun magit--blob-normal-mode () + (let ((buffer-file-name magit-buffer-file-name) + (after-change-major-mode-hook + ;; Inhibit diff-hl and eglot; see bb8a65269d and 234a787b8c. + (seq-difference after-change-major-mode-hook + '(global-diff-hl-mode-enable-in-buffer ; Emacs >= 30 + global-diff-hl-mode-enable-in-buffers ; Emacs < 30 + eglot--maybe-activate-editing-mode) + #'eq)) + (buffer-name (buffer-name))) + ;; `font-lock-mode' contains a hardcoded condition that prevents it + ;; from being enabled in hidden buffers. Use a fake `buffer-name' + ;; to trick it into believing the buffer is not hidden. + (if (eq (aref buffer-name 0) ?\s) + (letrec ((adv (lambda (fn &optional buffer) + (let ((name (funcall fn buffer))) + (if (equal name buffer-name) + (substring name 1) + name))))) + (advice-add 'buffer-name :around adv) + (unwind-protect + (normal-mode (not enable-local-variables)) + (advice-remove 'buffer-name adv))) ;; We want `normal-mode' to respect nil `enable-local-variables'. - ;; The FIND-FILE argument wasn't designed for our use case, so we - ;; have to use this strange invocation to achieve that. + ;; The FIND-FILE argument wasn't designed for our use case, + ;; so we have to use this strange invocation to achieve that. (normal-mode (not enable-local-variables))) - (setq buffer-read-only t) (set-buffer-modified-p nil) - (goto-char (point-min)))) + (run-hooks 'magit-find-blob-hook))) + +(defun magit-find-file--position () + (list (or magit-buffer-revision-oid magit-buffer-revision "{worktree}") + magit-buffer-blob-oid + (line-number-at-pos) + (current-column))) + +(defun magit-find-file--restore-position (before blob line col) + (let ((file (magit-file-relative-name)) + (rev (or magit-buffer-revision-oid magit-buffer-revision "{worktree}"))) + (goto-char (point-min)) + (forward-line + (1- + (pcase (list before rev) + ((guard (equal magit-buffer-blob-oid blob)) line) + ('("{worktree}" "{worktree}") line) + ('("{worktree}" "{index}") + (magit-diff-visit--offset line file "-R")) + (`("{worktree}" ,_) + (magit-diff-visit--offset line file "-R" rev)) + ('("{index}" "{worktree}") + (magit-diff-visit--offset line file)) + ('("{index}" "{index}") + (magit-diff-visit--offset line (list blob magit-buffer-blob-oid file))) + (`("{index}" ,_) + (magit-diff-visit--offset line file "-R" "--cached")) + (`(,_ "{worktree}") + (magit-diff-visit--offset line file before)) + (`(,_ "{index}") + (magit-diff-visit--offset line file "--cached")) + (_ + (magit-diff-visit--offset line file before rev))))) + (move-to-column col))) + +(defvar magit--blob-cache-limit 100 + "Limit number of volatile blob buffers to be kept alive. +If nil, only use `magit--blob-cache-timeout'.") +(defvar magit--blob-cache-timeout 1800 + "Limit age, since last access, of volatile blob buffers to be kept alive. +Age is tracked in seconds. If nil, only use `magit--blob-cache-limit'.") +(defvar magit--blob-cache-interval 600 + "Seconds between volatile blob buffer pruning runs.") +(defvar magit--blob-cache-timer nil) +(defvar magit--blob-cache nil) + +(defun magit--blob-cache-put (buffer) + (if-let ((elt (assq buffer magit--blob-cache))) + (setcdr elt (current-time)) + (push (cons buffer (current-time)) magit--blob-cache)) + (magit--blob-cache-start)) + +(defun magit--blob-cache-remove (buffer) + (and$ (assq buffer magit--blob-cache) + (delq $ magit--blob-cache))) + +(defun magit--blob-cache-start () + (when (and magit--blob-cache-interval + (not magit--blob-cache-timer)) + (setq magit--blob-cache-timer + (run-with-timer magit--blob-cache-interval nil + #'magit--blob-cache-prune)))) + +(defun magit--blob-cache-prune () + (when magit--blob-cache-timer + (cancel-timer magit--blob-cache-timer)) + (pcase-let + ((`(,active ,rest) + (magit--separate + (pcase-lambda (`(,buffer)) + (or (get-buffer-window buffer t) + (not (eq (buffer-local-value 'magit-buffer--volatile buffer) t)))) + magit--blob-cache))) + (when magit--blob-cache-timeout + (setq rest + (seq-filter (pcase-lambda (`(,buffer . ,time)) + (cond + ((not (buffer-live-p buffer)) nil) + ((time-less-p (time-subtract (current-time) time) + magit--blob-cache-timeout) + buffer) + (t (kill-buffer buffer) nil))) + rest))) + (when-let* ((_ magit--blob-cache-limit) + (ceiling (- magit--blob-cache-limit (length active))) + (_ (length> rest ceiling))) + (let ((sorted (static-if (>= emacs-major-version 30) + (sort rest :key (##float-time (cdr %)) + :lessp #'< :reverse t) + (cl-sort rest #'> :key (##float-time (cdr %)))))) + (dolist (kill (nthcdr ceiling sorted)) + (kill-buffer (car kill))) + (setq rest (ntake ceiling sorted)))) + (setq magit--blob-cache (nconc active rest))) + (magit--blob-cache-start)) + +(defun magit--blob-cache-zap () + (pcase-dolist (`(,buffer) magit--blob-cache) + (kill-buffer buffer)) + (setq magit--blob-cache nil)) (define-advice lsp (:around (fn &rest args) magit-find-file) "Do nothing when visiting blob using `magit-find-file' and similar. See also https://github.com/doomemacs/doomemacs/pull/6309." - (unless magit-buffer-revision + (unless magit-buffer-blob-oid (apply fn args))) -;;; Find Index - -(defvar magit-find-index-hook nil) -(add-hook 'magit-find-index-hook #'magit-blob-mode) - -(defun magit-find-file-index-noselect (file &optional revert) - "Read FILE from the index into a buffer and return the buffer. -FILE must to be relative to the top directory of the repository." - (magit-find-file-noselect "{index}" file (or revert 'ask-revert))) +;;; Update Index (defun magit-update-index () "Update the index with the contents of the current buffer. @@ -205,7 +333,7 @@ The current buffer has to be visiting a file in the index, which is done using `magit-find-index-noselect'." (interactive) (let ((file (magit-file-relative-name))) - (unless (equal magit-buffer-refname "{index}") + (unless (equal magit-buffer-revision "{index}") (user-error "%s isn't visiting the index" file)) (if (y-or-n-p (format "Update index with contents of %s?" (buffer-name))) (let ((index (make-temp-name @@ -230,8 +358,8 @@ is done using `magit-find-index-noselect'." (set-buffer-modified-p nil) (magit-run-after-apply-functions file "un-/stage")) (message "Abort"))) - (when-let ((buffer (magit-get-mode-buffer 'magit-status-mode))) - (with-current-buffer buffer + (when$ (magit-get-mode-buffer 'magit-status-mode) + (with-current-buffer $ (magit-refresh))) t) @@ -248,9 +376,9 @@ This command is like `find-file', except that it temporarily binds `default-directory' to the actual git directory, while reading the FILENAME." (interactive - (let ((default-directory (magit-gitdir))) - (find-file-read-args "Find file: " - (confirm-nonexistent-file-or-buffer)))) + (let ((default-directory (magit-gitdir))) + (find-file-read-args "Find file: " + (confirm-nonexistent-file-or-buffer)))) (find-file filename wildcards)) (defun magit-find-git-config-file-other-window (filename &optional wildcards) @@ -264,9 +392,9 @@ This command is like `find-file-other-window', except that it temporarily binds `default-directory' to the actual git directory, while reading the FILENAME." (interactive - (let ((default-directory (magit-gitdir))) - (find-file-read-args "Find file in other window: " - (confirm-nonexistent-file-or-buffer)))) + (let ((default-directory (magit-gitdir))) + (find-file-read-args "Find file in other window: " + (confirm-nonexistent-file-or-buffer)))) (find-file-other-window filename wildcards)) (defun magit-find-git-config-file-other-frame (filename &optional wildcards) @@ -280,9 +408,9 @@ This command is like `find-file-other-frame', except that it temporarily binds `default-directory' to the actual git directory, while reading the FILENAME." (interactive - (let ((default-directory (magit-gitdir))) - (find-file-read-args "Find file in other frame: " - (confirm-nonexistent-file-or-buffer)))) + (let ((default-directory (magit-gitdir))) + (find-file-read-args "Find file in other frame: " + (confirm-nonexistent-file-or-buffer)))) (find-file-other-frame filename wildcards)) ;;; File Dispatch @@ -345,6 +473,8 @@ to `magit-dispatch'." (defvar-keymap magit-blob-mode-map :doc "Keymap for `magit-blob-mode'." + " " #'magit-blob-mode + "g" #'revert-buffer "p" #'magit-blob-previous "n" #'magit-blob-next "b" #'magit-blame-addition @@ -353,25 +483,50 @@ to `magit-dispatch'." "q" #'magit-bury-or-kill-buffer) (define-minor-mode magit-blob-mode - "Enable some Magit features in blob-visiting buffers. - -Currently this only adds the following key bindings. -\n\\{magit-blob-mode-map}" - :package-version '(magit . "2.3.0")) + "Enable key bindings, which are useful in blob-visiting buffers. + +\\{magit-blob-mode-map} +When the user disables `read-only-mode', these bindings would conflict +with bindings for `self-insert-command'. To avoid this conflict, +`read-only-mode' is remapped to `magit-blob-mode' and disabling the +latter disables both modes. Likewise, enabling it, also enables +`read-only-mode'. + +When this mode is disabled, many of the commands, for which it would +single-character bindings, are accessible via \\[magit-file-dispatch]." + :package-version '(magit . "2.3.0") + ;; Don't actually call `read-only-mode'. Because + ;; that could enable the incompatible `view-mode'. + (setq-local buffer-read-only magit-blob-mode) + (setq-local read-only-mode--state magit-blob-mode)) (defun magit-bury-buffer (&optional kill-buffer) - "Bury the current buffer, or with a prefix argument kill it." + "Bury the current buffer, or with a prefix argument kill it. + +If the buffer is used by an Ediff session, refuse to kill or bury just +that buffer. That former would break the session and the latter makes +little sense in this context. Instead offer to quit the whole session." (interactive "P") - (if kill-buffer (kill-buffer) (bury-buffer))) + (cond ((bound-and-true-p ediff-this-buffer-ediff-sessions) + (ediff-quit nil)) + (kill-buffer (kill-buffer)) + ((bury-buffer)))) (defun magit-bury-or-kill-buffer (&optional bury-buffer) "Bury the current buffer if displayed in multiple windows, else kill it. -With a prefix argument only bury the buffer even if it is only displayed -in a single window." + +With a prefix argument only bury the buffer even if it is only +displayed in a single window. + +If the buffer is used by an Ediff session, refuse to kill or bury just +that buffer. That former would break the session and the latter makes +little sense in this context. Instead offer to quit the whole session." (interactive "P") - (if (or bury-buffer (cdr (get-buffer-window-list nil nil t))) - (bury-buffer) - (kill-buffer))) + (cond ((bound-and-true-p ediff-this-buffer-ediff-sessions) + (ediff-quit nil)) + ((or bury-buffer (cdr (get-buffer-window-list nil nil t))) + (bury-buffer)) + ((kill-buffer)))) (defun magit-kill-this-buffer () "Kill the current buffer." @@ -412,7 +567,7 @@ When visiting a blob or the version from the index, then go to the same location in the respective file in the working tree." (interactive) (if-let ((file (magit-file-relative-name))) - (magit-find-file--internal "{worktree}" file #'pop-to-buffer-same-window) + (pop-to-buffer-same-window (magit-find-file-noselect "{worktree}" file)) (user-error "Not visiting a blob"))) (defun magit-blob-visit (rev file) @@ -495,11 +650,11 @@ staged as well as unstaged changes." NEWNAME may be a file or directory name. If FILE isn't tracked in Git, fallback to using `rename-file'." (interactive - (let* ((file (magit-read-file "Rename file")) - (path (expand-file-name file (magit-toplevel)))) - (list path (expand-file-name - (read-file-name (format "Move %s to destination: " file) - (file-name-directory path)))))) + (let* ((file (magit-read-file "Rename file")) + (path (expand-file-name file (magit-toplevel)))) + (list path (expand-file-name + (read-file-name (format "Move %s to destination: " file) + (file-name-directory path)))))) (let ((oldbuf (get-file-buffer file)) (dstdir (file-name-directory newname)) (dstfile (if (directory-name-p newname) @@ -548,9 +703,9 @@ Git, then fallback to using `delete-file'." (defun magit-file-checkout (rev file) "Checkout FILE from REV." (interactive - (let ((rev (magit-read-branch-or-commit - "Checkout from revision" magit-buffer-revision))) - (list rev (magit-read-file-from-rev rev "Checkout file" nil t)))) + (let ((rev (magit-read-branch-or-commit + "Checkout from revision" magit-buffer-revision))) + (list rev (magit-read-file-from-rev rev "Checkout file" nil t)))) (magit-with-toplevel (magit-run-git "checkout" rev "--" file))) @@ -568,15 +723,14 @@ Git, then fallback to using `delete-file'." (car (member (or default (magit-current-file)) files))))) (defun magit-read-file (prompt &optional tracked-only) - (magit-with-toplevel - (let ((choices (nconc (magit-list-files) - (and (not tracked-only) - (magit-untracked-files))))) - (magit-completing-read - prompt choices nil t nil nil - (car (member (or (magit-section-value-if '(file submodule)) - (magit-file-relative-name nil tracked-only)) - choices)))))) + (let ((choices (nconc (magit-list-files) + (and (not tracked-only) + (magit-untracked-files))))) + (magit-completing-read + prompt choices nil t nil nil + (car (member (or (magit-section-value-if '(file submodule)) + (magit-file-relative-name nil tracked-only)) + choices))))) (defun magit-read-tracked-file (prompt) (magit-read-file prompt t)) @@ -624,6 +778,17 @@ If DEFAULT is non-nil, use this as the default value instead of (define-obsolete-function-alias 'magit-find-file-noselect-1 'magit-find-file-noselect "Magit 4.4.0") +(defun magit-find-file--internal (rev file display) + (declare (obsolete magit-find-file-noselect "Magit 4.6.0")) + (let ((buf (magit-find-file-noselect rev file))) + (funcall display buf) + buf)) + +(defun magit-find-file-index-noselect (file) + "Read FILE from the index into a buffer and return the buffer." + (declare (obsolete magit-find-file-noselect "Magit 4.6.0")) + (magit-find-file-noselect "{index}" file t)) + (provide 'magit-files) ;; Local Variables: ;; read-symbol-shorthands: ( @@ -631,6 +796,7 @@ If DEFAULT is non-nil, use this as the default value instead of ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-git.el b/elpa/magit-20260422.2206/magit-git.el similarity index 91% rename from elpa/magit-20251217.1836/magit-git.el rename to elpa/magit-20260422.2206/magit-git.el index 99fea61c..7a36c08e 100644 --- a/elpa/magit-20251217.1836/magit-git.el +++ b/elpa/magit-20260422.2206/magit-git.el @@ -1,6 +1,6 @@ ;;; magit-git.el --- Git functionality -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -48,7 +48,6 @@ (defvar magit-buffer-file-name) (defvar magit-buffer-log-args) (defvar magit-buffer-log-files) -(defvar magit-buffer-refname) (defvar magit-buffer-revision) ;; From `magit-process'. @@ -72,6 +71,8 @@ (cl-pushnew 'orig-rev eieio--known-slot-names) (cl-pushnew 'number eieio--known-slot-names)) +(defvar crm-prompt) ; Emacs 31.1 + ;;; Options ;; For now this is shared between `magit-process' and `magit-git'. @@ -102,11 +103,11 @@ this." (ignore-error file-missing (apply #'process-lines-ignore-status program args)))) -(defvar magit-git-w32-path-hack nil +(defvar magit--git-w32-path-hack nil "Alist of (EXE . (PATHENTRY)). This specifies what additional PATH setting needs to be added to the environment in order to run the non-wrapper git executables -successfully.") +successfully. Set when `magit-git-executable' is (re)initialized.") (defcustom magit-git-executable (or (and (eq system-type 'windows-nt) @@ -120,7 +121,7 @@ successfully.") exec "-c" "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" "X" "git"))) - (hack-entry (assoc core-exe magit-git-w32-path-hack)) + (hack-entry (assoc core-exe magit--git-w32-path-hack)) ;; Running the libexec/git-core executable ;; requires some extra PATH entries. (path-hack @@ -134,7 +135,7 @@ successfully.") ;; idempotent. (if hack-entry (setcdr hack-entry path-hack) - (push (cons core-exe path-hack) magit-git-w32-path-hack)) + (push (cons core-exe path-hack) magit--git-w32-path-hack)) core-exe))) (and (eq system-type 'darwin) (executable-find "git")) @@ -280,6 +281,28 @@ framework ultimately determines how the collection is displayed." :group 'magit-miscellaneous :type '(choice string (repeat string))) +(defcustom magit-cygwin-mount-points + (and (eq system-type 'windows-nt) + (cl-sort (mapcar + (lambda (mount) + (if (string-match "^\\(.*\\) on \\(.*\\) type" mount) + (cons (file-name-as-directory (match-str 2 mount)) + (file-name-as-directory (match-str 1 mount))) + (lwarn '(magit) :error + "Failed to parse Cygwin mount: %S" mount))) + ;; If --exec-path is not a native Windows path, + ;; then we probably have a cygwin git. + (and-let ((dirs (magit--early-process-lines + magit-git-executable "--exec-path"))) + (and (not (string-match-p "\\`[a-zA-Z]:" (car dirs))) + (magit--early-process-lines "mount")))) + #'> :key (pcase-lambda (`(,cyg . ,_win)) (length cyg)))) + "Alist of (CYGWIN . WIN32) directory names. +Sorted from longest to shortest CYGWIN name." + :package-version '(magit . "2.3.0") + :group 'magit-process + :type '(alist :key-type string :value-type directory)) + ;;; Git (defvar magit-git-debug nil @@ -393,7 +416,7 @@ to do the following. * Prepend `magit-git-global-arguments' to ARGS. * If ASYNC is non-nil and `magit-overriding-githook-directory' is non-nil - and valid, set `core.hooksPath' by adding additional aguments to ARGS. + and valid, set `core.hooksPath' by adding additional arguments to ARGS. * Flatten ARGS, removing nil arguments. * If `system-type' is `windows-nt', encode ARGS to `w32-ansi-code-page'." (cond ((not async)) @@ -434,22 +457,6 @@ to do the following. "Execute Git with ARGS, returning t if its exit code is 1." (= (magit-git-exit-code args) 1)) -(defun magit-git-string-p (&rest args) - "Execute Git with ARGS, returning the first line of its output. -If the exit code isn't zero or if there is no output, then return -nil. Neither of these results is considered an error; if that is -what you want, then use `magit-git-string-ng' instead. - -This is an experimental replacement for `magit-git-string', and -still subject to major changes." - (magit--with-refresh-cache (cons default-directory args) - (magit--with-temp-process-buffer - (and (zerop (magit-process-git t args)) - (not (bobp)) - (progn - (goto-char (point-min)) - (buffer-substring-no-properties (point) (line-end-position))))))) - (defun magit-git-string-ng (&rest args) "Execute Git with ARGS, returning the first line of its output. If the exit code isn't zero or if there is no output, then that @@ -459,7 +466,7 @@ buffer (creating it if necessary) and the error message is shown in the status buffer (provided it exists). This is an experimental replacement for `magit-git-string', and -still subject to major changes. Also see `magit-git-string-p'." +still subject to major changes." (magit--with-refresh-cache (list default-directory 'magit-git-string-ng args) (magit--with-temp-process-buffer @@ -526,9 +533,9 @@ signal `magit-invalid-git-boolean'." (defun magit-git-config-p (variable &optional default) "Return the boolean value of the Git variable VARIABLE. -VARIABLE has to be specified as a string. Return DEFAULT (which -defaults to nil) if VARIABLE is unset. If VARIABLE's value isn't -a boolean, then raise an error." +VARIABLE has to be specified as a string. If VARIABLE is unset, +return nil by default, unless DEFAULT is non-nil, in which case +return t. Signal an error if VARIABLE is set but not a boolean." (let ((args (list "config" "--bool" "--default" (if default "true" "false") variable))) (magit--with-refresh-cache (cons default-directory args) @@ -561,12 +568,12 @@ insert the run command and stderr into the process buffer." (goto-char (point-max)) (setq errmsg (cond - ((eq return-error 'full) - (let ((str (buffer-string))) - (and (not (equal str "")) str))) - ((functionp magit-git-debug) - (funcall magit-git-debug (buffer-string))) - ((magit--locate-error-message))))) + ((eq return-error 'full) + (let ((str (buffer-string))) + (and (not (equal str "")) str))) + ((functionp magit-git-debug) + (funcall magit-git-debug (buffer-string))) + ((magit--locate-error-message))))) (when magit-git-debug (let ((magit-git-debug nil)) (with-current-buffer (magit-process-buffer t) @@ -577,10 +584,12 @@ insert the run command and stderr into the process buffer." exit log 'magit-section-secondary-heading) exit))))) (cond ((not magit-git-debug)) - (errmsg (message "%s" errmsg)) + (errmsg (message "magit--git-insert: %S" errmsg)) ((zerop exit)) - ((message "Git returned with exit-code %s" exit)))) - (or errmsg exit)) + ((message "magit--git-insert: %s %s" + "Git returned with exit-code" exit)))) + (or (and return-error errmsg) + exit)) (ignore-errors (delete-file log)))) (magit-process-git (list t nil) args))) @@ -591,16 +600,18 @@ insert the run command and stderr into the process buffer." (match-str 1))) (defun magit-git-string (&rest args) - "Execute Git with ARGS, returning the first line of its output. -If there is no output, return nil. If the output begins with a -newline, return an empty string." + "Execute Git with ARGS, returning the first line of its output (stdout). +If the exit code isn't zero or if there is no output, then return nil. +Neither of these results is considered an error; if that is what you +want, then use `magit-git-string-ng' instead." (setq args (flatten-tree args)) (magit--with-refresh-cache (cons default-directory args) (magit--with-temp-process-buffer - (apply #'magit-git-insert args) - (unless (bobp) - (goto-char (point-min)) - (buffer-substring-no-properties (point) (line-end-position)))))) + (and (zerop (apply #'magit-git-insert args)) + (not (bobp)) + (progn + (goto-char (point-min)) + (buffer-substring-no-properties (point) (line-end-position))))))) (defun magit-git-lines (&rest args) "Execute Git with ARGS, returning its output as a list of lines. @@ -708,29 +719,29 @@ format." (status (magit-process-git t "version")) (output (buffer-string))) (cond - ((not (zerop status)) - (display-warning - 'magit - (format "%S\n\nRunning \"%s --version\" failed with output:\n\n%s" - (if host - (format "Magit cannot find Git on host %S.\n + ((not (zerop status)) + (display-warning + 'magit + (format "%S\n\nRunning \"%s --version\" failed with output:\n\n%s" + (if host + (format "Magit cannot find Git on host %S.\n Check the value of `magit-remote-git-executable' using `magit-debug-git-executable' and consult the info node `(tramp)Remote programs'." host) - "Magit cannot find Git.\n + "Magit cannot find Git.\n Check the values of `magit-git-executable' and `exec-path' using `magit-debug-git-executable'.") - (magit-git-executable) - output))) - ((save-match-data - (and (string-match magit--git-version-regexp output) - (let ((version (match-str 1 output))) - (push (cons host version) - magit--host-git-version-cache) - version)))) - ((error "Unexpected \"%s --version\" output: %S" - (magit-git-executable) - output))))))))) + (magit-git-executable) + output))) + ((save-match-data + (and (string-match magit--git-version-regexp output) + (let ((version (match-str 1 output))) + (push (cons host version) + magit--host-git-version-cache) + version)))) + ((error "Unexpected \"%s --version\" output: %S" + (magit-git-executable) + output))))))))) (defun magit-git-version-assert (&optional minimal who) "Assert that the used Git version is greater than or equal to MINIMAL. @@ -871,7 +882,8 @@ Also see `magit-git-config-p'." (dolist (v values) (magit-call-git "config" arg "--add" var v)))) -;;; Files +;;; Repository +;;;; Repository Locations (defun magit--safe-default-directory (&optional file) (catch 'unsafe-default-dir @@ -1017,11 +1029,11 @@ returning the truename." `(let ((default-directory (magit--toplevel-safe))) ,@body)) +;;;; Repository Predicates + (define-error 'magit-outside-git-repo "Not inside Git repository") (define-error 'magit-corrupt-git-config "Corrupt Git configuration") -(define-error 'magit-git-executable-not-found - (concat "Git executable cannot be found " - "(see https://magit.vc/goto/e6a78ed2)")) +(define-error 'magit-git-executable-not-found "Git executable cannot be found") (defun magit--assert-usable-git () (if (not (executable-find (magit-git-executable) t)) @@ -1100,50 +1112,36 @@ a bare repository." (file-directory-p (expand-file-name "refs" directory)) (file-directory-p (expand-file-name "objects" directory)))))) -(defun magit-file-relative-name (&optional file tracked) - "Return the path of FILE relative to the repository root. - -If optional FILE is nil or omitted, return the relative path of -the file being visited in the current buffer, if any, else nil. -If the file is not inside a Git repository, then return nil. - -If TRACKED is non-nil, return the path only if it matches a -tracked file." - (with-current-buffer (or (buffer-base-buffer) (current-buffer)) - (and-let* ((file (or file - (magit-buffer-file-name) - (and (derived-mode-p 'dired-mode) - default-directory))) - (dir (magit-toplevel (magit--safe-default-directory - (file-name-parent-directory file)))) - (_(or (not tracked) - (magit-file-tracked-p file)))) - (file-relative-name file dir)))) +;;; Files +;;;; File Predicates (defun magit-file-ignored-p (file) - (magit-git-string-p "ls-files" "--others" "--ignored" "--exclude-standard" - "--" (magit-convert-filename-for-git file))) + (magit-git-string "ls-files" "--others" "--ignored" "--exclude-standard" + "--" (magit-convert-filename-for-git file))) (defun magit-file-tracked-p (file) (magit-git-success "ls-files" "--error-unmatch" "--" (magit-convert-filename-for-git file))) +;;;; File Lists + (defun magit-list-files (&rest args) - (apply #'magit-git-items "ls-files" "-z" "--full-name" args)) + (magit-with-toplevel + (apply #'magit-git-items "ls-files" "-z" args))) (defun magit-tracked-files (&rest args) (magit-list-files "--cached" args)) (defun magit-untracked-files (&optional all files &rest args) - "Return a list of untracked files. - -Note that when using \"--directory\", the rules from \".gitignore\" -files from sub-directories are ignore, which is probably a Git bug. -See also `magit-list-untracked-files', which does not have this -issue." - (magit-list-files "--other" args - (and (not all) "--exclude-standard") - "--" files)) + "Return a list of untracked files." + (magit-with-toplevel + (seq-keep (##and (eq (aref % 0) ??) + (substring % 3)) + (magit-git-items "status" "-z" "--porcelain" args + (if all + "--untracked-files=all" + "--untracked-files=normal") + "--" files)))) (defun magit-list-untracked-files (&optional files) "Return a list of untracked files. @@ -1216,14 +1214,13 @@ See also `magit-untracked-files'." (magit-list-files "-v" args))) (defun magit-revision-files (rev) - (magit-with-toplevel - (magit-git-items "ls-tree" "-z" "-r" "--name-only" rev))) + (magit-git-items "ls-tree" "-z" "--full-tree" "-r" "--name-only" rev)) (defun magit-revision-directories (rev) "List directories that contain a tracked file in revision REV." - (magit-with-toplevel - (mapcar #'file-name-as-directory - (magit-git-items "ls-tree" "-z" "-r" "-d" "--name-only" rev)))) + (mapcar #'file-name-as-directory + (magit-git-items "ls-tree" "-z" "--full-tree" "-r" "-d" "--name-only" + rev))) (defun magit-changed-files (rev-or-range &optional other-rev) "Return list of files the have changed between two revisions. @@ -1241,6 +1238,28 @@ range. Otherwise, it can be any revision or range accepted by "--diff-filter=R" revA revB) 3))) +;;;; File Names + +(defun magit-file-relative-name (&optional file tracked) + "Return the path of FILE relative to the repository root. + +If optional FILE is nil or omitted, return the relative path of +the file being visited in the current buffer, if any, else nil. +If the file is not inside a Git repository, then return nil. + +If TRACKED is non-nil, return the path only if it matches a +tracked file." + (with-current-buffer (or (buffer-base-buffer) (current-buffer)) + (and-let* ((file (or file + (magit-buffer-file-name) + (and (derived-mode-p 'dired-mode) + default-directory))) + (dir (magit-toplevel (magit--safe-default-directory + (file-name-parent-directory file)))) + (_(or (not tracked) + (magit-file-tracked-p file)))) + (file-relative-name file dir)))) + (defun magit--rev-file-name (file rev other-rev) "For FILE, potentially renamed between REV and OTHER-REV, return name in REV. Return nil, if FILE appears neither in REV nor OTHER-REV, @@ -1249,48 +1268,6 @@ or if no rename is detected." (and$ (magit-renamed-files rev other-rev) (car (rassoc file $))))) -(defun magit-file-status (&rest args) - (magit--with-temp-process-buffer - (save-excursion (magit-git-insert "status" "-z" args)) - (let ((pos (point)) status) - (while (> (skip-chars-forward "[:print:]") 0) - (let ((x (char-after pos)) - (y (char-after (1+ pos))) - (file (buffer-substring (+ pos 3) (point)))) - (forward-char) - (if (memq x '(?R ?C)) - (progn - (setq pos (point)) - (skip-chars-forward "[:print:]") - (push (list file (buffer-substring pos (point)) x y) status) - (forward-char)) - (push (list file nil x y) status))) - (setq pos (point))) - status))) - -(defcustom magit-cygwin-mount-points - (and (eq system-type 'windows-nt) - (cl-sort (mapcar - (lambda (mount) - (if (string-match "^\\(.*\\) on \\(.*\\) type" mount) - (cons (file-name-as-directory (match-str 2 mount)) - (file-name-as-directory (match-str 1 mount))) - (lwarn '(magit) :error - "Failed to parse Cygwin mount: %S" mount))) - ;; If --exec-path is not a native Windows path, - ;; then we probably have a cygwin git. - (and (not (string-match-p - "\\`[a-zA-Z]:" - (car (magit--early-process-lines - magit-git-executable "--exec-path")))) - (magit--early-process-lines "mount"))) - #'> :key (pcase-lambda (`(,cyg . ,_win)) (length cyg)))) - "Alist of (CYGWIN . WIN32) directory names. -Sorted from longest to shortest CYGWIN name." - :package-version '(magit . "2.3.0") - :group 'magit-process - :type '(alist :key-type string :value-type directory)) - (defun magit-expand-git-file-name (filename) (unless (file-name-absolute-p filename) (setq filename (expand-file-name filename))) @@ -1327,6 +1304,8 @@ Sorted from longest to shortest CYGWIN name." t) path)) +;;;; File Miscellaneous + (defun magit-file-at-point (&optional expand assert) (cond-let ([file (magit-section-case @@ -1344,6 +1323,54 @@ Sorted from longest to shortest CYGWIN name." (and (derived-mode-p 'magit-log-mode) (car magit-buffer-log-files)))) +(defun magit-file-status (&rest args) + (magit--with-temp-process-buffer + (save-excursion (magit-git-insert "status" "-z" args)) + (let ((pos (point)) status) + (while (> (skip-chars-forward "[:print:]") 0) + (let ((x (char-after pos)) + (y (char-after (1+ pos))) + (file (buffer-substring (+ pos 3) (point)))) + (forward-char) + (cond ((memq x '(?R ?C)) + (setq pos (point)) + (skip-chars-forward "[:print:]") + (push (list file (buffer-substring pos (point)) x y) status) + (forward-char)) + ((push (list file nil x y) status)))) + (setq pos (point))) + status))) + +;;; Blobs + +(defun magit-blob-p (obj) + (equal (magit-object-type obj) "blob")) + +(defun magit-blob-oid (rev file) + (cond-let + ((equal rev "{index}") + (cadr (car (magit--file-index-stages file)))) + ;; --object-only and --format were only added in Git v2.36.0. + ([out (magit-git-string "ls-tree" "--full-tree" rev "--" + (magit-convert-filename-for-git file))] + (nth 2 (split-string out "[\s\t]"))))) + +(defun magit--file-index-stages (file) + (mapcar (##split-string % " ") + (magit-git-lines "ls-files" "--stage" "--" + (magit-convert-filename-for-git file)))) + +(defun magit--insert-blob-contents (obj file) + (let ((coding-system-for-read (or coding-system-for-read 'undecided))) + (if (magit-blob-p obj) + (magit-git-insert "cat-file" "blob" obj) + (magit-git-insert "cat-file" "-p" + (if (equal obj "{index}") + (concat ":" file) + (concat obj ":" file)))) + (setq buffer-file-coding-system last-coding-system-used) + nil)) + ;;; Predicates (defun magit-no-commit-p () @@ -1441,21 +1468,29 @@ string \"true\", otherwise return nil." (equal (magit-git-str "rev-parse" args) "true")) (defun magit-rev-verify (rev) - (magit-git-string-p "rev-parse" "--verify" rev)) + (magit-git-string "rev-parse" "--verify" rev)) (defun magit-commit-p (rev) - "Return full hash for REV if it names an existing commit." + "Return non-nil if REV can be dereferences as a commit. +Otherwise return nil. Use `magit-commit-oid' if you actually need +the oid; eventually this function will return t instead of the oid, +as it currently does for backward compatibility." + ;; TODO Return t instead of the oid. (magit-rev-verify (magit--rev-dereference rev))) -(defalias 'magit-rev-verify-commit #'magit-commit-p) - -(defalias 'magit-rev-hash #'magit-commit-p) +(defun magit-commit-oid (rev &optional noerror) + "Return commit oid for REV if it can be dereferences as a commit. +Otherwise signal an error, or return nil, if optional NOERROR is non-nil." + (cond ((magit-rev-verify (magit--rev-dereference rev))) + (noerror nil) + ((error "%s cannot be dereferenced as a commit" rev)))) (defun magit--rev-dereference (rev) "Return a rev that forces Git to interpret REV as a commit. -If REV is nil or has the form \":/TEXT\", return REV itself." +Do so by appending \"^{commit}\"; see \"--verify\" in git-rev-parse(1). +However, if REV is nil or has the form \":/TEXT\", return REV itself." (cond ((not rev) nil) - ((string-match-p "^:/" rev) rev) + ((string-prefix-p ":/" rev) rev) ((concat rev "^{commit}")))) (defun magit-rev-equal (a b) @@ -1464,20 +1499,18 @@ If REV is nil or has the form \":/TEXT\", return REV itself." (defun magit-rev-eq (a b) "Return t if A and B refer to the same commit." - (let ((a (magit-commit-p a)) - (b (magit-commit-p b))) - (and a b (equal a b)))) + (and-let ((a (magit-commit-oid a t)) + (b (magit-commit-oid b t))) + (equal a b))) (defun magit-rev-ancestor-p (a b) "Return non-nil if commit A is an ancestor of commit B." (magit-git-success "merge-base" "--is-ancestor" a b)) (defun magit-rev-head-p (rev) + "Return t if REV can be dereferences as the `HEAD' commit." (or (equal rev "HEAD") - (and rev - (not (string-search ".." rev)) - (equal (magit-rev-parse rev) - (magit-rev-parse "HEAD"))))) + (magit-rev-eq rev "HEAD"))) (defun magit-rev-author-p (rev) "Return t if the user is the author of REV. @@ -1584,9 +1617,9 @@ nil, then use \"heads/\"." A symbolic-ref pointing to some ref, is `equal' to that ref, as are two symbolic-refs pointing to the same ref. Refnames may be abbreviated." - (let ((a (magit-ref-fullname a)) - (b (magit-ref-fullname b))) - (and a b (equal a b)))) + (and-let ((a (magit-ref-fullname a)) + (b (magit-ref-fullname b))) + (equal a b))) (defun magit-ref-eq (a b) "Return t if the refnames A and B are `eq'. @@ -1682,7 +1715,7 @@ to, or to some other symbolic-ref that points to the same ref." (magit-current-blame-chunk)))) (oref chunk orig-rev)) (and magit-buffer-file-name - magit-buffer-refname) + magit-buffer-revision) (and (derived-mode-p 'magit-stash-mode 'magit-merge-preview-mode 'magit-revision-mode) @@ -1750,10 +1783,10 @@ The amount of time spent searching is limited by (concat remote "/" newname)))) (pcase-dolist (`(,branch ,upstream) branches) (cond - ((equal upstream oldname) - (magit-set-upstream-branch branch new)) - ((equal upstream (concat remote "/" oldname)) - (magit-set-upstream-branch branch (concat remote "/" newname)))))))) + ((equal upstream oldname) + (magit-set-upstream-branch branch new)) + ((equal upstream (concat remote "/" oldname)) + (magit-set-upstream-branch branch (concat remote "/" newname)))))))) (defun magit--get-default-branch (&optional update) (let ((remote (magit-primary-remote))) @@ -1874,19 +1907,18 @@ according to the branch type." (defun magit-get-push-branch (&optional branch verify) (magit--with-refresh-cache (list default-directory 'magit-get-push-branch branch verify) - (and-let* ((branch (or branch (setq branch (magit-get-current-branch)))) - (remote (magit-get-push-remote branch)) - (target (concat remote "/" branch))) + (and-let* + ((branch (magit-ref-abbrev (or branch (magit-get-current-branch)))) + (remote (magit-get-push-remote branch)) + (target (concat remote "/" branch))) (and (or (not verify) (magit-rev-verify target)) (magit--propertize-face target 'magit-branch-remote))))) (defun magit-get-@{push}-branch (&optional branch) - (let ((ref (magit-rev-parse "--symbolic-full-name" - (concat branch "@{push}")))) - (and ref - (string-prefix-p "refs/remotes/" ref) - (substring ref 13)))) + (and-let* ((branch (magit-ref-abbrev (or branch (magit-get-current-branch)))) + (target (magit-ref-fullname (concat branch "@{push}")))) + (magit-ref-abbrev target))) (defun magit-get-remote (&optional branch) (and (or branch (setq branch (magit-get-current-branch))) @@ -2232,11 +2264,11 @@ specified using `core.worktree'." (let* ((default-directory (car worktree)) (wt (and (not (magit-get-boolean "core.bare")) (magit-get "core.worktree")))) - (if (and wt (file-exists-p (expand-file-name wt))) - (progn (setf (nth 0 worktree) (expand-file-name wt)) - (setf (nth 2 worktree) (magit-rev-parse "HEAD")) - (setf (nth 3 worktree) (magit-get-current-branch))) - (setf (nth 3 worktree) t)))) + (cond ((and wt (file-exists-p (expand-file-name wt))) + (setf (nth 0 worktree) (expand-file-name wt)) + (setf (nth 2 worktree) (magit-rev-parse "HEAD")) + (setf (nth 3 worktree) (magit-get-current-branch))) + ((setf (nth 3 worktree) t))))) ((string-equal line "detached") (setf (nth 4 worktree) t)) ((string-prefix-p line "locked") @@ -2271,8 +2303,8 @@ specified using `core.worktree'." 'magit-branch-local 'magit-branch-remote))) -(defun magit-tag-p (rev) - (car (member rev (magit-list-tags)))) +(defun magit-tag-p (obj) + (equal (magit-object-type obj) "tag")) (defun magit-remote-p (string) (car (member string (magit-list-remotes)))) @@ -2342,10 +2374,10 @@ If `first-parent' is set, traverse only first parents." (defun magit-rev-abbrev (rev) (magit-rev-parse (magit-abbrev-arg "short") rev)) -(defun magit--abbrev-if-hash (rev) - (cond ((or (magit-ref-p rev) (member rev '("{index}" "{worktree}"))) rev) - ((magit-rev-parse (magit-abbrev-arg "short") rev)) - (rev))) +(defun magit--abbrev-if-oid (obj) + (cond ((or (magit-ref-p obj) (member obj '("{index}" "{worktree}"))) obj) + ((magit-rev-parse (magit-abbrev-arg "short") obj)) + (obj))) (defun magit-commit-children (rev &optional args) (seq-keep (lambda (line) @@ -2469,18 +2501,18 @@ and this option only controls what face is used.") (string-match "^[^/]*/" push) (setq push (substring push 0 (match-end 0)))) (cond - ((equal name current) - (setq head - (concat push - (magit--propertize-face - name 'magit-branch-current)))) - ((equal name target) - (setq upstream - (concat push - (magit--propertize-face - name '(magit-branch-upstream - magit-branch-local))))) - ((push (concat push name) combined))))) + ((equal name current) + (setq head + (concat push + (magit--propertize-face + name 'magit-branch-current)))) + ((equal name target) + (setq upstream + (concat push + (magit--propertize-face + name '(magit-branch-upstream + magit-branch-local))))) + ((push (concat push name) combined))))) (cond-let ((or upstream (not target))) ((member target remotes) @@ -2568,8 +2600,8 @@ and this option only controls what face is used.") (beg (or beg "HEAD")) (end (or end "HEAD"))) (when abbrev - (setq beg (magit--abbrev-if-hash beg)) - (setq end (magit--abbrev-if-hash end))) + (setq beg (magit--abbrev-if-oid beg)) + (setq end (magit--abbrev-if-oid end))) (pcase sep (".." (cons beg end)) ("..." (and$ (magit-git-string "merge-base" beg end) @@ -2583,15 +2615,18 @@ and this option only controls what face is used.") (list beg end sep))))) (defun magit-hash-range (range) + "Return a string with the revisions in RANGE replaced with commit oids. +Either side of RANGE may be omitted, and RANGE may be just a revision. +If either revision cannot be dereferenced as a commit, signal an error." (if (string-match magit-range-re range) (magit-bind-match-strings (beg sep end) range (and (or beg end) - (let ((beg-hash (and beg (magit-rev-hash beg))) - (end-hash (and end (magit-rev-hash end)))) - (and (or (not beg) beg-hash) - (or (not end) end-hash) - (concat beg-hash sep end-hash))))) - (magit-rev-hash range))) + (let ((beg-oid (and beg (magit-commit-oid beg))) + (end-oid (and end (magit-commit-oid end)))) + (and (or (not beg) beg-oid) + (or (not end) end-oid) + (concat beg-oid sep end-oid))))) + (magit-commit-oid range))) (defvar magit-revision-faces '(magit-hash @@ -2645,7 +2680,7 @@ and this option only controls what face is used.") (and (not (equal string "@")) (or (and (>= (length string) 7) (string-match-p "[a-z]" string) - (magit-commit-p string)) + (magit-commit-oid string t)) (and (magit-ref-p string) (member (get-text-property (point) 'face) magit-revision-faces))) @@ -2729,10 +2764,11 @@ and this option only controls what face is used.") (lambda () (magit--minibuf-default-add-commit) (setq-local crm-separator "\\.\\.\\.?")) - (magit-completing-read-multiple - (concat prompt ": ") - (magit-list-refnames) - nil 'any nil 'magit-revision-history default nil t))) + (let ((crm-prompt "%p")) + (magit-completing-read-multiple + (concat prompt ": ") + (magit-list-refnames) + nil 'any nil 'magit-revision-history default nil t)))) (defun magit-read-remote-branch (prompt &optional remote default local-branch require-match) @@ -2812,6 +2848,23 @@ and this option only controls what face is used.") (magit-completing-read prompt (delete exclude (magit-list-refnames)) nil 'any nil 'magit-revision-history default)))) +(defun magit-read-other-branches-or-commits + (prompt &optional exclude secondary-default) + (let* ((current (magit-get-current-branch)) + (atpoint (magit-branch-or-commit-at-point)) + (exclude (or exclude current)) + (default (or (and (not (equal atpoint exclude)) + (not (and (not current) + (magit-rev-equal atpoint "HEAD"))) + atpoint) + (and (not (equal current exclude)) current) + secondary-default + (magit-get-previous-branch)))) + (minibuffer-with-setup-hook #'magit--minibuf-default-add-commit + (magit-completing-read-multiple + prompt (delete exclude (magit-list-refnames)) + nil 'any nil 'magit-revision-history default)))) + (defun magit-read-other-local-branch (prompt &optional exclude secondary-default) (let* ((current (magit-get-current-branch)) @@ -2936,8 +2989,17 @@ out. Only existing branches can be selected." (magit-get-remote)))) (defun magit-read-module-path (prompt &optional predicate) + ;; Predicates are evaluate with the minibuffer as the current buffer. + ;; Unlike for other completion frameworks, Helm does not ensure that + ;; the value of `default-directory' in that buffer is the same as in + ;; the buffer from which completion was invoked. (magit-completing-read prompt (magit-list-module-paths) - predicate t nil nil + (and predicate + (let ((dir default-directory)) + (lambda (module) + (let ((default-directory dir)) + (funcall predicate module))))) + t nil nil (magit-module-at-point predicate))) (defun magit-module-confirm (verb &optional predicate) @@ -2993,6 +3055,21 @@ out. Only existing branches can be selected." (server-send-string client msg)))) ;;; _ + +(define-obsolete-function-alias 'magit-git-string-p + #'magit-git-string "Magit 4.6.0") + +(define-obsolete-function-alias 'magit-rev-verify-commit + #'magit-commit-p "Magit 4.6.0") + +(define-obsolete-function-alias 'magit-rev-hash + #'magit-commit-p "Magit 4.6.0" + "Return oid for REV if it names an existing commit, nil otherwise. +Instead use `magit-commit-p' or `magit-commit-oid'.") + +(define-obsolete-function-alias 'magit--abbrev-if-hash + #'magit--abbrev-if-oid "Magit 4.6.0") + (provide 'magit-git) ;; Local Variables: ;; read-symbol-shorthands: ( @@ -3000,6 +3077,7 @@ out. Only existing branches can be selected." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-gitignore.el b/elpa/magit-20260422.2206/magit-gitignore.el similarity index 51% rename from elpa/magit-20251217.1836/magit-gitignore.el rename to elpa/magit-20260422.2206/magit-gitignore.el index 8d2eaf29..140de233 100644 --- a/elpa/magit-20251217.1836/magit-gitignore.el +++ b/elpa/magit-20260422.2206/magit-gitignore.el @@ -1,6 +1,6 @@ ;;; magit-gitignore.el --- Intentionally untracked files -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -35,16 +35,10 @@ "Instruct Git to ignore a file or pattern." :man-page "gitignore" ["Gitignore" - ("t" "shared at toplevel (.gitignore)" - magit-gitignore-in-topdir) - ("s" "shared in subdirectory (path/to/.gitignore)" - magit-gitignore-in-subdir) - ("p" "privately (.git/info/exclude)" - magit-gitignore-in-gitdir) - ("g" magit-gitignore-on-system - :if (##magit-get "core.excludesfile") - :description (##format "privately for all repositories (%s)" - (magit-get "core.excludesfile")))] + ("t" magit-gitignore-in-topdir) + ("s" magit-gitignore-in-subdir) + ("p" magit-gitignore-in-gitdir) + ("g" magit-gitignore-on-system)] ["Skip worktree" (7 "w" "do skip worktree" magit-skip-worktree) (7 "W" "do not skip worktree" magit-no-skip-worktree)] @@ -54,51 +48,56 @@ ;;; Gitignore Commands -;;;###autoload -(defun magit-gitignore-in-topdir (rule) +;;;###autoload(autoload 'magit-gitignore-in-topdir "magit-gitignore" nil t) +(transient-define-suffix magit-gitignore-in-topdir (rule) "Add the Git ignore RULE to the top-level \".gitignore\" file. Since this file is tracked, it is shared with other clones of the repository. Also stage the file." + :description "shared at toplevel (.gitignore)" (interactive (list (magit-gitignore-read-pattern))) - (magit-with-toplevel - (magit--gitignore rule ".gitignore") - (magit-run-git "add" ".gitignore"))) + (magit--gitignore rule (expand-file-name ".gitignore" (magit-toplevel)) t)) -;;;###autoload -(defun magit-gitignore-in-subdir (rule directory) +;;;###autoload(autoload 'magit-gitignore-in-subdir "magit-gitignore" nil t) +(transient-define-suffix magit-gitignore-in-subdir (rule directory) "Add the Git ignore RULE to a \".gitignore\" file in DIRECTORY. Prompt the user for a directory and add the rule to the \".gitignore\" file in that directory. Since such files are tracked, they are shared with other clones of the repository. Also stage the file." - (interactive (list (magit-gitignore-read-pattern) - (read-directory-name "Limit rule to files in: "))) - (magit-with-toplevel - (let ((file (expand-file-name ".gitignore" directory))) - (magit--gitignore rule file) - (magit-run-git "add" (magit-convert-filename-for-git file))))) - -;;;###autoload -(defun magit-gitignore-in-gitdir (rule) + :description "shared in subdirectory (path/to/.gitignore)" + (interactive (let ((dir (expand-file-name + (read-directory-name + "Limit rule to files in: " + (and$ (magit-current-file) + (file-name-directory + (expand-file-name $ (magit-toplevel)))))))) + (list (magit-gitignore-read-pattern dir) dir))) + (magit--gitignore rule (expand-file-name ".gitignore" directory) t)) + +;;;###autoload(autoload 'magit-gitignore-in-gitdir "magit-gitignore" nil t) +(transient-define-suffix magit-gitignore-in-gitdir (rule) "Add the Git ignore RULE to \"$GIT_DIR/info/exclude\". Rules in that file only affects this clone of the repository." + :description "privately (.git/info/exclude)" (interactive (list (magit-gitignore-read-pattern))) - (magit--gitignore rule (expand-file-name "info/exclude" (magit-gitdir))) - (magit-refresh)) + (magit--gitignore rule (expand-file-name "info/exclude" (magit-gitdir)))) -;;;###autoload -(defun magit-gitignore-on-system (rule) +;;;###autoload(autoload 'magit-gitignore-on-system "magit-gitignore" nil t) +(transient-define-suffix magit-gitignore-on-system (rule) "Add the Git ignore RULE to the file specified by `core.excludesFile'. Rules that are defined in that file affect all local repositories." + :inapt-if-not (##magit-get "core.excludesfile") + :description (##format "privately for all repositories (%s)" + (or (magit-get "core.excludesfile") + "core.excludesfile is not set")) (interactive (list (magit-gitignore-read-pattern))) - (magit--gitignore rule - (or (magit-get "core.excludesFile") - (error "Variable `core.excludesFile' isn't set"))) - (magit-refresh)) - -(defun magit--gitignore (rule file) - (when-let ((directory (file-name-directory file))) - (make-directory directory t)) + (if-let ((file (magit-get "core.excludesFile"))) + (magit--gitignore rule file) + (error "Variable `core.excludesFile' isn't set"))) + +(defun magit--gitignore (rule file &optional stage) + (when$ (file-name-directory file) + (make-directory $ t)) (with-temp-buffer (when (file-exists-p file) (insert-file-contents file)) @@ -107,31 +106,21 @@ Rules that are defined in that file affect all local repositories." (insert "\n")) (insert (replace-regexp-in-string "\\(\\\\*\\)" "\\1\\1" rule)) (insert "\n") - (write-region nil nil file))) - -(defun magit-gitignore-read-pattern () - (let* ((default (magit-current-file)) - (base (car magit-buffer-diff-files)) - (base (and base (file-directory-p base) base)) - (choices - (delete-dups - (mapcan - (lambda (file) - (cons (concat "/" file) - (and$ (file-name-extension file) - (list (concat "/" (file-name-directory file) "*." $) - (concat "*." $))))) - (sort (nconc - (magit-untracked-files nil base) - ;; The untracked section of the status buffer lists - ;; directories containing only untracked files. - ;; Add those as candidates. - (seq-filter #'directory-name-p - (magit-list-files - "--other" "--exclude-standard" "--directory" - "--no-empty-directory" "--" base))) - #'string-lessp))))) + (write-region nil nil file)) + (if stage + (magit-with-toplevel + (magit-run-git "add" (magit-convert-filename-for-git file))) + (magit-refresh))) + +(defun magit-gitignore-read-pattern (&optional directory) + (let ((choices (magit--gitignore-patterns directory)) + (default (magit-current-file))) (when default + (when directory + (setq default + (substring default + (length + (file-relative-name directory (magit-toplevel)))))) (setq default (concat "/" default)) (unless (member default choices) (setq default (concat "*." (file-name-extension default))) @@ -140,18 +129,39 @@ Rules that are defined in that file affect all local repositories." (magit-completing-read "File or pattern to ignore" choices nil 'any nil nil default))) +(defun magit--gitignore-patterns (&optional directory) + (let* ((topdir (magit-toplevel)) + (default-directory (or directory topdir)) + (files (magit-untracked-files t directory)) + ;; Include directories that contain only untracked files. + (dirs (seq-filter (##equal (substring % -1) "/") + (magit-untracked-files nil directory))) + (globs nil) + (dirglobs nil)) + (when directory + (let ((beg (length (file-relative-name directory topdir)))) + (setq files (mapcar (##substring % beg) files)) + (setq dirs (mapcar (##substring % beg) dirs)))) + (dolist (file files) + (when-let ((ext (file-name-extension file))) + (cl-pushnew (concat "*." ext) globs :test #'equal) + (when-let ((dir (file-name-directory file))) + (cl-pushnew (concat dir "*." ext) dirglobs :test #'equal)))) + (sort (nconc globs + (mapcar (##concat "/" %) (nconc files dirs dirglobs))) + #'string<))) + ;;; Skip Worktree Commands ;;;###autoload (defun magit-skip-worktree (file) "Call \"git update-index --skip-worktree -- FILE\"." (interactive - (list (magit-read-file-choice "Skip worktree for" - (magit-with-toplevel - (cl-set-difference - (magit-list-files) - (magit-skip-worktree-files) - :test #'equal))))) + (list (magit-read-file-choice "Skip worktree for" + (cl-set-difference + (magit-list-files) + (magit-skip-worktree-files) + :test #'equal)))) (magit-with-toplevel (magit-run-git "update-index" "--skip-worktree" "--" file))) @@ -159,9 +169,8 @@ Rules that are defined in that file affect all local repositories." (defun magit-no-skip-worktree (file) "Call \"git update-index --no-skip-worktree -- FILE\"." (interactive - (list (magit-read-file-choice "Do not skip worktree for" - (magit-with-toplevel - (magit-skip-worktree-files))))) + (list (magit-read-file-choice "Do not skip worktree for" + (magit-skip-worktree-files)))) (magit-with-toplevel (magit-run-git "update-index" "--no-skip-worktree" "--" file))) @@ -171,12 +180,11 @@ Rules that are defined in that file affect all local repositories." (defun magit-assume-unchanged (file) "Call \"git update-index --assume-unchanged -- FILE\"." (interactive - (list (magit-read-file-choice "Assume file to be unchanged" - (magit-with-toplevel - (cl-set-difference - (magit-list-files) - (magit-assume-unchanged-files) - :test #'equal))))) + (list (magit-read-file-choice "Assume file to be unchanged" + (cl-set-difference + (magit-list-files) + (magit-assume-unchanged-files) + :test #'equal)))) (magit-with-toplevel (magit-run-git "update-index" "--assume-unchanged" "--" file))) @@ -184,9 +192,8 @@ Rules that are defined in that file affect all local repositories." (defun magit-no-assume-unchanged (file) "Call \"git update-index --no-assume-unchanged -- FILE\"." (interactive - (list (magit-read-file-choice "Do not assume file to be unchanged" - (magit-with-toplevel - (magit-assume-unchanged-files))))) + (list (magit-read-file-choice "Do not assume file to be unchanged" + (magit-assume-unchanged-files)))) (magit-with-toplevel (magit-run-git "update-index" "--no-assume-unchanged" "--" file))) @@ -198,6 +205,7 @@ Rules that are defined in that file affect all local repositories." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-log.el b/elpa/magit-20260422.2206/magit-log.el similarity index 94% rename from elpa/magit-20251217.1836/magit-log.el rename to elpa/magit-20260422.2206/magit-log.el index c2345d26..603a8533 100644 --- a/elpa/magit-20251217.1836/magit-log.el +++ b/elpa/magit-20260422.2206/magit-log.el @@ -1,6 +1,6 @@ ;;; magit-log.el --- Inspect Git history -*- lexical-binding:t; coding:utf-8 -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -374,6 +374,12 @@ commits before and half after." :group 'magit-log :type 'integer) +;;; Variables + +(defvar-local magit-buffer-log-revisions nil) +(defvar-local magit-buffer-log-args nil) +(defvar-local magit-buffer-log-files nil) + ;;; Arguments ;;;; Prefix Classes @@ -569,19 +575,19 @@ commits before and half after." ("b" "buffer lock" magit-toggle-buffer-lock)]] (interactive) (cond - ((not (eq transient-current-command 'magit-log-refresh)) - (pcase major-mode - ('magit-reflog-mode - (user-error "Cannot change log arguments in reflog buffers")) - ('magit-cherry-mode - (user-error "Cannot change log arguments in cherry buffers"))) - (transient-setup 'magit-log-refresh)) - (t - (pcase-let ((`(,args ,files) (magit-log-arguments))) - (setq magit-buffer-log-args args) - (unless (derived-mode-p 'magit-log-select-mode) - (setq magit-buffer-log-files files))) - (magit-refresh)))) + ((not (eq transient-current-command 'magit-log-refresh)) + (pcase major-mode + ('magit-reflog-mode + (user-error "Cannot change log arguments in reflog buffers")) + ('magit-cherry-mode + (user-error "Cannot change log arguments in cherry buffers"))) + (transient-setup 'magit-log-refresh)) + (t + (pcase-let ((`(,args ,files) (magit-log-arguments))) + (setq magit-buffer-log-args args) + (unless (derived-mode-p 'magit-log-select-mode) + (setq magit-buffer-log-files files))) + (magit-refresh)))) ;;;; Infix Commands @@ -696,26 +702,26 @@ When the upstream is a local branch, then also show its own upstream. When `HEAD' is detached, then show log for that, the previously checked out branch and its upstream and push-target." (interactive - (cons (let ((current (magit-get-current-branch)) - head rebase target upstream upup) - (unless current - (setq rebase (magit-rebase--get-state-lines "head-name")) - (cond (rebase - (setq rebase (magit-ref-abbrev rebase)) - (setq current rebase) - (setq head "HEAD")) - ((setq current (magit-get-previous-branch))))) - (cond (current - (setq current - (magit--propertize-face current 'magit-branch-local)) - (setq target (magit-get-push-branch current t)) - (setq upstream (magit-get-upstream-branch current)) - (when upstream - (setq upup (and (magit-local-branch-p upstream) - (magit-get-upstream-branch upstream))))) - ((setq head "HEAD"))) - (delq nil (list current head target upstream upup))) - (magit-log-arguments))) + (cons (let ((current (magit-get-current-branch)) + head rebase target upstream upup) + (unless current + (setq rebase (magit-rebase--get-state-lines "head-name")) + (cond (rebase + (setq rebase (magit-ref-abbrev rebase)) + (setq current rebase) + (setq head "HEAD")) + ((setq current (magit-get-previous-branch))))) + (cond (current + (setq current + (magit--propertize-face current 'magit-branch-local)) + (setq target (magit-get-push-branch current t)) + (setq upstream (magit-get-upstream-branch current)) + (when upstream + (setq upup (and (magit-local-branch-p upstream) + (magit-get-upstream-branch upstream))))) + ((setq head "HEAD"))) + (delq nil (list current head target upstream upup))) + (magit-log-arguments))) (magit-log-setup-buffer revs args files)) ;;;###autoload @@ -779,7 +785,7 @@ restrict the log to the lines that the region touches." (require 'magit) (if-let ((file (magit-file-relative-name))) (magit-log-setup-buffer - (list (or magit-buffer-refname + (list (or magit-buffer-revision (magit-get-current-branch) "HEAD")) (let ((args (car (magit-log-arguments)))) @@ -802,7 +808,7 @@ restrict the log to the lines that the region touches." (user-error "Buffer isn't visiting a file")) (or (funcall magit-log-trace-definition-function) (user-error "No function at point found")) - (or magit-buffer-refname + (or magit-buffer-revision (magit-get-current-branch) "HEAD"))) (require 'magit) @@ -844,10 +850,10 @@ directly on BRANCH, then show approximately This command requires git-when-merged, which is available from https://github.com/mhagger/git-when-merged." (interactive - (append (let ((commit (magit-read-branch-or-commit "Log merge of commit"))) - (list commit - (magit-read-other-branch "Merged into" commit))) - (magit-log-arguments))) + (append (let ((commit (magit-read-branch-or-commit "Log merge of commit"))) + (list commit + (magit-read-other-branch "Merged into" commit))) + (magit-log-arguments))) (unless (magit-git-executable-find "git-when-merged") (user-error "This command requires git-when-merged (%s)" "https://github.com/mhagger/git-when-merged")) @@ -872,7 +878,7 @@ https://github.com/mhagger/git-when-merged." (to (if (<= to 0) branch (format "%s~%s" branch to)))) - (unless (magit-rev-verify-commit from) + (unless (magit-commit-p from) (setq from (magit-git-string "rev-list" "--max-parents=0" commit))) (magit-log-setup-buffer (list (concat from ".." to)) @@ -970,13 +976,13 @@ nothing else. If invoked outside any log buffer, then display the log buffer of the current repository first; creating it if necessary." (interactive - (list (magit-completing-read - "In log, jump to" - (magit-list-refnames nil t) - nil 'any nil 'magit-revision-history - (or (and$ (magit-commit-at-point) - (magit-rev-fixup-target $)) - (magit-get-current-branch))))) + (list (magit-completing-read + "In log, jump to" + (magit-list-refnames nil t) + nil 'any nil 'magit-revision-history + (or (and$ (magit-commit-at-point) + (magit-rev-fixup-target $)) + (magit-get-current-branch))))) (with-current-buffer (cond ((derived-mode-p 'magit-log-mode) (current-buffer)) @@ -1020,16 +1026,16 @@ of the current repository first; creating it if necessary." (defun magit-shortlog-since (commit args) "Show a history summary for commits since REV." (interactive - (list (magit-read-branch-or-commit "Shortlog since" (magit-get-current-tag)) - (transient-args 'magit-shortlog))) + (list (magit-read-branch-or-commit "Shortlog since" (magit-get-current-tag)) + (transient-args 'magit-shortlog))) (magit-git-shortlog (concat commit "..") args)) ;;;###autoload (defun magit-shortlog-range (rev-or-range args) "Show a history summary for commit or range REV-OR-RANGE." (interactive - (list (magit-read-range-or-commit "Shortlog for revision or range") - (transient-args 'magit-shortlog))) + (list (magit-read-range-or-commit "Shortlog for revision or range") + (transient-args 'magit-shortlog))) (magit-git-shortlog rev-or-range args)) ;;;; Movement Commands @@ -1131,7 +1137,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (require 'magit) (with-current-buffer (magit-setup-buffer #'magit-log-mode locked - (magit-buffer-revisions revs) + (magit-buffer-log-revisions revs) (magit-buffer-log-args args) (magit-buffer-log-files files)) (when (if focus @@ -1141,7 +1147,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (current-buffer))) (defun magit-log-refresh-buffer () - (let ((revs magit-buffer-revisions) + (let ((revs magit-buffer-log-revisions) (args magit-buffer-log-args) (files magit-buffer-log-files) (limit (magit-log-get-commit-limit))) @@ -1181,24 +1187,24 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (defvar-local magit-log--color-graph nil) (defun magit-log--maybe-drop-color-graph (args limit) - (if (member "--color" args) - (if (cond ((not (member "--graph" args))) - ((not magit-log-color-graph-limit) nil) - ((not limit) - (message "Dropping --color because -n isn't set (see %s)" - 'magit-log-color-graph-limit)) - ((> limit magit-log-color-graph-limit) - (message "Dropping --color because -n is larger than %s" - 'magit-log-color-graph-limit))) - (progn (setq args (remove "--color" args)) - (setq magit-log--color-graph nil)) - (setq magit-log--color-graph t)) - (setq magit-log--color-graph nil)) + (cond ((not (member "--color" args)) + (setq magit-log--color-graph nil)) + ((cond ((not (member "--graph" args)) t) + ((not magit-log-color-graph-limit) nil) + ((not limit) + (message "Dropping --color because -n isn't set (see %s)" + 'magit-log-color-graph-limit)) + ((> limit magit-log-color-graph-limit) + (message "Dropping --color because -n is larger than %s" + 'magit-log-color-graph-limit))) + (setq args (remove "--color" args)) + (setq magit-log--color-graph nil)) + ((setq magit-log--color-graph t))) args) (cl-defmethod magit-buffer-value (&context (major-mode magit-log-mode)) - (append magit-buffer-revisions - (if (and magit-buffer-revisions magit-buffer-log-files) + (append magit-buffer-log-revisions + (if (and magit-buffer-log-revisions magit-buffer-log-files) (cons "--" magit-buffer-log-files) magit-buffer-log-files))) @@ -1257,17 +1263,17 @@ Do not add this to a hook variable." (setq args (remove "--show-signature" args)) (let ((limit (magit-log-get-commit-limit args))) (cond - ((not limit) - (message - "Dropping --show-signature because -n isn't set (see %s)" - 'magit-log-show-signatures-limit) - "") - ((> limit magit-log-show-signatures-limit) - (message - "Dropping --show-signature because -n is larger than %s" - 'magit-log-show-signatures-limit) - "") - ("%G?")))) + ((not limit) + (message + "Dropping --show-signature because -n isn't set (see %s)" + 'magit-log-show-signatures-limit) + "") + ((> limit magit-log-show-signatures-limit) + (message + "Dropping --show-signature because -n is larger than %s" + 'magit-log-show-signatures-limit) + "") + ("%G?")))) (if magit-log-margin-show-committer-date "%ct" "%at") (if magit-log-trailer-labels (format "%%(trailers:%s%s)" @@ -1779,20 +1785,20 @@ Type \\[magit-log-select-quit] to abort without selecting a commit." (defun magit-log-select-setup-buffer (revs args) (magit-setup-buffer #'magit-log-select-mode nil - (magit-buffer-revisions revs) + (magit-buffer-log-revisions revs) (magit-buffer-log-args args))) (defun magit-log-select-refresh-buffer () (setq magit-section-inhibit-markers t) (setq magit-section-insert-in-reverse t) (magit-insert-section (logbuf) - (magit--insert-log t magit-buffer-revisions + (magit--insert-log t magit-buffer-log-revisions (magit-log--maybe-drop-color-graph magit-buffer-log-args (magit-log-get-commit-limit))))) (cl-defmethod magit-buffer-value (&context (major-mode magit-log-select-mode)) - magit-buffer-revisions) + magit-buffer-log-revisions) (defvar-local magit-log-select-pick-function nil) (defvar-local magit-log-select-quit-function nil) @@ -1881,11 +1887,14 @@ Type \\[magit-cherry-pick] to apply the commit at point. (magit-hack-dir-local-variables) (setq magit--imenu-group-types 'cherries)) +(defvar-local magit-buffer-cherry-upstream nil) +(defvar-local magit-buffer-cherry-range nil) + (defun magit-cherry-setup-buffer (head upstream) (magit-setup-buffer #'magit-cherry-mode nil (magit-buffer-refname head) - (magit-buffer-upstream upstream) - (magit-buffer-range (concat upstream ".." head)))) + (magit-buffer-cherry-upstream upstream) + (magit-buffer-cherry-range (concat upstream ".." head)))) (defun magit-cherry-refresh-buffer () (setq magit-section-insert-in-reverse t) @@ -1893,15 +1902,15 @@ Type \\[magit-cherry-pick] to apply the commit at point. (magit-run-section-hook 'magit-cherry-sections-hook))) (cl-defmethod magit-buffer-value (&context (major-mode magit-cherry-mode)) - magit-buffer-range) + magit-buffer-cherry-range) ;;;###autoload (defun magit-cherry (head upstream) "Show commits in a branch that are not merged in the upstream branch." (interactive - (let ((head (magit-read-branch "Cherry head"))) - (list head (magit-read-other-branch "Cherry upstream" head - (magit-get-upstream-branch head))))) + (let ((head (magit-read-branch "Cherry head"))) + (list head (magit-read-other-branch "Cherry upstream" head + (magit-get-upstream-branch head))))) (require 'magit) (magit-cherry-setup-buffer head upstream)) @@ -1909,10 +1918,11 @@ Type \\[magit-cherry-pick] to apply the commit at point. "Insert headers appropriate for `magit-cherry-mode' buffers." (let ((branch (propertize magit-buffer-refname 'font-lock-face 'magit-branch-local)) - (upstream (propertize magit-buffer-upstream 'font-lock-face - (if (magit-local-branch-p magit-buffer-upstream) - 'magit-branch-local - 'magit-branch-remote)))) + (upstream (propertize + magit-buffer-cherry-upstream 'font-lock-face + (if (magit-local-branch-p magit-buffer-cherry-upstream) + 'magit-branch-local + 'magit-branch-remote)))) (magit-insert-head-branch-header branch) (magit-insert-upstream-branch-header branch upstream "Upstream: ") (insert ?\n))) @@ -1923,7 +1933,7 @@ Type \\[magit-cherry-pick] to apply the commit at point. (magit-insert-heading t "Cherry commits") (magit-git-wash (apply-partially #'magit-log-wash-log 'cherry) "cherry" "-v" "--abbrev" - magit-buffer-upstream + magit-buffer-cherry-upstream magit-buffer-refname))) ;;; Log Sections @@ -2114,6 +2124,7 @@ all others with \"-\"." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-margin.el b/elpa/magit-20260422.2206/magit-margin.el similarity index 99% rename from elpa/magit-20251217.1836/magit-margin.el rename to elpa/magit-20260422.2206/magit-margin.el index 9200c89b..50e0ce25 100644 --- a/elpa/magit-20251217.1836/magit-margin.el +++ b/elpa/magit-20260422.2206/magit-margin.el @@ -1,6 +1,6 @@ ;;; magit-margin.el --- Margins in Magit buffers -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -263,6 +263,7 @@ English.") ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-merge.el b/elpa/magit-20260422.2206/magit-merge.el similarity index 88% rename from elpa/magit-20251217.1836/magit-merge.el rename to elpa/magit-20260422.2206/magit-merge.el index 4d276a58..a60de226 100644 --- a/elpa/magit-20251217.1836/magit-merge.el +++ b/elpa/magit-20260422.2206/magit-merge.el @@ -1,6 +1,6 @@ ;;; magit-merge.el --- Merge functionality -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -95,8 +95,10 @@ the user inspect the result. With a prefix argument pretend the merge failed to give the user the opportunity to inspect the merge. +To create an octopus-merge, separate branches with commas. + \(git merge --no-edit|--no-commit [ARGS] REV)" - (interactive (list (magit-read-other-branch-or-commit "Merge") + (interactive (list (magit-read-other-branches-or-commits "Merge") (magit-merge-arguments) current-prefix-arg)) (magit-merge-assert) @@ -105,24 +107,30 @@ merge. ;;;###autoload (defun magit-merge-editmsg (rev &optional args) "Merge commit REV into the current branch; and edit message. + Perform the merge and prepare a commit message but let the user edit it. -\n(git merge --edit --no-ff [ARGS] REV)" - (interactive (list (magit-read-other-branch-or-commit "Merge") + +To create an octopus-merge, separate branches with commas. + +\(git merge --edit --no-ff [ARGS] REV)" + (interactive (list (magit-read-other-branches-or-commits "Merge") (magit-merge-arguments))) (magit-merge-assert) (cl-pushnew "--no-ff" args :test #'equal) - (apply #'magit-run-git-with-editor "merge" "--edit" - (append (delete "--ff-only" args) - (list rev)))) + (magit-run-git-with-editor "merge" "--edit" (delete "--ff-only" args) rev)) ;;;###autoload (defun magit-merge-nocommit (rev &optional args) "Merge commit REV into the current branch; pretending it failed. + Pretend the merge failed to give the user the opportunity to inspect the merge and change the commit message. -\n(git merge --no-commit --no-ff [ARGS] REV)" - (interactive (list (magit-read-other-branch-or-commit "Merge") + +To create an octopus-merge, separate branches with commas. + +\(git merge --no-commit --no-ff [ARGS] REV)" + (interactive (list (magit-read-other-branches-or-commits "Merge") (magit-merge-arguments))) (magit-merge-assert) (cl-pushnew "--no-ff" args :test #'equal) @@ -139,12 +147,12 @@ obsolete version of the commits that are being merged. Finally if `forge-branch-pullreq' was used to create the merged branch, then also remove the respective remote branch." (interactive - (list (let ((branch (magit-get-current-branch))) - (magit-read-other-local-branch - (format "Merge `%s' into" (or branch (magit-rev-parse "HEAD"))) - nil - (and branch (magit-get-local-upstream-branch branch)))) - (magit-merge-arguments))) + (list (let ((branch (magit-get-current-branch))) + (magit-read-other-local-branch + (format "Merge `%s' into" (or branch (magit-rev-parse "HEAD"))) + nil + (and branch (magit-get-local-upstream-branch branch)))) + (magit-merge-arguments))) (let ((current (magit-get-current-branch)) (head (magit-rev-parse "HEAD"))) (when (zerop (magit-call-git "checkout" branch)) @@ -240,15 +248,15 @@ then also remove the respective remote branch." (defun magit-checkout-stage (file arg) "During a conflict checkout and stage side, or restore conflict." (interactive - (let ((file (magit-completing-read "Checkout file" - (magit-tracked-files) nil 'any nil - 'magit-read-file-hist - (magit-current-file)))) - (cond ((member file (magit-unmerged-files)) - (list file (magit-checkout-read-stage file))) - ((yes-or-no-p (format "Restore conflicts in %s? " file)) - (list file "--merge")) - ((user-error "Quit"))))) + (let ((file (magit-completing-read "Checkout file" + (magit-tracked-files) nil 'any nil + 'magit-read-file-hist + (magit-current-file)))) + (cond ((member file (magit-unmerged-files)) + (list file (magit-checkout-read-stage file))) + ((yes-or-no-p (format "Restore conflicts in %s? " file)) + (list file "--merge")) + ((user-error "Quit"))))) (pcase (cons arg (cddr (car (magit-file-status file)))) ((or `("--ours" ?D ,_) '("--ours" ?U ?A) @@ -317,6 +325,7 @@ If no merge is in progress, do nothing." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-mode.el b/elpa/magit-20260422.2206/magit-mode.el similarity index 94% rename from elpa/magit-20251217.1836/magit-mode.el rename to elpa/magit-20260422.2206/magit-mode.el index 661fa4be..00ee7769 100644 --- a/elpa/magit-20251217.1836/magit-mode.el +++ b/elpa/magit-20260422.2206/magit-mode.el @@ -1,6 +1,6 @@ ;;; magit-mode.el --- Create and refresh Magit buffers -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -51,6 +51,8 @@ (declare-function magit-wip-get-ref "magit-wip" ()) (declare-function magit-wip-commit-worktree "magit-wip" (ref files msg)) +(declare-function magit--blob-cache-zap "magit-files" ()) + ;;; Options (defcustom magit-mode-hook nil @@ -578,35 +580,41 @@ Magit is documented in info node `(magit)'." ;;; Local Variables -(defvar-local magit-buffer-arguments nil) -(defvar-local magit-buffer-diff-type nil) -(defvar-local magit-buffer-diff-args nil) -(defvar-local magit-buffer-diff-files nil) -(defvar-local magit-buffer-diff-files-suspended nil) -(defvar-local magit-buffer-file-name nil) -(defvar-local magit-buffer-files nil) -(defvar-local magit-buffer-log-args nil) -(defvar-local magit-buffer-log-files nil) -(defvar-local magit-buffer-range nil) -(defvar-local magit-buffer-range-hashed nil) -(defvar-local magit-buffer-refname nil) +(defvaralias 'magit-buffer-refname 'magit-buffer-revision) (defvar-local magit-buffer-revision nil) -(defvar-local magit-buffer-revision-hash nil) -(defvar-local magit-buffer-revisions nil) -(defvar-local magit-buffer-typearg nil) -(defvar-local magit-buffer-upstream nil) - -;; These variables are also used in file-visiting buffers. -;; Because the user may change the major-mode, they have -;; to be permanent buffer-local. -(put 'magit-buffer-file-name 'permanent-local t) -(put 'magit-buffer-refname 'permanent-local t) +(defvar-local magit-buffer-revision-oid nil) +(defvar-local magit-buffer-blob-oid nil) +(defvar-local magit-buffer-file-name nil) + +;; Preserve when major-mode is changed in file-visiting buffers. (put 'magit-buffer-revision 'permanent-local t) -(put 'magit-buffer-revision-hash 'permanent-local t) +(put 'magit-buffer-revision-oid 'permanent-local t) +(put 'magit-buffer-blob-oid 'permanent-local t) +(put 'magit-buffer-file-name 'permanent-local t) -;; `magit-status' re-enables mode function but its refresher -;; function does not reinstate this. -(put 'magit-buffer-diff-files-suspended 'permanent-local t) +(eval-and-compile + (defvar magit-define-aliases-for:magit-buffer-* t) + (when magit-define-aliases-for:magit-buffer-* + ;; Unfortunately defvar-local can only be used at top-level, + ;; so instead we have to use make-variable-buffer-local below. + (defvar magit-buffer-arguments nil) + (make-obsolete-variable 'magit-buffer-arguments + "use a mode- or package-specific `magit-buffer-{*}-args' instead" + "magit 4.6.0") + (defvar magit-buffer-upstream nil) + (make-obsolete-variable 'magit-buffer-upstream + "use a mode- or package-specific `magit-buffer-{*}-upstream' instead" + "magit 4.6.0") + (define-obsolete-variable-alias 'magit-buffer-range-hashed + 'magit-buffer-diff-range-oids "magit 4.6.0") + (define-obsolete-variable-alias 'magit-buffer-revisions + 'magit-buffer-log-revisions "magit 4.6.0") + (define-obsolete-variable-alias 'magit-buffer-revision-hash + 'magit-buffer-revision-oid "magit 4.6.0") + (define-obsolete-variable-alias 'magit-buffer-typearg + 'magit-buffer-diff-typearg "magit 4.6.0"))) +(make-variable-buffer-local 'magit-buffer-arguments) +(make-variable-buffer-local 'magit-buffer-upstream) (defun magit-buffer-file-name () "Return `magit-buffer-file-name' or if that is nil `buffer-file-name'. @@ -617,6 +625,7 @@ In an indirect buffer get the value for its base buffer." (defun magit-buffer-revision () "Return `magit-buffer-revision' or if that is nil \"{worktree}\". If not visiting a blob or file, or the file isn't being tracked, +return nil. If visiting a blob but `magit-buffer-revision' is nil, return nil." (or magit-buffer-revision (and buffer-file-name @@ -1098,21 +1107,21 @@ The arguments are for internal use." (when magit-refresh-verbose (message "%s buffer `%s'..." action (buffer-name))) (cond - (created - (funcall refresh) - (cond (initial-section (funcall initial-section)) - (select-section (funcall select-section)))) - (t - (deactivate-mark) - (setq magit-section-pre-command-section nil) - (setq magit-section-highlight-overlays nil) - (setq magit-section-selection-overlays nil) - (setq magit-section-highlighted-sections nil) - (setq magit-section-focused-sections nil) - (let ((positions (magit--refresh-buffer-get-positions))) - (funcall refresh) - (cond (select-section (funcall select-section)) - ((magit--refresh-buffer-set-positions positions)))))) + (created + (funcall refresh) + (cond (initial-section (funcall initial-section)) + (select-section (funcall select-section)))) + (t + (deactivate-mark) + (setq magit-section-pre-command-section nil) + (setq magit-section-highlight-overlays nil) + (setq magit-section-selection-overlays nil) + (setq magit-section-highlighted-sections nil) + (setq magit-section-focused-sections nil) + (let ((positions (magit--refresh-buffer-get-positions))) + (funcall refresh) + (cond (select-section (funcall select-section)) + ((magit--refresh-buffer-set-positions positions)))))) (let ((magit-section-cache-visibility nil)) (magit-section-show magit-root-section)) (run-hooks 'magit-refresh-buffer-hook) @@ -1179,7 +1188,21 @@ The arguments are for internal use." ;; for the wrong buffer. Originally reported in #4196 and ;; fixed with 482c25a3204468a4f6c2fe12ff061666b61f5f4d. (let ((magit-section-movement-hook nil)) - (magit-section-goto-successor section line char))))) + (magit-section-goto-successor section line char) + ;; To store the point value for the selected window, it isn't + ;; enough for it to be current, the window has to "display" it. + ;; The effect of `goto-char', used by the above function, is not + ;; preserved, and using just `set-window-point' would affect the + ;; wrong buffer. + (unless (eq (window-dedicated-p) t) + (let ((restore (window-buffer)) + (window-scroll-functions nil) + (window-configuration-change-hook nil)) + (unwind-protect + (progn + (set-window-buffer nil (current-buffer) t) + (set-window-point nil (point))) + (set-window-buffer nil restore t)))))))) (defun magit-revert-buffer (_ignore-auto _noconfirm) "Wrapper around `magit-refresh-buffer' suitable as `revert-buffer-function'." @@ -1539,13 +1562,14 @@ repositories." "Zap caches for the current repository. Remove the repository's entry from `magit-repository-local-cache', -remove the host's entry from `magit--host-git-version-cache', and -set `magit-section-visibility-cache' to nil for all Magit buffers -of the repository. +remove the host's entry from `magit--host-git-version-cache', set +`magit-section-visibility-cache' to nil for all Magit buffers of +the repository, and empty the `magit--blob-cache'. With a prefix argument or if optional ALL is non-nil, discard the mentioned caches completely." (interactive) + (magit--blob-cache-zap) (cond (all (setq magit-repository-local-cache nil) (setq magit--host-git-version-cache nil) @@ -1580,21 +1604,21 @@ The additional output can be found in the *Messages* buffer." (defun magit-run-hook-with-benchmark (hook) (cond - ((not hook)) - (magit-refresh-verbose - (message "Running %s..." hook) - (message "Running %s...done (%.3fs)" hook - (benchmark-elapse - (run-hook-wrapped - hook - (lambda (fn) - (message " %-50s %f" fn (benchmark-elapse (funcall fn)))))))) - ((run-hooks hook)))) + ((not hook)) + (magit-refresh-verbose + (message "Running %s..." hook) + (message "Running %s...done (%.3fs)" hook + (benchmark-elapse + (run-hook-wrapped + hook + (lambda (fn) + (message " %-50s %f" fn (benchmark-elapse (funcall fn)))))))) + ((run-hooks hook)))) (defun magit-file-region-line-numbers () "Return the bounds of the region as line numbers. The returned value has the form (BEGINNING-LINE END-LINE). If -the region end at the beginning of a line, do not include that +the region ends at the beginning of a line, do not include that line. Avoid including the line after the end of the file." (and (magit-buffer-file-name) (region-active-p) @@ -1615,6 +1639,7 @@ line. Avoid including the line after the end of the file." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-notes.el b/elpa/magit-20260422.2206/magit-notes.el similarity index 98% rename from elpa/magit-20251217.1836/magit-notes.el rename to elpa/magit-20260422.2206/magit-notes.el index 2e7bf0b4..2f9f9d9a 100644 --- a/elpa/magit-20251217.1836/magit-notes.el +++ b/elpa/magit-20260422.2206/magit-notes.el @@ -1,6 +1,6 @@ ;;; magit-notes.el --- Notes support -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -204,6 +204,7 @@ Also see `magit-notes-merge'." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-patch.el b/elpa/magit-20260422.2206/magit-patch.el similarity index 88% rename from elpa/magit-20251217.1836/magit-patch.el rename to elpa/magit-20260422.2206/magit-patch.el index 7b0eea9a..ca0c799c 100644 --- a/elpa/magit-20251217.1836/magit-patch.el +++ b/elpa/magit-20260422.2206/magit-patch.el @@ -1,6 +1,6 @@ ;;; magit-patch.el --- Creating and applying patches -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -99,18 +99,18 @@ which creates patches for all commits that are reachable from ["Actions" ("c" "Create patches" magit-patch-create)] (interactive - (if (not (eq transient-current-command 'magit-patch-create)) - (list nil nil nil) - (cons (if-let ((revs (magit-region-values 'commit t))) - (concat (car (last revs)) "^.." (car revs)) - (let ((range (magit-read-range-or-commit - "Create patches for range or commit"))) - (if (string-search ".." range) - range - (format "%s~..%s" range range)))) - (let ((args (transient-args 'magit-patch-create))) - (list (seq-filter #'stringp args) - (cdr (assoc "--" args))))))) + (if (not (eq transient-current-command 'magit-patch-create)) + (list nil nil nil) + (cons (if-let ((revs (magit-region-values 'commit t))) + (concat (car (last revs)) "^.." (car revs)) + (let ((range (magit-read-range-or-commit + "Create patches for range or commit"))) + (if (string-search ".." range) + range + (format "%s~..%s" range range)))) + (let ((args (transient-args 'magit-patch-create))) + (list (seq-filter #'stringp args) + (cdr (assoc "--" args))))))) (if (not range) (transient-setup 'magit-patch-create) (magit-run-git "format-patch" range args "--" files) @@ -247,14 +247,14 @@ which creates patches for all commits that are reachable from ["Actions" ("a" "Apply patch" magit-patch-apply)] (interactive - (if (not (eq transient-current-command 'magit-patch-apply)) - (list nil) - (list (expand-file-name - (read-file-name "Apply patch: " - default-directory nil nil - (and$ (magit-file-at-point) - (file-relative-name $)))) - (transient-args 'magit-patch-apply)))) + (if (not (eq transient-current-command 'magit-patch-apply)) + (list nil) + (list (expand-file-name + (read-file-name "Apply patch: " + default-directory nil nil + (and$ (magit-file-at-point) + (file-relative-name $)))) + (transient-args 'magit-patch-apply)))) (if (not file) (transient-setup 'magit-patch-apply) (magit-run-git "apply" args "--" (magit-convert-filename-for-git file)))) @@ -286,8 +286,8 @@ same differences as those shown in the buffer are always used." current-prefix-arg)) (unless (derived-mode-p 'magit-diff-mode) (user-error "Only diff buffers can be saved as patches")) - (let ((rev magit-buffer-range) - (typearg magit-buffer-typearg) + (let ((rev magit-buffer-diff-range) + (typearg magit-buffer-diff-typearg) (args magit-buffer-diff-args) (files magit-buffer-diff-files)) (cond ((eq magit-patch-save-arguments 'buffer) @@ -313,9 +313,9 @@ START is a commit that already is in the upstream repository. END is the last commit, usually a branch name, which upstream is asked to pull. START has to be reachable from that commit." (interactive - (list (magit-get "remote" (magit-read-remote "Remote") "url") - (magit-read-branch-or-commit "Start" (magit-get-upstream-branch)) - (magit-read-branch-or-commit "End"))) + (list (magit-get "remote" (magit-read-remote "Remote") "url") + (magit-read-branch-or-commit "Start" (magit-get-upstream-branch)) + (magit-read-branch-or-commit "End"))) (require 'message) (let ((dir default-directory)) ;; mu4e changes default-directory @@ -333,6 +333,7 @@ is asked to pull. START has to be reachable from that commit." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-pkg.el b/elpa/magit-20260422.2206/magit-pkg.el similarity index 73% rename from elpa/magit-20251217.1836/magit-pkg.el rename to elpa/magit-20260422.2206/magit-pkg.el index 0995cf36..ccc60719 100644 --- a/elpa/magit-20251217.1836/magit-pkg.el +++ b/elpa/magit-20260422.2206/magit-pkg.el @@ -1,17 +1,17 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "magit" "20251217.1836" +(define-package "magit" "20260422.2206" "A Git porcelain inside Emacs." '((emacs "28.1") (compat "30.1") - (cond-let "0.1") + (cond-let "0.2") (llama "1.0") - (magit-section "4.4") + (magit-section "4.5") (seq "2.24") - (transient "0.10") + (transient "0.13") (with-editor "3.4")) :url "https://github.com/magit/magit" - :commit "655bc502a3bdd7f07928524515a736e4b8101eaf" - :revdesc "655bc502a3bd" + :commit "569b9656d6a2c792b07d3980796c76b121c9737e" + :revdesc "569b9656d6a2" :keywords '("git" "tools" "vc") :authors '(("Marius Vollmer" . "marius.vollmer@gmail.com") ("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev")) diff --git a/elpa/magit-20251217.1836/magit-process.el b/elpa/magit-20260422.2206/magit-process.el similarity index 96% rename from elpa/magit-20251217.1836/magit-process.el rename to elpa/magit-20260422.2206/magit-process.el index b47237ee..fde48104 100644 --- a/elpa/magit-20251217.1836/magit-process.el +++ b/elpa/magit-20260422.2206/magit-process.el @@ -1,6 +1,6 @@ ;;; magit-process.el --- Process functionality -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -545,7 +545,7 @@ eol conversion." (list (concat "SHADOWED_GITHOOK_DIRECTORY=" (magit--shadowed-githook-directory)))) (and local - (cdr (assoc magit-git-executable magit-git-w32-path-hack))) + (cdr (assoc magit-git-executable magit--git-w32-path-hack))) (and local magit-need-cygwin-noglob (mapcar (lambda (var) (concat var "=" (if-let ((val (getenv var))) @@ -572,25 +572,26 @@ flattened before use." ;; On w32, git expects UTF-8 encoded input, ignore any user ;; configuration telling us otherwise (see #3250). (encode-coding-region (point-min) (point-max) 'utf-8-unix)) - (if (file-remote-p default-directory) - ;; We lack `process-file-region', so fall back to asynch + - ;; waiting in remote case. - (progn - (magit-start-git (current-buffer) args) - (while (and magit-this-process - (eq (process-status magit-this-process) 'run)) - (sleep-for 0.005))) - (run-hooks 'magit-pre-call-git-hook) - (pcase-let* ((process-environment (magit-process-environment)) - (default-process-coding-system (magit--process-coding-system)) - (flat-args (magit-process-git-arguments args t)) - (`(,process-buf . ,section) - (magit-process-setup (magit-git-executable) flat-args)) - (inhibit-read-only t)) - (magit-process-finish - (apply #'call-process-region (point-min) (point-max) - (magit-git-executable) nil process-buf nil flat-args) - process-buf nil default-directory section)))) + (cond + ((file-remote-p default-directory) + ;; We lack `process-file-region', so fall back to asynch + + ;; waiting in remote case. + (magit-start-git (current-buffer) args) + (while (and magit-this-process + (eq (process-status magit-this-process) 'run)) + (sleep-for 0.005))) + (t + (run-hooks 'magit-pre-call-git-hook) + (pcase-let* ((process-environment (magit-process-environment)) + (default-process-coding-system (magit--process-coding-system)) + (flat-args (magit-process-git-arguments args t)) + (`(,process-buf . ,section) + (magit-process-setup (magit-git-executable) flat-args)) + (inhibit-read-only t)) + (magit-process-finish + (apply #'call-process-region (point-min) (point-max) + (magit-git-executable) nil process-buf nil flat-args) + process-buf nil default-directory section))))) ;;; Asynchronous Processes @@ -805,26 +806,26 @@ Magit status buffer." (defun magit-process--format-arguments (program args) (cond - ((and args (equal program (magit-git-executable))) - (let ((global (magit-process-git-arguments--length))) - (concat - (propertize (file-name-nondirectory program) - 'font-lock-face 'magit-section-heading) - " " - (propertize (magit--ellipsis) - 'font-lock-face 'magit-section-heading - 'help-echo (string-join (seq-take args global) " ")) - " " - (propertize (mapconcat #'shell-quote-argument (seq-drop args global) " ") - 'font-lock-face 'magit-section-heading)))) - ((and args (equal program shell-file-name)) - (propertize (cadr args) - 'font-lock-face 'magit-section-heading)) - ((concat (propertize (file-name-nondirectory program) - 'font-lock-face 'magit-section-heading) - " " - (propertize (mapconcat #'shell-quote-argument args " ") - 'font-lock-face 'magit-section-heading))))) + ((and args (equal program (magit-git-executable))) + (let ((global (magit-process-git-arguments--length))) + (concat + (propertize (file-name-nondirectory program) + 'font-lock-face 'magit-section-heading) + " " + (propertize (magit--ellipsis) + 'font-lock-face 'magit-section-heading + 'help-echo (string-join (seq-take args global) " ")) + " " + (propertize (mapconcat #'shell-quote-argument (seq-drop args global) " ") + 'font-lock-face 'magit-section-heading)))) + ((and args (equal program shell-file-name)) + (propertize (cadr args) + 'font-lock-face 'magit-section-heading)) + ((concat (propertize (file-name-nondirectory program) + 'font-lock-face 'magit-section-heading) + " " + (propertize (mapconcat #'shell-quote-argument args " ") + 'font-lock-face 'magit-section-heading))))) (defun magit-process-truncate-log () (let* ((head nil) @@ -1358,6 +1359,7 @@ Limited by `magit-process-error-tooltip-max-lines'." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-pull.el b/elpa/magit-20260422.2206/magit-pull.el similarity index 91% rename from elpa/magit-20251217.1836/magit-pull.el rename to elpa/magit-20260422.2206/magit-pull.el index 507c6953..7eb1ab01 100644 --- a/elpa/magit-20251217.1836/magit-pull.el +++ b/elpa/magit-20260422.2206/magit-pull.el @@ -1,6 +1,6 @@ ;;; magit-pull.el --- Update local objects and refs -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -138,15 +138,15 @@ the upstream." (merge (magit-get "branch" branch "merge")) (u (magit--propertize-face "@{upstream}" 'bold))) (cond - ((magit--unnamed-upstream-p remote merge) - (format "%s of %s" - (magit--propertize-face merge 'magit-branch-remote) - (magit--propertize-face remote 'bold))) - ((magit--valid-upstream-p remote merge) - (concat u ", replacing non-existent")) - ((or remote merge) - (concat u ", replacing invalid")) - ((concat u ", setting that"))))))) + ((magit--unnamed-upstream-p remote merge) + (format "%s of %s" + (magit--propertize-face merge 'magit-branch-remote) + (magit--propertize-face remote 'bold))) + ((magit--valid-upstream-p remote merge) + (concat u ", replacing non-existent")) + ((or remote merge) + (concat u ", replacing invalid")) + ((concat u ", setting that"))))))) ;;;###autoload (defun magit-pull-branch (source args) @@ -166,6 +166,7 @@ the upstream." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-push.el b/elpa/magit-20260422.2206/magit-push.el similarity index 79% rename from elpa/magit-20251217.1836/magit-push.el rename to elpa/magit-20260422.2206/magit-push.el index 24c25cb6..eac346ca 100644 --- a/elpa/magit-20251217.1836/magit-push.el +++ b/elpa/magit-20260422.2206/magit-push.el @@ -1,6 +1,6 @@ ;;; magit-push.el --- Update remote objects and refs -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -100,14 +100,14 @@ argument the push-remote can be changed before pushed to it." (remote (magit-get-push-remote branch)) (v (magit--push-remote-variable branch t))) (cond - (target) - ((member remote (magit-list-remotes)) - (format "%s, creating it" - (magit--propertize-face (concat remote "/" branch) - 'magit-branch-remote))) - (remote - (format "%s, replacing invalid" v)) - ((format "%s, setting that" v))))) + (target) + ((member remote (magit-list-remotes)) + (format "%s, creating it" + (magit--propertize-face (concat remote "/" branch) + 'magit-branch-remote))) + (remote + (format "%s, replacing invalid" v)) + ((format "%s, setting that" v))))) ;;;###autoload(autoload 'magit-push-current-to-upstream "magit-push" nil t) (transient-define-suffix magit-push-current-to-upstream (args) @@ -160,27 +160,27 @@ the upstream." (merge (magit-get "branch" branch "merge")) (u (magit--propertize-face "@{upstream}" 'bold))) (cond - ((magit--unnamed-upstream-p remote merge) - (format "%s as %s" - (magit--propertize-face remote 'bold) - (magit--propertize-face merge 'magit-branch-remote))) - ((magit--valid-upstream-p remote merge) - (format "%s creating %s" - (magit--propertize-face remote 'magit-branch-remote) - (magit--propertize-face merge 'magit-branch-remote))) - ((or remote merge) - (concat u ", creating it and replacing invalid")) - ((concat u ", creating it"))))))) + ((magit--unnamed-upstream-p remote merge) + (format "%s as %s" + (magit--propertize-face remote 'bold) + (magit--propertize-face merge 'magit-branch-remote))) + ((magit--valid-upstream-p remote merge) + (format "%s creating %s" + (magit--propertize-face remote 'magit-branch-remote) + (magit--propertize-face merge 'magit-branch-remote))) + ((or remote merge) + (concat u ", creating it and replacing invalid")) + ((concat u ", creating it"))))))) ;;;###autoload (defun magit-push-current (target args) "Push the current branch to a branch read in the minibuffer." (interactive - (if-let ((current (magit-get-current-branch))) - (list (magit-read-remote-branch (format "Push %s to" current) - nil nil current 'confirm) - (magit-push-arguments)) - (user-error "No branch is checked out"))) + (if-let ((current (magit-get-current-branch))) + (list (magit-read-remote-branch (format "Push %s to" current) + nil nil current 'confirm) + (magit-push-arguments)) + (user-error "No branch is checked out"))) (magit-git-push (magit-get-current-branch) target args)) ;;;###autoload @@ -188,18 +188,18 @@ the upstream." "Push an arbitrary branch or commit somewhere. Both the source and the target are read in the minibuffer." (interactive - (let ((source (magit-read-local-branch-or-commit "Push"))) - (list source - (magit-read-remote-branch - (format "Push %s to" source) nil - (cond ((magit-local-branch-p source) - (or (magit-get-push-branch source) - (magit-get-upstream-branch source))) - ((magit-rev-ancestor-p source "HEAD") - (or (magit-get-push-branch) - (magit-get-upstream-branch)))) - source 'confirm) - (magit-push-arguments)))) + (let ((source (magit-read-local-branch-or-commit "Push"))) + (list source + (magit-read-remote-branch + (format "Push %s to" source) nil + (cond ((magit-local-branch-p source) + (or (magit-get-push-branch source) + (magit-get-upstream-branch source))) + ((magit-rev-ancestor-p source "HEAD") + (or (magit-get-push-branch) + (magit-get-upstream-branch)))) + source 'confirm) + (magit-push-arguments)))) (magit-git-push source target args)) (defvar magit-push-refspecs-history nil) @@ -212,12 +212,12 @@ use multiple REFSPECS, separate them with commas. Completion is only available for the part before the colon, or when no colon is used." (interactive - (list (magit-read-remote "Push to remote") - (magit-completing-read-multiple - "Push refspec,s: " - (cons "HEAD" (magit-list-local-branch-names)) - nil 'any nil 'magit-push-refspecs-history) - (magit-push-arguments))) + (list (magit-read-remote "Push to remote") + (magit-completing-read-multiple + "Push refspec,s: " + (cons "HEAD" (magit-list-local-branch-names)) + nil 'any nil 'magit-push-refspecs-history) + (magit-push-arguments))) (run-hooks 'magit-credential-hook) (magit-run-git-async "push" "-v" args remote refspecs)) @@ -246,9 +246,9 @@ branch as default." (defun magit-push-tag (tag remote &optional args) "Push a tag to another repository." (interactive - (let ((tag (magit-read-tag "Push tag"))) - (list tag (magit-read-remote (format "Push %s to remote" tag) nil t) - (magit-push-arguments)))) + (let ((tag (magit-read-tag "Push tag"))) + (list tag (magit-read-remote (format "Push %s to remote" tag) nil t) + (magit-push-arguments)))) (run-hooks 'magit-credential-hook) (magit-run-git-async "push" remote tag args)) @@ -256,10 +256,10 @@ branch as default." (defun magit-push-notes-ref (ref remote &optional args) "Push a notes ref to another repository." (interactive - (let ((note (magit-notes-read-ref "Push notes"))) - (list note - (magit-read-remote (format "Push %s to remote" note) nil t) - (magit-push-arguments)))) + (let ((note (magit-notes-read-ref "Push notes"))) + (list note + (magit-read-remote (format "Push %s to remote" note) nil t) + (magit-push-arguments)))) (run-hooks 'magit-credential-hook) (magit-run-git-async "push" remote ref args)) @@ -300,12 +300,12 @@ what this command will do. To add it use something like: ;; Note: Avoid `magit-get-remote' because it ;; filters out the local repo case ("."). (magit-get "branch" branch "remote") - (cond-let - [[remotes (magit-list-remotes)]] - ((and (magit-git-version>= "2.27") - (length= remotes 1)) - (car remotes)) - ((car (member "origin" remotes))))))) + (cond-let + [[remotes (magit-list-remotes)]] + ((and (magit-git-version>= "2.27") + (length= remotes 1)) + (car remotes)) + ((car (member "origin" remotes))))))) (if (null remote) "nothing (no remote)" (let ((refspec (magit-get "remote" remote "push"))) @@ -326,17 +326,17 @@ what this command will do. To add it use something like: (format "%s to %s" (magit--propertize-face branch 'magit-branch-current) (cond - ((string-prefix-p "refs/heads/" ref) - (magit--propertize-face - (format "%s/%s" remote - (substring ref (length "refs/heads/"))) - 'magit-branch-remote)) - ((not (string-match "/" ref)) - (magit--propertize-face (format "%s/%s" remote ref) - 'magit-branch-remote)) - ((format "%s as %s" - (magit--propertize-face remote 'bold) - (magit--propertize-face ref 'bold))))) + ((string-prefix-p "refs/heads/" ref) + (magit--propertize-face + (format "%s/%s" remote + (substring ref (length "refs/heads/"))) + 'magit-branch-remote)) + ((not (string-match "/" ref)) + (magit--propertize-face (format "%s/%s" remote ref) + 'magit-branch-remote)) + ((format "%s as %s" + (magit--propertize-face remote 'bold) + (magit--propertize-face ref 'bold))))) "nothing (no upstream)"))) ("matching" (format "all matching to %s" (magit--propertize-face remote 'bold))))))))) @@ -374,6 +374,7 @@ You can add this command as a suffix using something like: ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-reflog.el b/elpa/magit-20260422.2206/magit-reflog.el similarity index 98% rename from elpa/magit-20251217.1836/magit-reflog.el rename to elpa/magit-20260422.2206/magit-reflog.el index 4399ea21..5a529c70 100644 --- a/elpa/magit-20251217.1836/magit-reflog.el +++ b/elpa/magit-20260422.2206/magit-reflog.el @@ -1,6 +1,6 @@ ;;; magit-reflog.el --- Inspect ref history -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -211,6 +211,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-refs.el b/elpa/magit-20260422.2206/magit-refs.el similarity index 92% rename from elpa/magit-20251217.1836/magit-refs.el rename to elpa/magit-20260422.2206/magit-refs.el index a3371552..ce3dc01c 100644 --- a/elpa/magit-20251217.1836/magit-refs.el +++ b/elpa/magit-20260422.2206/magit-refs.el @@ -1,6 +1,6 @@ ;;; magit-refs.el --- Listing references -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -308,24 +308,27 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (magit-hack-dir-local-variables) (setq magit--imenu-group-types '(local remote tags))) +(defvar-local magit-buffer-refs-args nil) +(defvar-local magit-buffer-refs-upstream nil) + (defun magit-refs-setup-buffer (ref args) (magit-setup-buffer #'magit-refs-mode nil - (magit-buffer-upstream ref) - (magit-buffer-arguments args))) + (magit-buffer-refs-upstream ref) + (magit-buffer-refs-args args))) (defun magit-refs-refresh-buffer () (setq magit--right-margin-delayed (not (magit--right-margin-active))) - (unless (magit-rev-verify magit-buffer-upstream) + (unless (magit-rev-verify magit-buffer-refs-upstream) (setq magit-refs-show-commit-count nil)) (magit-set-header-line-format - (format "%s %s" magit-buffer-upstream - (string-join magit-buffer-arguments " "))) + (format "%s %s" magit-buffer-refs-upstream + (string-join magit-buffer-refs-args " "))) (magit-insert-section (branchbuf) (magit-run-section-hook 'magit-refs-sections-hook)) (add-hook 'kill-buffer-hook #'magit-preserve-section-visibility-cache)) (cl-defmethod magit-buffer-value (&context (major-mode magit-refs-mode)) - (cons magit-buffer-upstream magit-buffer-arguments)) + (cons magit-buffer-refs-upstream magit-buffer-refs-args)) ;;; Commands @@ -360,11 +363,11 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. ((eq transient-current-command 'magit-show-refs) (transient-args 'magit-show-refs)) ((eq major-mode 'magit-refs-mode) - magit-buffer-arguments) + magit-buffer-refs-args) ([_(memq use-buffer-args '(always selected))] [buffer (magit-get-mode-buffer 'magit-refs-mode nil (eq use-buffer-args 'selected))] - (buffer-local-value 'magit-buffer-arguments buffer)) + (buffer-local-value 'magit-buffer-refs-args buffer)) ((alist-get 'magit-show-refs transient-values)))) (transient-define-argument magit-for-each-ref:--contains () @@ -468,13 +471,13 @@ Branch %s already exists. (?r (magit-call-git "checkout" "-B" branch ref)) (?a (user-error "Abort")))) (magit-call-git "checkout" "-b" branch ref)) - (setq magit-buffer-upstream branch) + (setq magit-buffer-refs-upstream branch) (magit-refresh))) ((or (memq 'checkout-any magit-visit-ref-behavior) (and (memq 'checkout-branch magit-visit-ref-behavior) (magit-section-match [branch local]))) (magit-call-git "checkout" ref) - (setq magit-buffer-upstream ref) + (setq magit-buffer-refs-upstream ref) (magit-refresh)) ((call-interactively #'magit-show-commit)))) @@ -540,7 +543,7 @@ line is inserted at all." (defun magit-insert-tags () "Insert sections showing all tags." - (when-let ((tags (magit-git-lines "tag" "--list" "-n" magit-buffer-arguments))) + (when-let ((tags (magit-git-lines "tag" "--list" "-n" magit-buffer-refs-args))) (let ((_head (magit-rev-parse "HEAD"))) (magit-insert-section (tags) (magit-insert-heading (length tags) "Tags") @@ -581,42 +584,42 @@ line is inserted at all." (dolist (line (magit-git-lines "for-each-ref" "--format=\ %(symref:short)%00%(refname:short)%00%(refname)%00%(subject)" (concat "refs/remotes/" remote) - magit-buffer-arguments)) + magit-buffer-refs-args)) (pcase-let ((`(,head-branch ,branch ,ref ,msg) (cl-substitute nil "" (split-string line "\0") :test #'equal))) (cond - (head-branch - ;; Note: Use `ref' instead of `branch' for the check - ;; below because 'refname:short' shortens the remote - ;; HEAD to '' instead of '/HEAD' as of - ;; Git v2.40.0. - (cl-assert - (equal ref (concat "refs/remotes/" remote "/HEAD"))) - (setq head head-branch)) - ((not (equal ref (concat "refs/remotes/" remote "/HEAD"))) - ;; ^ Skip mis-configured remotes where HEAD is not a - ;; symref. See #5092. - (when (magit-refs--insert-refname-p branch) - (magit-insert-section (branch branch t) - (let ((headp (equal branch head)) - (abbrev (if magit-refs-show-remote-prefix - branch - (substring branch (1+ (length remote)))))) - (magit-insert-heading - (magit-refs--format-focus-column branch) - (magit-refs--propertize-branch - abbrev ref (and headp 'magit-branch-remote-head)) - (make-string - (max 1 (- (if (consp magit-refs-primary-column-width) - (car magit-refs-primary-column-width) - magit-refs-primary-column-width) - (length abbrev))) - ?\s) - (and msg (magit-log--wash-summary msg)))) - (magit-refs--maybe-format-margin branch) - (magit-refs--insert-cherry-commits branch)))))))) + (head-branch + ;; Note: Use `ref' instead of `branch' for the check + ;; below because 'refname:short' shortens the remote + ;; HEAD to '' instead of '/HEAD' as of + ;; Git v2.40.0. + (cl-assert + (equal ref (concat "refs/remotes/" remote "/HEAD"))) + (setq head head-branch)) + ((not (equal ref (concat "refs/remotes/" remote "/HEAD"))) + ;; ^ Skip mis-configured remotes where HEAD is not a + ;; symref. See #5092. + (when (magit-refs--insert-refname-p branch) + (magit-insert-section (branch branch t) + (let ((headp (equal branch head)) + (abbrev (if magit-refs-show-remote-prefix + branch + (substring branch (1+ (length remote)))))) + (magit-insert-heading + (magit-refs--format-focus-column branch) + (magit-refs--propertize-branch + abbrev ref (and headp 'magit-branch-remote-head)) + (make-string + (max 1 (- (if (consp magit-refs-primary-column-width) + (car magit-refs-primary-column-width) + magit-refs-primary-column-width) + (length abbrev))) + ?\s) + (and msg (magit-log--wash-summary msg)))) + (magit-refs--maybe-format-margin branch) + (magit-refs--insert-cherry-commits branch)))))))) (insert ?\n) (magit-make-margin-overlay)))) @@ -661,7 +664,7 @@ line is inserted at all." %(push:remotename)%00%(push)%00%(push:track)%00%(subject)" "%00%00%00%(subject)")) "refs/heads" - magit-buffer-arguments)))) + magit-buffer-refs-args)))) (unless (magit-get-current-branch) (push (magit-refs--format-local-branch (concat "*\0\0\0\0\0\0\0\0" (magit-rev-format "%s"))) @@ -750,7 +753,7 @@ line is inserted at all." (and msg (magit-log--wash-summary msg)))))))) (defun magit-refs--format-focus-column (ref &optional type) - (let ((focus magit-buffer-upstream) + (let ((focus magit-buffer-refs-upstream) (width (if magit-refs-show-commit-count magit-refs-focus-column-width 1))) @@ -766,7 +769,7 @@ line is inserted at all." (eq magit-refs-show-commit-count 'all) magit-refs-show-commit-count) (pcase-let ((`(,behind ,ahead) - (magit-rev-diff-count magit-buffer-upstream ref))) + (magit-rev-diff-count magit-buffer-refs-upstream ref))) (magit--propertize-face (cond ((> ahead 0) (concat "<" (number-to-string ahead))) ((> behind 0) (concat (number-to-string behind) ">")) @@ -795,7 +798,7 @@ line is inserted at all." (let ((start (point)) (magit-insert-section--current nil)) (magit-git-wash (apply-partially #'magit-log-wash-log 'cherry) - "cherry" "-v" (magit-abbrev-arg) magit-buffer-upstream ref) + "cherry" "-v" (magit-abbrev-arg) magit-buffer-refs-upstream ref) (if (= (point) start) (message "No cherries for %s" ref) (magit-make-margin-overlay))))) @@ -814,6 +817,7 @@ line is inserted at all." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-remote.el b/elpa/magit-20260422.2206/magit-remote.el similarity index 78% rename from elpa/magit-20251217.1836/magit-remote.el rename to elpa/magit-20260422.2206/magit-remote.el index 42d2fcd8..7f9f8c12 100644 --- a/elpa/magit-20251217.1836/magit-remote.el +++ b/elpa/magit-20260422.2206/magit-remote.el @@ -1,6 +1,6 @@ ;;; magit-remote.el --- Transfer Git commits -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -73,7 +73,8 @@ has to be used to view and change remote related variables." ("U" magit-remote..fetch) ("s" magit-remote..pushurl) ("S" magit-remote..push) - ("O" magit-remote..tagopt)] + ("O" magit-remote..tagopt) + ("h" magit-remote..followremotehead)] ["Arguments for add" ("-f" "Fetch after add" "-f")] ["Actions" @@ -98,31 +99,31 @@ has to be used to view and change remote related variables." (defun magit-remote-add (remote url &optional args) "Add a remote named REMOTE and fetch it." (interactive - (let ((origin (magit-get "remote.origin.url")) - (remote (magit-read-string-ns "Remote name"))) - (list remote - (magit-read-url - "Remote url" - (and origin - (string-match "\\([^:/]+\\)/[^/]+\\(\\.git\\)?\\'" origin) - (replace-match remote t t origin 1))) - (transient-args 'magit-remote)))) - (if (pcase (list magit-remote-add-set-remote.pushDefault - (magit-get "remote.pushDefault")) - (`(,(pred stringp) ,_) t) - ((or `(ask ,_) '(ask-if-unset nil)) - (y-or-n-p (format "Set `remote.pushDefault' to \"%s\"? " remote)))) - (progn (magit-call-git "remote" "add" args remote url) - (setf (magit-get "remote.pushDefault") remote) - (magit-refresh)) - (magit-run-git-async "remote" "add" args remote url))) + (let ((origin (magit-get "remote.origin.url")) + (remote (magit-read-string-ns "Remote name"))) + (list remote + (magit-read-url + "Remote url" + (and origin + (string-match "\\([^:/]+\\)/[^/]+\\(\\.git\\)?\\'" origin) + (replace-match remote t t origin 1))) + (transient-args 'magit-remote)))) + (cond ((pcase (list magit-remote-add-set-remote.pushDefault + (magit-get "remote.pushDefault")) + (`(,(pred stringp) ,_) t) + ((or `(ask ,_) '(ask-if-unset nil)) + (y-or-n-p (format "Set `remote.pushDefault' to \"%s\"? " remote)))) + (magit-call-git "remote" "add" args remote url) + (setf (magit-get "remote.pushDefault") remote) + (magit-refresh)) + ((magit-run-git-async "remote" "add" args remote url)))) ;;;###autoload (defun magit-remote-rename (old new) "Rename the remote named OLD to NEW." (interactive - (let ((remote (magit-read-remote "Rename remote"))) - (list remote (magit-read-string-ns (format "Rename %s to" remote))))) + (let ((remote (magit-read-remote "Rename remote"))) + (list remote (magit-read-string-ns (format "Rename %s to" remote))))) (unless (string= old new) (magit-call-git "remote" "rename" old new) (magit-remote--cleanup-push-variables old new) @@ -239,11 +240,11 @@ accordingly. With a prefix argument query for the branch to be used, which allows you to select an incorrect value if you fancy doing that." (interactive - (let ((remote (magit-read-remote "Set HEAD for remote"))) - (list remote - (and current-prefix-arg - (magit-read-remote-branch (format "Set %s/HEAD to" remote) - remote nil nil t))))) + (let ((remote (magit-read-remote "Set HEAD for remote"))) + (list remote + (and current-prefix-arg + (magit-read-remote-branch (format "Set %s/HEAD to" remote) + remote nil nil t))))) (magit-run-git "remote" "set-head" remote (or branch "--auto"))) ;;;###autoload @@ -262,28 +263,28 @@ Delete the symbolic-ref \"refs/remotes//HEAD\"." (pcase-let ((`(,_remote ,oldname) (magit--get-default-branch)) (`( ,remote ,newname) (magit--get-default-branch t))) (cond - ((equal oldname newname) - (setq oldname - (read-string - (format - "Name of default branch is still `%s', %s\n%s `%s': " oldname - "but the upstreams of some local branches might need updating." - "Name of upstream branches to replace with" newname))) - (magit--set-default-branch newname oldname) - (magit-refresh)) - (t - (unless oldname - (setq oldname - (magit-read-other-local-branch - (format "Name of old default branch to be renamed to `%s'" - newname) - newname "master"))) - (cond - ((y-or-n-p (format "Default branch changed from `%s' to `%s' on %s.%s?" - oldname newname remote " Do the same locally")) - (magit--set-default-branch newname oldname) - (magit-refresh)) - ((user-error "Abort"))))))) + ((equal oldname newname) + (setq oldname + (read-string + (format + "Name of default branch is still `%s', %s\n%s `%s': " oldname + "but the upstreams of some local branches might need updating." + "Name of upstream branches to replace with" newname))) + (magit--set-default-branch newname oldname) + (magit-refresh)) + (t + (unless oldname + (setq oldname + (magit-read-other-local-branch + (format "Name of old default branch to be renamed to `%s'" + newname) + newname "master"))) + (cond + ((y-or-n-p (format "Default branch changed from `%s' to `%s' on %s.%s?" + oldname newname remote " Do the same locally")) + (magit--set-default-branch newname oldname) + (magit-refresh)) + ((user-error "Abort"))))))) ;;;###autoload (defun magit-remote-unshallow (remote) @@ -316,13 +317,14 @@ refspec." ("U" magit-remote..fetch) ("s" magit-remote..pushurl) ("S" magit-remote..push) - ("O" magit-remote..tagopt)] + ("O" magit-remote..tagopt) + ("h" magit-remote..followremotehead)] (interactive - (list (or (and (not current-prefix-arg) - (not (and magit-remote-direct-configure - (eq transient-current-command 'magit-remote))) - (magit-get-current-remote)) - (magit--read-remote-scope)))) + (list (or (and (not current-prefix-arg) + (not (and magit-remote-direct-configure + (eq transient-current-command 'magit-remote))) + (magit-get-current-remote)) + (magit--read-remote-scope)))) (transient-setup 'magit-remote-configure nil nil :scope remote)) (defun magit--read-remote-scope (&optional obj) @@ -364,6 +366,27 @@ refspec." :variable "remote.%s.tagOpt" :choices '("--no-tags" "--tags")) +(transient-define-infix magit-remote..followremotehead () + "How \"git fetch\" handles updates to \"remotes//HEAD\". + +This command sets the local value of the Git variable +`remote..followRemoteHEAD', where is a stand-in for +the actual remote, as displayed in the menu, from which this command +is invoked. This variable is documented in (man \"git-config(1)\"). + +Unfortunately Git does not provide a variable to set a default for +all remotes of all repositories, but you can set the global value for +a remote name used in multiple repository, which will then be used as +the default for that remote in all repositories. You should consider +using \"always\" for remotes named \"origin\". + + git config set --global remote.origin.followRemoteHEAD always" + :class 'magit--git-variable:choices + :scope #'magit--read-remote-scope + :variable "remote.%s.followRemoteHEAD" + :choices '("create" "always" "warn") + :default "create") + ;;; Transfer Utilities (defun magit--push-remote-variable (&optional branch short) @@ -399,6 +422,7 @@ refspec." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-repos.el b/elpa/magit-20260422.2206/magit-repos.el similarity index 98% rename from elpa/magit-20251217.1836/magit-repos.el rename to elpa/magit-20260422.2206/magit-repos.el index 44b05e59..1ad8d918 100644 --- a/elpa/magit-20251217.1836/magit-repos.el +++ b/elpa/magit-20260422.2206/magit-repos.el @@ -1,6 +1,6 @@ ;;; magit-repos.el --- Listing repositories -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -535,7 +535,9 @@ instead." (magit-list-repos-uniquify (mapcar (lambda (v) (cons (concat - key "\\" + key + (or (bound-and-true-p uniquify-separator) + "\\") (file-name-nondirectory (directory-file-name (substring v 0 (- (1+ (length key))))))) @@ -557,6 +559,7 @@ instead." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-reset.el b/elpa/magit-20260422.2206/magit-reset.el similarity index 98% rename from elpa/magit-20251217.1836/magit-reset.el rename to elpa/magit-20260422.2206/magit-reset.el index 6bb74208..0ae1c57f 100644 --- a/elpa/magit-20251217.1836/magit-reset.el +++ b/elpa/magit-20260422.2206/magit-reset.el @@ -1,6 +1,6 @@ ;;; magit-reset.el --- Reset functionality -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -140,6 +140,7 @@ or \"detached head\" will be substituted for %s." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-sequence.el b/elpa/magit-20260422.2206/magit-sequence.el similarity index 84% rename from elpa/magit-20251217.1836/magit-sequence.el rename to elpa/magit-20260422.2206/magit-sequence.el index d3af3ad0..20c3383e 100644 --- a/elpa/magit-20251217.1836/magit-sequence.el +++ b/elpa/magit-20260422.2206/magit-sequence.el @@ -1,6 +1,6 @@ ;;; magit-sequence.el --- History manipulation in Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -95,12 +95,12 @@ "Resume the current cherry-pick or revert sequence." (interactive) (cond - ((not (magit-sequencer-in-progress-p)) - (user-error "No cherry-pick or revert in progress")) - ((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")))) + ((not (magit-sequencer-in-progress-p)) + (user-error "No cherry-pick or revert in progress")) + ((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")))) ;;;###autoload (defun magit-sequencer-skip () @@ -117,13 +117,13 @@ This discards all changes made since the sequence started." (interactive) (cond - ((not (magit-sequencer-in-progress-p)) - (user-error "No cherry-pick or revert in progress")) - ((magit-revert-in-progress-p) - (magit-confirm 'abort-revert "Really abort revert") - (magit-run-git-sequencer "revert" "--abort")) - ((magit-confirm 'abort-cherry-pick "Really abort cherry-pick") - (magit-run-git-sequencer "cherry-pick" "--abort")))) + ((not (magit-sequencer-in-progress-p)) + (user-error "No cherry-pick or revert in progress")) + ((magit-revert-in-progress-p) + (magit-confirm 'abort-revert "Really abort revert") + (magit-run-git-sequencer "revert" "--abort")) + ((magit-confirm 'abort-cherry-pick "Really abort cherry-pick") + (magit-run-git-sequencer "cherry-pick" "--abort")))) (defun magit-sequencer-in-progress-p () (or (magit-cherry-pick-in-progress-p) @@ -229,18 +229,18 @@ Remove the COMMITS from BRANCH and stay on the current branch. If a conflict occurs, then you have to fix that and finish the process manually." (interactive - (magit--cherry-move-read-args "harvest" nil - (lambda (commits) - (list (let ((branches (magit-list-containing-branches (car commits)))) - (pcase (length branches) - (0 nil) - (1 (car branches)) - (_ (magit-completing-read - (let ((len (length commits))) - (if (= len 1) - "Remove 1 cherry from branch" - (format "Remove %s cherries from branch" len))) - branches nil t)))))))) + (magit--cherry-move-read-args "harvest" nil + (lambda (commits) + (list (let ((branches (magit-list-containing-branches (car commits)))) + (pcase (length branches) + (0 nil) + (1 (car branches)) + (_ (magit-completing-read + (let ((len (length commits))) + (if (= len 1) + "Remove 1 cherry from branch" + (format "Remove %s cherries from branch" len))) + branches nil t)))))))) (magit--cherry-move commits branch (magit-get-current-branch) args nil t)) ;;;###autoload @@ -250,14 +250,14 @@ Remove COMMITS from the current branch and stay on that branch. If a conflict occurs, then you have to fix that and finish the process manually. `HEAD' is allowed to be detached initially." (interactive - (magit--cherry-move-read-args "donate" t - (lambda (commits) - (list (magit-read-other-branch - (let ((len (length commits))) - (if (= len 1) - "Move 1 cherry to branch" - (format "Move %s cherries to branch" len)))))) - 'allow-detached)) + (magit--cherry-move-read-args "donate" t + (lambda (commits) + (list (magit-read-other-branch + (let ((len (length commits))) + (if (= len 1) + "Move 1 cherry to branch" + (format "Move %s cherries to branch" len)))))) + 'allow-detached)) (magit--cherry-move commits (or (magit-get-current-branch) (magit-rev-parse "HEAD")) @@ -289,8 +289,8 @@ the process manually." (unless (magit-branch-p dst) (let ((magit-process-raise-error t)) (magit-call-git "branch" dst start-point)) - (when-let ((upstream (magit-get-indirect-upstream-branch start-point))) - (magit-call-git "branch" "--set-upstream-to" upstream dst))) + (when$ (magit-get-indirect-upstream-branch start-point) + (magit-call-git "branch" "--set-upstream-to" $ dst))) (unless (equal dst current) (let ((magit-process-raise-error t)) (magit-call-git "checkout" dst))) @@ -308,32 +308,32 @@ the process manually." (process-put process 'inhibit-refresh t) (magit-process-sentinel process event) (cond - ((magit-rev-equal tip src) - (magit-call-git "update-ref" - "-m" (format "reset: moving to %s" keep) - (magit-ref-fullname src) - keep tip) - (if (not checkout-dst) - (magit-run-git "checkout" src) - (magit-refresh))) - (t - (magit-git "checkout" src) - (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 - magit-this-process - (lambda (process event) - (when (memq (process-status process) '(exit signal)) - (if (> (process-exit-status process) 0) - (magit-process-sentinel process event) - (process-put process 'inhibit-refresh t) - (magit-process-sentinel process event) - (magit-run-git "checkout" dst)))))))))))))))) + ((magit-rev-equal tip src) + (magit-call-git "update-ref" + "-m" (format "reset: moving to %s" keep) + (magit-ref-fullname src) + keep tip) + (if (not checkout-dst) + (magit-run-git "checkout" src) + (magit-refresh))) + (t + (magit-git "checkout" src) + (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 + magit-this-process + (lambda (process event) + (when (memq (process-status process) '(exit signal)) + (if (> (process-exit-status process) 0) + (magit-process-sentinel process event) + (process-put process 'inhibit-refresh t) + (magit-process-sentinel process event) + (magit-run-git "checkout" dst)))))))))))))))) (defun magit--cherry-pick (commits args &optional revert) (let ((command (if revert "revert" "cherry-pick"))) @@ -345,16 +345,16 @@ the process manually." (if revert "revert" "cherry-pick") (let ((merges (seq-filter #'magit-merge-commit-p commits))) (cond - ((not merges) - (seq-remove (##string-prefix-p "--mainline=" %) args)) - ((cl-set-difference commits merges :test #'equal) - (user-error "Cannot %s merge and non-merge commits at once" - command)) - ((seq-find (##string-prefix-p "--mainline=" %) args) - args) - ((cons (format "--mainline=%s" - (read-number "Replay merges relative to parent: ")) - args)))) + ((not merges) + (seq-remove (##string-prefix-p "--mainline=" %) args)) + ((cl-set-difference commits merges :test #'equal) + (user-error "Cannot %s merge and non-merge commits at once" + command)) + ((seq-find (##string-prefix-p "--mainline=" %) args) + args) + ((cons (format "--mainline=%s" + (read-number "Replay merges relative to parent: ")) + args)))) commits))) (defun magit-cherry-pick-in-progress-p () @@ -491,11 +491,11 @@ without prompting." "Resume the current patch applying sequence." (interactive) (cond - ((not (magit-am-in-progress-p)) - (user-error "Not applying any patches")) - ((magit-anything-unstaged-p t) - (user-error "Cannot continue due to unstaged changes")) - ((magit-run-git-sequencer "am" "--continue")))) + ((not (magit-am-in-progress-p)) + (user-error "Not applying any patches")) + ((magit-anything-unstaged-p t) + (user-error "Cannot continue due to unstaged changes")) + ((magit-run-git-sequencer "am" "--continue")))) ;;;###autoload (defun magit-am-skip () @@ -628,13 +628,13 @@ the upstream." (merge (magit-get "branch" branch "merge")) (u (magit--propertize-face "@{upstream}" 'bold))) (cond - ((magit--unnamed-upstream-p remote merge) - (concat u ", replacing unnamed")) - ((magit--valid-upstream-p remote merge) - (concat u ", replacing non-existent")) - ((or remote merge) - (concat u ", replacing invalid")) - ((concat u ", setting that"))))))) + ((magit--unnamed-upstream-p remote merge) + (concat u ", replacing unnamed")) + ((magit--valid-upstream-p remote merge) + (concat u ", replacing non-existent")) + ((or remote merge) + (concat u ", replacing invalid")) + ((concat u ", setting that"))))))) ;;;###autoload (defun magit-rebase-branch (target args) @@ -823,25 +823,25 @@ 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") (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"))))) + ((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 () @@ -932,8 +932,9 @@ If no such sequence is in progress, do nothing." patch commit) (while (and patches (>= i cur)) (setq patch (pop patches)) - (setq commit (magit-commit-p - (cadr (split-string (magit-file-line patch))))) + (setq commit + (magit-commit-oid (cadr (split-string (magit-file-line patch))) + t)) (cond ((and commit (= i cur)) (magit-sequence-insert-commit "stop" commit 'magit-sequence-stop)) @@ -988,8 +989,8 @@ If no such sequence is in progress, do nothing." (defun magit-rebase--todo () "Return `git-rebase-action' instances for remaining rebase actions. -These are ordered in that the same way they'll be sorted in the -status buffer (i.e., the reverse of how they will be applied)." +These are ordered the same way they'll be sorted in the status +buffer (i.e., the reverse of how they will be applied)." (let ((comment-start (or (magit-get "core.commentChar") "#")) (commits ()) (actions ())) @@ -1066,37 +1067,37 @@ status buffer (i.e., the reverse of how they will be applied)." (if-let ((matched (car (assoc (##equal (magit-patch-id %) id) done)))) (setq stop matched) (cond - ((assoc (##magit-rev-equal % stop) done) - ;; The commit's testament has been executed. - (magit-sequence-insert-commit "void" stop 'magit-sequence-drop)) - ;; The faith of the commit is still undecided... - ((magit-anything-unmerged-p) - ;; ...and time travel isn't for the faint of heart. - (magit-sequence-insert-commit "join" stop 'magit-sequence-part)) - ((magit-anything-modified-p t) - ;; ...and the dust hasn't settled yet... - (magit-sequence-insert-commit - (let* ((magit--refresh-cache nil) - (staged (magit-commit-tree "oO" nil "HEAD")) - (unstaged (magit-commit-worktree "oO" "--reset"))) - (cond - ;; ...but we could end up at the same tree just by committing. - ((or (magit-rev-equal staged stop) - (magit-rev-equal unstaged stop)) - "goal") - ;; ...but the changes are still there, untainted. - ((or (equal (magit-patch-id staged) id) - (equal (magit-patch-id unstaged) id)) - "same") - ;; ...and some changes are gone and/or others were added. - ("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)) - ;; ...and some changes are gone and/or other changes were added. - ((magit-sequence-insert-commit "gone" stop 'magit-sequence-drop))) + ((assoc (##magit-rev-equal % stop) done) + ;; The commit's testament has been executed. + (magit-sequence-insert-commit "void" stop 'magit-sequence-drop)) + ;; The faith of the commit is still undecided... + ((magit-anything-unmerged-p) + ;; ...and time travel isn't for the faint of heart. + (magit-sequence-insert-commit "join" stop 'magit-sequence-part)) + ((magit-anything-modified-p t) + ;; ...and the dust hasn't settled yet... + (magit-sequence-insert-commit + (let* ((magit--refresh-cache nil) + (staged (magit-commit-tree "oO" nil "HEAD")) + (unstaged (magit-commit-worktree "oO" "--reset"))) + (cond + ;; ...but we could end up at the same tree just by committing. + ((or (magit-rev-equal staged stop) + (magit-rev-equal unstaged stop)) + "goal") + ;; ...but the changes are still there, untainted. + ((or (equal (magit-patch-id staged) id) + (equal (magit-patch-id unstaged) id)) + "same") + ;; ...and some changes are gone and/or others were added. + ("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)) + ;; ...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 @@ -1144,6 +1145,7 @@ status buffer (i.e., the reverse of how they will be applied)." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-sparse-checkout.el b/elpa/magit-20260422.2206/magit-sparse-checkout.el similarity index 85% rename from elpa/magit-20251217.1836/magit-sparse-checkout.el rename to elpa/magit-20260422.2206/magit-sparse-checkout.el index 34bccf19..bd0b98e4 100644 --- a/elpa/magit-20251217.1836/magit-sparse-checkout.el +++ b/elpa/magit-20260422.2206/magit-sparse-checkout.el @@ -1,6 +1,6 @@ ;;; magit-sparse-checkout.el --- Sparse checkout support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Kyle Meyer ;; Maintainer: Jonas Bernoulli @@ -82,12 +82,12 @@ See the `git sparse-checkout' manpage for details about To extend rather than override the currently configured directories, call `magit-sparse-checkout-add' instead." (interactive - (list (magit-completing-read-multiple - "Include these directories: " - ;; Note: Given that the appeal of sparse checkouts is - ;; dealing with very large trees, listing all subdirectories - ;; may need to be reconsidered. - (magit-revision-directories "HEAD")))) + (list (magit-completing-read-multiple + "Include these directories: " + ;; Note: Given that the appeal of sparse checkouts is + ;; dealing with very large trees, listing all subdirectories + ;; may need to be reconsidered. + (magit-revision-directories "HEAD")))) (magit-sparse-checkout--auto-enable) (magit-run-git-async "sparse-checkout" "set" directories)) @@ -97,16 +97,16 @@ directories, call `magit-sparse-checkout-add' instead." To override rather than extend the currently configured directories, call `magit-sparse-checkout-set' instead." (interactive - (list (magit-completing-read-multiple - "Add these directories: " - ;; Same performance note as in `magit-sparse-checkout-set', - ;; but even more so given the additional processing. - (seq-remove - (let ((re (concat - "\\`" - (regexp-opt (magit-sparse-checkout-directories))))) - (##string-match-p re %)) - (magit-revision-directories "HEAD"))))) + (list (magit-completing-read-multiple + "Add these directories: " + ;; Same performance note as in `magit-sparse-checkout-set', + ;; but even more so given the additional processing. + (seq-remove + (let ((re (concat + "\\`" + (regexp-opt (magit-sparse-checkout-directories))))) + (##string-match-p re %)) + (magit-revision-directories "HEAD"))))) (magit-sparse-checkout--auto-enable) (magit-run-git-async "sparse-checkout" "add" directories)) @@ -153,6 +153,7 @@ This header is not inserted by default. To enable it, add it to ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-stash.el b/elpa/magit-20260422.2206/magit-stash.el similarity index 97% rename from elpa/magit-20251217.1836/magit-stash.el rename to elpa/magit-20260422.2206/magit-stash.el index 7a3e7dde..fa1d3663 100644 --- a/elpa/magit-20251217.1836/magit-stash.el +++ b/elpa/magit-20260422.2206/magit-stash.el @@ -1,6 +1,6 @@ ;;; magit-stash.el --- Stash support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -127,13 +127,13 @@ Untracked files are included according to infix arguments. One prefix argument is equivalent to `--include-untracked' while two prefix arguments are equivalent to `--all'." (interactive - (progn (when (and (magit-merge-in-progress-p) - (not (magit-y-or-n-p "\ + (progn (when (and (magit-merge-in-progress-p) + (not (magit-y-or-n-p "\ Stashing and resetting during a merge conflict. \ Applying the resulting stash won't restore the merge state. \ Proceed anyway? "))) - (user-error "Abort")) - (magit-stash-read-args))) + (user-error "Abort")) + (magit-stash-read-args))) (magit-stash-save message t t include-untracked t)) ;;;###autoload @@ -370,9 +370,9 @@ want to fall back to using \"--3way\", without being prompted." "Remove a stash from the stash list. When the region is active offer to drop all contained stashes." (interactive - (list (if-let ((values (magit-region-values 'stash))) - (magit-confirm 'drop-stashes nil "Drop %d stashes" nil values) - (magit-read-stash "Drop stash")))) + (list (if-let ((values (magit-region-values 'stash))) + (magit-confirm 'drop-stashes nil "Drop %d stashes" nil values) + (magit-read-stash "Drop stash")))) (dolist (stash (if (listp stash) (nreverse (prog1 stash (setq stash (car stash)))) (list stash))) @@ -386,7 +386,8 @@ When the region is active offer to drop all contained stashes." (defun magit-stash-clear (ref) "Remove all stashes saved in REF's reflog by deleting REF." (interactive (let ((ref (or (magit-section-value-if 'stashes) "refs/stash"))) - (magit-confirm t (list "Drop all stashes in %s" ref)) + (magit-confirm 'drop-stashes + (list "Drop all stashes in %s" ref)) (list ref))) (magit-run-git "update-ref" "-d" ref)) @@ -619,7 +620,7 @@ See also info node `(magit)Section Movement'." (defun magit-stash-setup-buffer (stash args files) (magit-setup-buffer #'magit-stash-mode nil (magit-buffer-revision stash) - (magit-buffer-range (format "%s^..%s" stash stash)) + (magit-buffer-diff-range (format "%s^..%s" stash stash)) (magit-buffer-diff-args args) (magit-buffer-diff-files files))) @@ -630,7 +631,7 @@ See also info node `(magit)Section Movement'." 'font-lock-face (list :weight 'normal :foreground (face-attribute 'default :foreground))))) - (setq magit-buffer-revision-hash (magit-rev-parse magit-buffer-revision)) + (setq magit-buffer-revision-oid (magit-commit-oid magit-buffer-revision)) (magit-insert-section (stash) (magit-run-section-hook 'magit-stash-sections-hook))) @@ -687,6 +688,7 @@ that make up the stash." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-status.el b/elpa/magit-20260422.2206/magit-status.el similarity index 92% rename from elpa/magit-20251217.1836/magit-status.el rename to elpa/magit-20260422.2206/magit-status.el index b9638644..19690357 100644 --- a/elpa/magit-20251217.1836/magit-status.el +++ b/elpa/magit-20260422.2206/magit-status.el @@ -1,6 +1,6 @@ ;;; magit-status.el --- The grand overview -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -259,18 +259,18 @@ has to confirm that it should be reinitialized. Non-interactively DIRECTORY is (re-)initialized unconditionally." (interactive - (let ((directory (file-name-as-directory - (expand-file-name - (read-directory-name "Create repository in: "))))) - (when-let ((toplevel (magit-toplevel directory))) - (setq toplevel (expand-file-name toplevel)) - (unless (y-or-n-p (if (file-equal-p toplevel directory) - (format "Reinitialize existing repository %s? " - directory) - (format "%s is a repository. Create another in %s? " - toplevel directory))) - (user-error "Abort"))) - (list directory))) + (let ((directory (file-name-as-directory + (expand-file-name + (read-directory-name "Create repository in: "))))) + (when-let ((toplevel (magit-toplevel directory))) + (setq toplevel (expand-file-name toplevel)) + (unless (y-or-n-p (if (file-equal-p toplevel directory) + (format "Reinitialize existing repository %s? " + directory) + (format "%s is a repository. Create another in %s? " + toplevel directory))) + (user-error "Abort"))) + (list directory))) ;; `git init' does not understand the meaning of "~"! (magit-call-git "init" (magit-convert-filename-for-git (expand-file-name directory))) @@ -310,12 +310,12 @@ prefix arguments: then fall back to the same behavior as with two prefix arguments." (interactive - (let ((magit--refresh-cache (list (cons 0 0)))) - (list (and (or current-prefix-arg (not (magit-toplevel))) - (progn (magit--assert-usable-git) - (magit-read-repository - (>= (prefix-numeric-value current-prefix-arg) 16)))) - magit--refresh-cache))) + (let ((magit--refresh-cache (list (cons 0 0)))) + (list (and (or current-prefix-arg (not (magit-toplevel))) + (progn (magit--assert-usable-git) + (magit-read-repository + (>= (prefix-numeric-value current-prefix-arg) 16)))) + magit--refresh-cache))) (let ((magit--refresh-cache (or cache (list (cons 0 0))))) (if directory (let ((toplevel (magit-toplevel directory))) @@ -622,33 +622,33 @@ arguments are for internal use only." (insert (format "%-10s" (or keyword (if rebase "Rebase: " "Merge: ")))) (insert (cond - (upstream - (concat (and magit-status-show-hashes-in-headers - (concat (propertize (magit-rev-format "%h" upstream) - 'font-lock-face 'magit-hash) - " ")) - upstream " " - (magit-log--wash-summary - (or (magit-rev-format "%s" upstream) - "(no commit message)")))) - ((magit--unnamed-upstream-p remote merge) - (concat (propertize merge 'font-lock-face 'magit-branch-remote) - " from " - (propertize remote 'font-lock-face 'bold))) - ((magit--valid-upstream-p remote merge) - (if (equal remote ".") - (concat - (propertize merge 'font-lock-face 'magit-branch-local) " " - (propertize "does not exist" - 'font-lock-face 'magit-branch-warning)) - (format - "%s %s %s" - (propertize merge 'font-lock-face 'magit-branch-remote) - (propertize "does not exist on" - 'font-lock-face 'magit-branch-warning) - (propertize remote 'font-lock-face 'magit-branch-remote)))) - ((propertize "invalid upstream configuration" - 'font-lock-face 'magit-branch-warning)))) + (upstream + (concat (and magit-status-show-hashes-in-headers + (concat (propertize (magit-rev-format "%h" upstream) + 'font-lock-face 'magit-hash) + " ")) + upstream " " + (magit-log--wash-summary + (or (magit-rev-format "%s" upstream) + "(no commit message)")))) + ((magit--unnamed-upstream-p remote merge) + (concat (propertize merge 'font-lock-face 'magit-branch-remote) + " from " + (propertize remote 'font-lock-face 'bold))) + ((magit--valid-upstream-p remote merge) + (if (equal remote ".") + (concat + (propertize merge 'font-lock-face 'magit-branch-local) " " + (propertize "does not exist" + 'font-lock-face 'magit-branch-warning)) + (format + "%s %s %s" + (propertize merge 'font-lock-face 'magit-branch-remote) + (propertize "does not exist on" + 'font-lock-face 'magit-branch-warning) + (propertize remote 'font-lock-face 'magit-branch-remote)))) + ((propertize "invalid upstream configuration" + 'font-lock-face 'magit-branch-warning)))) (insert ?\n)))))) (defun magit-insert-push-branch-header () @@ -826,6 +826,7 @@ Honor the buffer's file filter, which can be set using \"D - -\"." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-submodule.el b/elpa/magit-20260422.2206/magit-submodule.el similarity index 93% rename from elpa/magit-20251217.1836/magit-submodule.el rename to elpa/magit-20260422.2206/magit-submodule.el index c3c6a88f..db7385ec 100644 --- a/elpa/magit-20251217.1836/magit-submodule.el +++ b/elpa/magit-20260422.2206/magit-submodule.el @@ -1,6 +1,6 @@ ;;; magit-submodule.el --- Submodule support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -216,13 +216,13 @@ it is nil, then PATH also becomes the name." :class 'magit--git-submodule-suffix :description "Add git submodule add [--force]" (interactive - (magit-with-toplevel - (let* ((url (magit-read-string-ns "Add submodule (remote url)")) - (path (magit-submodule-read-path "Add submodules at path: " url))) - (list url - (directory-file-name path) - (magit-submodule-read-name-for-path path) - (magit-submodule-arguments "--force"))))) + (magit-with-toplevel + (let* ((url (magit-read-string-ns "Add submodule (remote url)")) + (path (magit-submodule-read-path "Add submodules at path: " url))) + (list url + (directory-file-name path) + (magit-submodule-read-name-for-path path) + (magit-submodule-arguments "--force"))))) (magit-submodule-add-1 url path name args)) (defun magit-submodule-read-path (prompt url) @@ -277,7 +277,7 @@ single module from the user." ;; the modules. :description "Register git submodule init" (interactive - (list (magit-module-confirm "Register" 'magit-module-no-worktree-p))) + (list (magit-module-confirm "Register" 'magit-module-no-worktree-p))) (magit-with-toplevel (magit-run-git-async "submodule" "init" "--" modules))) @@ -295,8 +295,8 @@ single module from the user." :class 'magit--git-submodule-suffix :description "Populate git submodule update --init [--recursive]" (interactive - (list (magit-module-confirm "Populate" 'magit-module-no-worktree-p) - (magit-submodule-arguments "--recursive"))) + (list (magit-module-confirm "Populate" 'magit-module-no-worktree-p) + (magit-submodule-arguments "--recursive"))) (magit-with-toplevel (magit-run-git-async "submodule" "update" "--init" args "--" modules))) @@ -316,10 +316,10 @@ single module from the user." :description "Update git submodule update [--force] [--no-fetch] [--remote] [--recursive] [--checkout|--rebase|--merge]" (interactive - (list (magit-module-confirm "Update" 'magit-module-worktree-p) - (magit-submodule-arguments - "--force" "--remote" "--recursive" "--checkout" "--rebase" "--merge" - "--no-fetch"))) + (list (magit-module-confirm "Update" 'magit-module-worktree-p) + (magit-submodule-arguments + "--force" "--remote" "--recursive" "--checkout" "--rebase" "--merge" + "--no-fetch"))) (magit-with-toplevel (magit-run-git-async "submodule" "update" args "--" modules))) @@ -334,8 +334,8 @@ single module from the user." :class 'magit--git-submodule-suffix :description "Synchronize git submodule sync [--recursive]" (interactive - (list (magit-module-confirm "Synchronize" 'magit-module-worktree-p) - (magit-submodule-arguments "--recursive"))) + (list (magit-module-confirm "Synchronize" 'magit-module-worktree-p) + (magit-submodule-arguments "--recursive"))) (magit-with-toplevel (magit-run-git-async "submodule" "sync" args "--" modules))) @@ -357,8 +357,8 @@ single module from the user." :class 'magit--git-submodule-suffix :description "Unpopulate git submodule deinit [--force]" (interactive - (list (magit-module-confirm "Unpopulate") - (magit-submodule-arguments "--force"))) + (list (magit-module-confirm "Unpopulate") + (magit-submodule-arguments "--force"))) (magit-with-toplevel (magit-run-git-async "submodule" "deinit" args "--" modules))) @@ -377,11 +377,11 @@ Both actions are very dangerous and have to be confirmed. There are additional safety precautions in place, so you might be able to recover from making a mistake here, but don't count on it." (interactive - (list (if-let ((modules (magit-region-values 'magit-module-section t))) - (magit-confirm 'remove-modules nil "Remove %d modules" nil modules) - (list (magit-read-module-path "Remove module"))) - (magit-submodule-arguments "--force") - current-prefix-arg)) + (list (if-let ((modules (magit-region-values 'magit-module-section t))) + (magit-confirm 'remove-modules nil "Remove %d modules" nil modules) + (list (magit-read-module-path "Remove module"))) + (magit-submodule-arguments "--force") + current-prefix-arg)) (when magit-submodule-remove-trash-gitdirs (setq trash-gitdirs t)) (magit-with-toplevel @@ -539,20 +539,20 @@ With a prefix argument, visit in another window." (magit-with-toplevel (let ((path (expand-file-name module))) (cond - ((file-exists-p (expand-file-name ".git" module)) - (magit-diff-visit-directory path other-window)) - ((y-or-n-p (format "Initialize submodule '%s' first?" module)) - (magit-run-git-async "submodule" "update" "--init" "--" module) - (set-process-sentinel - magit-this-process - (lambda (process event) - (let ((magit-process-raise-error t)) - (magit-process-sentinel process event)) - (when (and (eq (process-status process) 'exit) - (= (process-exit-status process) 0)) - (magit-diff-visit-directory path other-window))))) - ((file-exists-p path) - (dired-jump other-window (concat path "/."))))))) + ((file-exists-p (expand-file-name ".git" module)) + (magit-diff-visit-directory path other-window)) + ((y-or-n-p (format "Initialize submodule '%s' first?" module)) + (magit-run-git-async "submodule" "update" "--init" "--" module) + (set-process-sentinel + magit-this-process + (lambda (process event) + (let ((magit-process-raise-error t)) + (magit-process-sentinel process event)) + (when (and (eq (process-status process) 'exit) + (= (process-exit-status process) 0)) + (magit-diff-visit-directory path other-window))))) + ((file-exists-p path) + (dired-jump other-window (concat path "/."))))))) ;;;###autoload (defun magit-insert-modules-unpulled-from-upstream () @@ -720,6 +720,7 @@ These sections can be expanded to show the respective commits." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-subtree.el b/elpa/magit-20260422.2206/magit-subtree.el similarity index 85% rename from elpa/magit-20251217.1836/magit-subtree.el rename to elpa/magit-20260422.2206/magit-subtree.el index a94d0559..daf46016 100644 --- a/elpa/magit-20251217.1836/magit-subtree.el +++ b/elpa/magit-20260422.2206/magit-subtree.el @@ -1,6 +1,6 @@ ;;; magit-subtree.el --- Subtree support for Magit -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -129,40 +129,40 @@ (defun magit-subtree-add (prefix repository ref args) "Add REF from REPOSITORY as a new subtree at PREFIX." (interactive - (cons (magit-subtree-prefix 'magit-subtree-import "Add subtree") - (let ((remote (magit-read-remote-or-url "From repository"))) - (list remote - (magit-read-refspec "Ref" remote) - (magit-subtree-arguments 'magit-subtree-import))))) + (cons (magit-subtree-prefix 'magit-subtree-import "Add subtree") + (let ((remote (magit-read-remote-or-url "From repository"))) + (list remote + (magit-read-refspec "Ref" remote) + (magit-subtree-arguments 'magit-subtree-import))))) (magit-git-subtree "add" prefix args repository ref)) ;;;###autoload (defun magit-subtree-add-commit (prefix commit args) "Add COMMIT as a new subtree at PREFIX." (interactive - (list (magit-subtree-prefix 'magit-subtree-import "Add subtree") - (magit-read-string-ns "Commit") - (magit-subtree-arguments 'magit-subtree-import))) + (list (magit-subtree-prefix 'magit-subtree-import "Add subtree") + (magit-read-string-ns "Commit") + (magit-subtree-arguments 'magit-subtree-import))) (magit-git-subtree "add" prefix args commit)) ;;;###autoload (defun magit-subtree-merge (prefix commit args) "Merge COMMIT into the PREFIX subtree." (interactive - (list (magit-subtree-prefix 'magit-subtree-import "Merge into subtree") - (magit-read-string-ns "Commit") - (magit-subtree-arguments 'magit-subtree-import))) + (list (magit-subtree-prefix 'magit-subtree-import "Merge into subtree") + (magit-read-string-ns "Commit") + (magit-subtree-arguments 'magit-subtree-import))) (magit-git-subtree "merge" prefix args commit)) ;;;###autoload (defun magit-subtree-pull (prefix repository ref args) "Pull REF from REPOSITORY into the PREFIX subtree." (interactive - (cons (magit-subtree-prefix 'magit-subtree-import "Pull into subtree") - (let ((remote (magit-read-remote-or-url "From repository"))) - (list remote - (magit-read-refspec "Ref" remote) - (magit-subtree-arguments 'magit-subtree-import))))) + (cons (magit-subtree-prefix 'magit-subtree-import "Pull into subtree") + (let ((remote (magit-read-remote-or-url "From repository"))) + (list remote + (magit-read-refspec "Ref" remote) + (magit-subtree-arguments 'magit-subtree-import))))) (magit-git-subtree "pull" prefix args repository ref)) ;;;###autoload @@ -190,6 +190,7 @@ ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-tag.el b/elpa/magit-20260422.2206/magit-tag.el similarity index 68% rename from elpa/magit-20251217.1836/magit-tag.el rename to elpa/magit-20260422.2206/magit-tag.el index 8847d3bf..62212c8f 100644 --- a/elpa/magit-20251217.1836/magit-tag.el +++ b/elpa/magit-20260422.2206/magit-tag.el @@ -1,6 +1,6 @@ ;;; magit-tag.el --- Tag functionality -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -91,26 +91,26 @@ defaulting to the tag at point. (defun magit-tag-prune (tags remote-tags remote) "Offer to delete tags missing locally from REMOTE, and vice versa." (interactive - (let* ((remote (magit-read-remote "Prune tags using remote")) - (tags (magit-list-tags)) - (rtags (prog2 (message "Determining remote tags...") - (magit-remote-list-tags remote) - (message "Determining remote tags...done"))) - (ltags (cl-set-difference tags rtags :test #'equal)) - (rtags (cl-set-difference rtags tags :test #'equal))) - (unless (or ltags rtags) - (message "Same tags exist locally and remotely")) - (unless (magit-confirm t - "Delete %s locally" - "Delete %d tags locally" - 'noabort ltags) - (setq ltags nil)) - (unless (magit-confirm t - "Delete %s from remote" - "Delete %d tags from remote" - 'noabort rtags) - (setq rtags nil)) - (list ltags rtags remote))) + (let* ((remote (magit-read-remote "Prune tags using remote")) + (tags (magit-list-tags)) + (rtags (prog2 (message "Determining remote tags...") + (magit-remote-list-tags remote) + (message "Determining remote tags...done"))) + (ltags (cl-set-difference tags rtags :test #'equal)) + (rtags (cl-set-difference rtags tags :test #'equal))) + (unless (or ltags rtags) + (message "Same tags exist locally and remotely")) + (unless (magit-confirm t + "Delete %s locally" + "Delete %d tags locally" + 'noabort ltags) + (setq ltags nil)) + (unless (magit-confirm t + "Delete %s from remote" + "Delete %d tags from remote" + 'noabort rtags) + (setq rtags nil)) + (list ltags rtags remote))) (when tags (magit-call-git "tag" "-d" tags)) (when remote-tags @@ -161,52 +161,52 @@ of the highest existing tag, provided that contains the corresponding version string, and substituting the new version string for that. If that is not the case, propose a message using a reasonable format." (interactive - (save-match-data - (pcase-let* - ((args (magit-tag-arguments)) - (`(,pver ,ptag ,pmsg) (car (magit--list-releases))) - (msg (magit-rev-format "%s")) - (ver (and (string-match magit-release-commit-regexp msg) - (match-str 1 msg))) - (_ (and (not ver) - (require (quote sisyphus) nil t) - (string-match magit-release-commit-regexp - (magit-rev-format "%s" ptag)) - (user-error "Use `sisyphus-create-release' first"))) - (tag (cond - ((not ptag) - ;; Force the user to review the message used for the - ;; initial release tag, in case they do not like the - ;; default format. - (cl-pushnew "--edit" args :test #'equal) - (read-string "Create first release tag: " - (if (and ver (string-match-p "\\`[0-9]" ver)) - (concat "v" ver) - ver))) - (ver - (concat (and (string-match magit-release-tag-regexp ptag) - (match-str 1 ptag)) - ver)) - ((read-string (format "Create release tag (previous was %s): " - ptag) - ptag)))) - (ver (and (string-match magit-release-tag-regexp tag) - (match-str 2 tag)))) - (list tag - (and (seq-some (apply-partially - #'string-match-p - "\\`--\\(annotate\\|local-user\\|sign\\)") - args) - (cond ((and pver (string-match (regexp-quote pver) pmsg)) - (replace-match ver t t pmsg)) - ((and ptag (string-match (regexp-quote ptag) pmsg)) - (replace-match tag t t pmsg)) - ((format "%s %s" - (capitalize - (file-name-nondirectory - (directory-file-name (magit-toplevel)))) - ver)))) - args)))) + (save-match-data + (pcase-let* + ((args (magit-tag-arguments)) + (`(,pver ,ptag ,pmsg) (car (magit--list-releases))) + (msg (magit-rev-format "%s")) + (ver (and (string-match magit-release-commit-regexp msg) + (match-str 1 msg))) + (_ (and (not ver) + (require (quote sisyphus) nil t) + (string-match magit-release-commit-regexp + (magit-rev-format "%s" ptag)) + (user-error "Use `sisyphus-create-release' first"))) + (tag (cond + ((not ptag) + ;; Force the user to review the message used for the + ;; initial release tag, in case they do not like the + ;; default format. + (cl-pushnew "--edit" args :test #'equal) + (read-string "Create first release tag: " + (if (and ver (string-match-p "\\`[0-9]" ver)) + (concat "v" ver) + ver))) + (ver + (concat (and (string-match magit-release-tag-regexp ptag) + (match-str 1 ptag)) + ver)) + ((read-string (format "Create release tag (previous was %s): " + ptag) + ptag)))) + (ver (and (string-match magit-release-tag-regexp tag) + (match-str 2 tag)))) + (list tag + (and (seq-some (apply-partially + #'string-match-p + "\\`--\\(annotate\\|local-user\\|sign\\)") + args) + (cond ((and pver (string-match (regexp-quote pver) pmsg)) + (replace-match ver t t pmsg)) + ((and ptag (string-match (regexp-quote ptag) pmsg)) + (replace-match tag t t pmsg)) + ((format "%s %s" + (capitalize + (file-name-nondirectory + (directory-file-name (magit-toplevel)))) + ver)))) + args)))) (magit-run-git-with-editor "tag" args (and msg (list "-m" msg)) tag) (set-process-sentinel magit-this-process @@ -249,6 +249,7 @@ a tag qualifies as a release tag." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-transient.el b/elpa/magit-20260422.2206/magit-transient.el similarity index 83% rename from elpa/magit-20251217.1836/magit-transient.el rename to elpa/magit-20260422.2206/magit-transient.el index 7cafc54b..acff0492 100644 --- a/elpa/magit-20251217.1836/magit-transient.el +++ b/elpa/magit-20260422.2206/magit-transient.el @@ -1,6 +1,6 @@ ;;; magit-transient.el --- Support for transients -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -38,7 +38,8 @@ (defclass magit--git-variable (transient-variable) ((scope :initarg :scope) (global :initarg :global :initform nil) - (default :initarg :default :initform nil))) + (default :initarg :default :initform nil) + (accessible-format :initform "%i%k %d is %v"))) (defclass magit--git-variable:choices (magit--git-variable) ((choices :initarg :choices) @@ -75,7 +76,9 @@ (oref obj scope))) (arg (if (oref obj global) "--global" "--local"))) (oset obj variable variable) - (oset obj value (if (magit-get-boolean arg variable) "true" "false")))) + (oset obj value + (and (zerop (magit-process-git t "config" "--bool" arg variable)) + (buffer-substring (point-min) (1- (point-max))))))) ;;;; Read @@ -93,15 +96,18 @@ (when (functionp choices) (setq choices (funcall choices))) (cond-let - (current-prefix-arg + ((or transient-prefer-reading-value current-prefix-arg) (pcase-let* - ((`(,fallback . ,choices) + ((`(,unset . ,choices) (magit--git-variable-list-choices obj)) + (unset (or unset "(unset)")) (choice (magit-completing-read (format "Set `%s' to" (oref obj variable)) - (if fallback (nconc choices (list fallback)) choices) + (nconc (mapcar #'magit--delete-text-properties choices) + (list (propertize unset 'face + 'transient-inactive-value))) nil t))) - (if (equal choice fallback) nil choice))) + (if (equal choice unset) nil choice))) ([value (oref obj value)] (cadr (member value choices))) ((car choices))))) @@ -167,36 +173,37 @@ 'face 'transient-value))) ([default (oref obj default)] [default (if (functionp default) (funcall default) default)] - (concat (propertize "default:" 'face 'transient-inactive-value) - (propertize default 'face 'transient-value))) + (if transient-prefer-reading-value + (format "unset, using default, which is %s" + (propertize default 'face 'transient-value)) + (concat (propertize "default:" 'face 'transient-inactive-value) + (propertize default 'face 'transient-value)))) ((propertize "unset" 'face 'transient-inactive-value)))) (cl-defmethod transient-format-value ((obj magit--git-variable:choices)) - (pcase-let ((`(,fallback . ,choices) (magit--git-variable-list-choices obj))) - (concat - (propertize "[" 'face 'transient-inactive-value) - (mapconcat #'identity choices - (propertize "|" 'face 'transient-inactive-value)) - (and fallback (propertize "|" 'face 'transient-inactive-value)) - fallback - (propertize "]" 'face 'transient-inactive-value)))) + (if transient-prefer-reading-value + (cl-call-next-method) + (pcase-let ((`(,fallback . ,choices) (magit--git-variable-list-choices obj))) + (concat + (propertize "[" 'face 'transient-inactive-value) + (mapconcat #'identity choices + (propertize "|" 'face 'transient-inactive-value)) + (and fallback (propertize "|" 'face 'transient-inactive-value)) + fallback + (propertize "]" 'face 'transient-inactive-value))))) (defun magit--git-variable-list-choices (obj) (let* ((variable (oref obj variable)) (choices (oref obj choices)) - (globalp (oref obj global)) - (value nil) - (global (magit-git-string "config" "--global" variable)) + (value (oref obj value)) + (global (and (not (oref obj global)) + (magit-git-string "config" "--global" variable))) (defaultp (oref obj default)) (default (if (functionp defaultp) (funcall defaultp obj) defaultp)) (fallback (oref obj fallback)) (fallback (and fallback (and$ (magit-get fallback) (concat fallback ":" $))))) - (if (not globalp) - (setq value (magit-git-string "config" "--local" variable)) - (setq value global) - (setq global nil)) (when (functionp choices) (setq choices (funcall choices))) (cons (cond (global @@ -236,6 +243,7 @@ ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-wip.el b/elpa/magit-20260422.2206/magit-wip.el similarity index 71% rename from elpa/magit-20251217.1836/magit-wip.el rename to elpa/magit-20260422.2206/magit-wip.el index 51c64a13..049243b4 100644 --- a/elpa/magit-20251217.1836/magit-wip.el +++ b/elpa/magit-20260422.2206/magit-wip.el @@ -1,6 +1,6 @@ ;;; magit-wip.el --- Commit snapshots to work-in-progress refs -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -70,6 +70,12 @@ Customize `magit-overriding-githook-directory' to enable use of Git hooks." :package-version '(magit . "2.90.0") :group 'magit-wip + :set (lambda (symbol value) + (set-default-toplevel-value symbol value) + (when (bound-and-true-p magit-wip-mode) + (if (eq value 'immediately) + (add-hook 'git-commit-post-finish-hook #'magit-wip-commit) + (remove-hook 'git-commit-post-finish-hook #'magit-wip-commit)))) :type '(choice (const :tag "Yes (safely, just in time)" t) (const :tag "Yes (immediately, with race condition)" immediately) @@ -104,29 +110,28 @@ buffer." :package-version '(magit . "2.90.0") :lighter magit-wip-mode-lighter :global t + :set-after '(magit-wip-merge-branch) (cond - (magit-wip-mode - (add-hook 'after-save-hook #'magit-wip-commit-buffer-file) - (add-hook 'magit-after-apply-functions #'magit-wip-commit) - (add-hook 'magit-before-change-functions #'magit-wip-commit) - (add-hook 'before-save-hook #'magit-wip-commit-initial-backup) - (add-hook 'magit-common-git-post-commit-functions #'magit-wip-post-commit) - (add-hook 'git-commit-post-finish-hook #'magit-wip-commit-post-editmsg)) - (t - (remove-hook 'after-save-hook #'magit-wip-commit-buffer-file) - (remove-hook 'magit-after-apply-functions #'magit-wip-commit) - (remove-hook 'magit-before-change-functions #'magit-wip-commit) - (remove-hook 'before-save-hook #'magit-wip-commit-initial-backup) - (remove-hook 'magit-common-git-post-commit-functions #'magit-wip-post-commit) - (remove-hook 'git-commit-post-finish-hook #'magit-wip-commit-post-editmsg)))) + (magit-wip-mode + (add-hook 'after-save-hook #'magit-wip-commit-buffer-file) + (add-hook 'magit-after-apply-functions #'magit-wip-commit) + (add-hook 'magit-before-change-functions #'magit-wip-commit) + (add-hook 'before-save-hook #'magit-wip-commit-initial-backup) + (add-hook 'magit-common-git-post-commit-functions #'magit-wip-post-commit) + (when (eq magit-wip-merge-branch 'immediately) + (add-hook 'git-commit-post-finish-hook #'magit-wip-commit))) + (t + (remove-hook 'after-save-hook #'magit-wip-commit-buffer-file) + (remove-hook 'magit-after-apply-functions #'magit-wip-commit) + (remove-hook 'magit-before-change-functions #'magit-wip-commit) + (remove-hook 'before-save-hook #'magit-wip-commit-initial-backup) + (remove-hook 'magit-common-git-post-commit-functions #'magit-wip-post-commit) + (remove-hook 'git-commit-post-finish-hook #'magit-wip-commit)))) (defun magit-wip-commit-buffer-file (&optional msg) "Commit visited file to a worktree work-in-progress ref." (interactive (list "save %s snapshot")) - (when (and (not magit--wip-inhibit-autosave) - buffer-file-name - (magit-inside-worktree-p t) - (magit-file-tracked-p buffer-file-name)) + (when (magit-wip--commitable-p) (magit-wip-commit-worktree (magit-wip-get-ref) (list buffer-file-name) @@ -147,10 +152,7 @@ buffer." (put 'magit-wip-buffer-backed-up 'permanent-local t) (defun magit-wip-commit-initial-backup () - (when (and (not magit-wip-buffer-backed-up) - buffer-file-name - (magit-inside-worktree-p t) - (magit-file-tracked-p buffer-file-name)) + (when (magit-wip--commitable-p) (let ((magit-save-repository-buffers nil)) (magit-wip-commit-buffer-file "autosave %s before save")) (setq magit-wip-buffer-backed-up t))) @@ -159,10 +161,6 @@ buffer." (when (eq magit-wip-merge-branch 'githook) (magit-wip-commit))) -(defun magit-wip-commit-post-editmsg () - (when (eq magit-wip-merge-branch 'immediately) - (magit-wip-commit))) - ;;; Core (defun magit-wip-commit (&optional files msg) @@ -189,24 +187,29 @@ commit message." (defun magit-wip-commit-worktree (ref files msg) (when (or (not files) - ;; `update-index' will either ignore (before Git v2.32.0) - ;; or fail when passed directories (relevant for the - ;; untracked files code paths). + ;; "git update-index" either ignores (before Git v2.32.0) or + ;; fails, when passed directories. This is relevant for the + ;; untracked files code paths. (setq files (seq-remove #'file-directory-p files))) (let* ((wipref (magit--wip-wtree-ref ref)) (parent (magit-wip-get-parent ref wipref)) - (tree (magit-with-temp-index parent (list "--reset" "-i") - (if files - ;; Note: `update-index' is used instead of `add' - ;; because `add' will fail if a file is already - ;; deleted in the temporary index. - (magit-wip--git "update-index" "--add" "--remove" - "--ignore-skip-worktree-entries" - "--" files) - (magit-with-toplevel - (magit-wip--git "add" "-u" "."))) - (magit-git-string "write-tree")))) - (magit-wip-update-wipref ref wipref tree parent files msg "worktree")))) + (tree (condition-case nil + (magit-with-temp-index parent (list "--reset" "-i") + (if files + ;; Use "git update-index" instead of "git add" + ;; because the latter fails if a file is already + ;; deleted in the temporary index. + (magit-wip--git "update-index" "--add" "--remove" + "--ignore-skip-worktree-entries" + "--" files) + (magit-with-toplevel + (magit-wip--git "add" "-u" "."))) + (magit-git-string "write-tree")) + (error + (message "Index locked; no worktree wip commit created"))))) + (when tree + (magit-wip-update-wipref ref wipref tree parent + files msg "worktree"))))) (defun magit-wip--git (&rest args) (if magit-wip-debug @@ -220,29 +223,29 @@ commit message." (defun magit-wip-update-wipref (ref wipref tree parent files msg start-msg) (cond - ((and (not (equal parent wipref)) - (or (not magit-wip-merge-branch) - (not (magit-rev-verify wipref)))) - (setq start-msg (concat "start autosaving " start-msg)) - (magit-wip--update-ref wipref start-msg - (magit-git-string "commit-tree" "--no-gpg-sign" - "-p" parent "-m" start-msg - (concat parent "^{tree}"))) - (setq parent wipref)) - ((and magit-wip-merge-branch - (or (not (magit-rev-ancestor-p ref wipref)) - (not (magit-rev-ancestor-p - (concat (magit-git-string "log" "--format=%H" - "-1" "--merges" wipref) - "^2") - ref)))) - (setq start-msg (format "merge %s into %s" ref start-msg)) - (magit-wip--update-ref wipref start-msg - (magit-git-string "commit-tree" "--no-gpg-sign" - "-p" wipref "-p" ref - "-m" start-msg - (concat ref "^{tree}"))) - (setq parent wipref))) + ((and (not (equal parent wipref)) + (or (not magit-wip-merge-branch) + (not (magit-rev-verify wipref)))) + (setq start-msg (concat "start autosaving " start-msg)) + (magit-wip--update-ref wipref start-msg + (magit-git-string "commit-tree" "--no-gpg-sign" + "-p" parent "-m" start-msg + (concat parent "^{tree}"))) + (setq parent wipref)) + ((and magit-wip-merge-branch + (or (not (magit-rev-ancestor-p ref wipref)) + (not (magit-rev-ancestor-p + (concat (magit-git-string "log" "--format=%H" + "-1" "--merges" wipref) + "^2") + ref)))) + (setq start-msg (format "merge %s into %s" ref start-msg)) + (magit-wip--update-ref wipref start-msg + (magit-git-string "commit-tree" "--no-gpg-sign" + "-p" wipref "-p" ref + "-m" start-msg + (concat ref "^{tree}"))) + (setq parent wipref))) (when (magit-git-failure "diff-tree" "--quiet" parent tree "--" files) (unless (and msg (not (= (aref msg 0) ?\s))) (let ((len (length files))) @@ -289,6 +292,13 @@ commit message." (concat "refs/heads/" branch)) "HEAD"))) +(defun magit-wip--commitable-p () + (and (not magit--wip-inhibit-autosave) + buffer-file-name + (magit-inside-worktree-p t) + (magit-file-tracked-p buffer-file-name) + (magit-wip-get-ref))) + ;;; Log (defun magit-wip-log-index (args files) @@ -307,9 +317,9 @@ With a negative prefix argument only show the worktree wip ref. The absolute numeric value of the prefix argument controls how many \"branches\" of each wip ref are shown." (interactive - (nconc (list (or (magit-get-current-branch) "HEAD")) - (magit-log-arguments) - (list (prefix-numeric-value current-prefix-arg)))) + (nconc (list (or (magit-get-current-branch) "HEAD")) + (magit-log-arguments) + (list (prefix-numeric-value current-prefix-arg)))) (magit-wip-log branch args files count)) (defun magit-wip-log (branch args files count) @@ -318,16 +328,16 @@ With a negative prefix argument only show the worktree wip ref. The absolute numeric value of the prefix argument controls how many \"branches\" of each wip ref are shown." (interactive - (nconc (list (magit-completing-read - "Log branch and its wip refs" - (nconc (magit-list-local-branch-names) - (list "HEAD")) - nil t nil 'magit-revision-history - (or (magit-branch-at-point) - (magit-get-current-branch) - "HEAD"))) - (magit-log-arguments) - (list (prefix-numeric-value current-prefix-arg)))) + (nconc (list (magit-completing-read + "Log branch and its wip refs" + (nconc (magit-list-local-branch-names) + (list "HEAD")) + nil t nil 'magit-revision-history + (or (magit-branch-at-point) + (magit-get-current-branch) + "HEAD"))) + (magit-log-arguments) + (list (prefix-numeric-value current-prefix-arg)))) (magit-log-setup-buffer (nconc (list branch) (magit-wip-log-get-tips (magit--wip-wtree-ref branch) @@ -383,6 +393,7 @@ many \"branches\" of each wip ref are shown." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit-worktree.el b/elpa/magit-20260422.2206/magit-worktree.el similarity index 78% rename from elpa/magit-20251217.1836/magit-worktree.el rename to elpa/magit-20260422.2206/magit-worktree.el index 4f6859c5..c70f221a 100644 --- a/elpa/magit-20251217.1836/magit-worktree.el +++ b/elpa/magit-20260422.2206/magit-worktree.el @@ -1,6 +1,6 @@ ;;; magit-worktree.el --- Worktree support -*- lexical-binding:t -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -143,11 +143,11 @@ just \"PREFIX_\". Always forward PROMPT as-is." COMMIT may, but does not have to be, a local branch. Interactively, use `magit-read-worktree-directory-function'." (interactive - (let ((commit (magit-read-branch-or-commit - "In new worktree; checkout" nil - (mapcar #'caddr (magit-list-worktrees))))) - (list (magit--read-worktree-directory commit (magit-local-branch-p commit)) - commit))) + (let ((commit (magit-read-branch-or-commit + "In new worktree; checkout" nil + (mapcar #'caddr (magit-list-worktrees))))) + (list (magit--read-worktree-directory commit (magit-local-branch-p commit)) + commit))) (when (zerop (magit-run-git "worktree" "add" (magit--expand-worktree directory) commit)) (magit-diff-visit-directory directory))) @@ -157,11 +157,11 @@ Interactively, use `magit-read-worktree-directory-function'." "Create a new BRANCH and check it out in a new worktree at DIRECTORY. Interactively, use `magit-read-worktree-directory-function'." (interactive - (pcase-let - ((`(,branch ,start-point) - (magit-branch-read-args "In new worktree; checkout new branch"))) - (list (magit--read-worktree-directory branch t) - branch start-point))) + (pcase-let + ((`(,branch ,start-point) + (magit-branch-read-args "In new worktree; checkout new branch"))) + (list (magit--read-worktree-directory branch t) + branch start-point))) (when (zerop (magit-run-git "worktree" "add" "-b" branch (magit--expand-worktree directory) start-point)) (magit-diff-visit-directory directory))) @@ -170,11 +170,11 @@ Interactively, use `magit-read-worktree-directory-function'." (defun magit-worktree-move (worktree directory) "Move existing WORKTREE directory to DIRECTORY." (interactive - (list (magit-completing-read "Move worktree" - (cdr (magit-list-worktrees)) - nil t nil nil - (magit-section-value-if 'worktree)) - (read-directory-name "Move worktree to: "))) + (list (magit-completing-read "Move worktree" + (cdr (magit-list-worktrees)) + nil t nil nil + (magit-section-value-if 'worktree)) + (read-directory-name "Move worktree to: "))) (if (file-directory-p (expand-file-name ".git" worktree)) (user-error "You may not move the main working tree") (let ((preexisting-directory (file-directory-p directory))) @@ -194,18 +194,31 @@ Interactively, use `magit-read-worktree-directory-function'." "Delete a worktree, defaulting to the worktree at point. The primary worktree cannot be deleted." (interactive - (list (magit-completing-read "Delete worktree" - (mapcar #'car (cdr (magit-list-worktrees))) - nil t nil nil - (magit-section-value-if 'worktree)))) + (list (magit-completing-read "Delete worktree" + (mapcar #'car (cdr (magit-list-worktrees))) + nil t nil nil + (magit-section-value-if 'worktree)))) (if (file-directory-p (expand-file-name ".git" worktree)) (user-error "Deleting %s would delete the shared .git directory" worktree) (let ((primary (file-name-as-directory (caar (magit-list-worktrees))))) - (magit-confirm-files (if magit-delete-by-moving-to-trash 'trash 'delete) - (list worktree)) (when (file-exists-p worktree) - (let ((delete-by-moving-to-trash magit-delete-by-moving-to-trash)) - (delete-directory worktree t magit-delete-by-moving-to-trash))) + (let (uncommitted) + (magit-confirm + (cond ((let ((default-directory worktree)) + (or (magit-anything-modified-p) + (magit-untracked-files))) + (setq uncommitted 'danger)) + (magit-delete-by-moving-to-trash 'trash) + ('delete)) + (format "%s worktree \"%s\"%s" + (if magit-delete-by-moving-to-trash "Trash" "Delete") + (file-name-nondirectory (directory-file-name worktree)) + (if uncommitted " despite uncommitted changes" "")) + nil nil (list worktree))) + (if magit-delete-by-moving-to-trash + (let ((delete-by-moving-to-trash t)) + (delete-directory worktree t t)) + (magit-call-git "worktree" "remove" "--force" worktree))) (if (file-exists-p default-directory) (magit-run-git "worktree" "prune") (let ((default-directory primary)) @@ -221,13 +234,13 @@ minibuffer. If the worktree at point is the one whose status is already being displayed in the current buffer, then show it in Dired instead." (interactive - (list (or (magit-section-value-if 'worktree) - (magit-completing-read - "Show status for worktree" - (cl-delete (directory-file-name (magit-toplevel)) - (magit-list-worktrees) - :test #'equal :key #'car) - nil t)))) + (list (or (magit-section-value-if 'worktree) + (magit-completing-read + "Show status for worktree" + (cl-delete (directory-file-name (magit-toplevel)) + (magit-list-worktrees) + :test #'equal :key #'car) + nil t)))) (magit-diff-visit-directory worktree)) (defun magit--expand-worktree (directory) @@ -254,18 +267,21 @@ If there is only one worktree, then insert nothing." (let* ((cols (mapcar (lambda (config) - (pcase-let ((`(,_ ,commit ,branch ,bare) config)) + (pcase-let ((`(,directory ,commit ,branch ,bare) config)) (cons (cond - (branch - (propertize - branch 'font-lock-face - (if (equal branch (magit-get-current-branch)) - 'magit-branch-current - 'magit-branch-local))) - (commit - (propertize (magit-rev-abbrev commit) - 'font-lock-face 'magit-hash)) - (bare "(bare)")) + (branch + (propertize + branch 'font-lock-face + (if (equal branch (magit-get-current-branch)) + 'magit-branch-current + 'magit-branch-local))) + (commit + (propertize + (magit-rev-abbrev commit) 'font-lock-face + (if (file-equal-p default-directory directory) + '(magit-hash magit-branch-current) + 'magit-hash))) + (bare "(bare)")) config))) worktrees)) (align (1+ (apply #'max (mapcar (##string-width (car %)) cols))))) @@ -300,6 +316,7 @@ with padding for alignment." ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit.el b/elpa/magit-20260422.2206/magit.el similarity index 99% rename from elpa/magit-20251217.1836/magit.el rename to elpa/magit-20260422.2206/magit.el index 16afef3c..31655add 100644 --- a/elpa/magit-20251217.1836/magit.el +++ b/elpa/magit-20260422.2206/magit.el @@ -1,6 +1,6 @@ ;;; magit.el --- A Git porcelain inside Emacs -*- lexical-binding:t; coding:utf-8 -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Marius Vollmer ;; Jonas Bernoulli @@ -17,16 +17,16 @@ ;; Homepage: https://github.com/magit/magit ;; Keywords: git tools vc -;; Package-Version: 20251217.1836 -;; Package-Revision: 655bc502a3bd +;; Package-Version: 20260422.2206 +;; Package-Revision: 569b9656d6a2 ;; Package-Requires: ( ;; (emacs "28.1") ;; (compat "30.1") -;; (cond-let "0.1") +;; (cond-let "0.2") ;; (llama "1.0") -;; (magit-section "4.4") +;; (magit-section "4.5") ;; (seq "2.24") -;; (transient "0.10") +;; (transient "0.13") ;; (with-editor "3.4")) ;; SPDX-License-Identifier: GPL-3.0-or-later @@ -805,6 +805,7 @@ For X11 something like ~/.xinitrc should work.\n" ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-20251217.1836/magit.info b/elpa/magit-20260422.2206/magit.info similarity index 97% rename from elpa/magit-20251217.1836/magit.info rename to elpa/magit-20260422.2206/magit.info index 65a61663..3bb6b7a1 100644 --- a/elpa/magit-20251217.1836/magit.info +++ b/elpa/magit-20260422.2206/magit.info @@ -1,6 +1,6 @@ This is magit.info, produced by makeinfo version 6.8 from magit.texi. - Copyright (C) 2015-2025 Jonas Bernoulli + Copyright (C) 2015-2026 Jonas Bernoulli You can redistribute this document and/or modify it under the terms @@ -32,9 +32,9 @@ to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains. -This manual is for Magit version 4.4.2. +This manual is for Magit version 4.5.0. - Copyright (C) 2015-2025 Jonas Bernoulli + Copyright (C) 2015-2026 Jonas Bernoulli You can redistribute this document and/or modify it under the terms @@ -3292,7 +3292,43 @@ not support these arguments.) initialized. ‘D t’ (‘magit-diff-toggle-refine-hunk’) - This command toggles hunk refinement on or off. + This command toggles hunk refinement on or off, or switches the + refinement method. + + If hunk refinement is currently on, then turn off hunk refinement. + If hunk refinement is off, then turn on immediate hunk refinement. + + With a prefix argument, an alternative refinement method comes into + play. When using that method, mode hunks are not refined + immediately, instead each hunk is refined once it is selected, and + then stays refined until the next refresh of the buffer. If hunk + refinement is currently on, then toggle between refining all hunks + up front or only once they are selected. If hunk refinement is + off, then turn on hunk refinement, using the eventual refinement + method. + + Customize option ‘magit-diff-refine-hunk’ to change the default + method. + +‘D T’ (‘magit-diff-toggle-fontify-hunk’) + This command toggles hunk fontification on or off, or switches the + fontification method. + + If hunk fontification is currently on, then turn off hunk + fontification. If hunk fontification is off, then turn on + immediate hunk fontification. + + With a prefix argument, an alternative fontification method comes + into play. When using that method, mode hunks are not refined + immediately, instead each hunk is refined once it is selected, and + then stays refined until the next refresh of the buffer. If hunk + fontification is currently on, then toggle between refining all + hunks up front or only once they are selected. If hunk + fontification is off, then turn on fontification, using the + eventual fontification method. + + Customize option ‘magit-diff-fontify-hunk’ to change the default + method. ‘D r’ (‘magit-diff-switch-range-type’) This command converts the diff range type from "revA..revB" to @@ -3415,6 +3451,39 @@ they are available here too. Whether to ignore whitespace changes in word-granularity differences. + -- User Option: magit-diff-fontify-hunk + Whether to apply syntax highlighting to diff hunks. + + • ‘nil’ Never fontify diff hunks. + • ‘all’ Fontify all diff hunks. + • ‘t’ Fontify each hunk once it becomes the current section. + Keep the fontification when another section is selected. + Refreshing the buffer removes all fontification. This variant + is only provided for performance reasons. + + If this is enabled, then ‘magit-diff-specify-hunk-foreground’ + should be disabled. Also consider enabling + ‘magit-diff-use-indicator-faces’. Emacs has to be restarted, after + changing the value of the former. + + This is considered experimental and is disabled by default, because + the fontification is done synchronously, and that can lead to a + noticeable delay. The plan is to make it asynchronous, probably + with the help of the new ‘futur’ package, which itself still under + heavy development. + + -- User Option: magit-diff-specify-hunk-foreground + Whether to specify foreground colors for hunk faces. + + Setting this only has an effect if done before Magit is loaded. + + -- User Option: magit-diff-use-indicator-faces + Whether to use separate faces for diff side indicators. + + If non-‘nil’, use, for example, ‘magit-diff-removed-indicator’ for + the plus sign at the beginning of a removed line. If ‘nil’, use + the same face as for the rest of the line. + -- User Option: magit-diff-adjust-tab-width Whether to adjust the width of tabs in diffs. @@ -4623,14 +4692,14 @@ Fine-grained un-/staging has to be done from the status or a diff buffer, but it’s also possible to un-/stage all changes made to the file visited in the current buffer right from inside that buffer. -‘M-x magit-stage-file’ +‘M-x magit-stage-files’ When invoked inside a file-visiting buffer, then stage all changes to that file. In a Magit buffer, stage the file at point if any. Otherwise prompt for a file to be staged. With a prefix argument always prompt the user for a file, even in a file-visiting buffer or when there is a file section at point. -‘M-x magit-unstage-file’ +‘M-x magit-unstage-files’ When invoked inside a file-visiting buffer, then unstage all changes to that file. In a Magit buffer, unstage the file at point if any. Otherwise prompt for a file to be unstaged. With a prefix @@ -5730,12 +5799,16 @@ following suffix commands. merge commit, which makes it possible to inspect how conflicts were resolved and to adjust the commit message. + To create an octopus-merge, separate branches with commas. + ‘m e’ (‘magit-merge-editmsg’) This command merges another branch or an arbitrary revision into the current branch and opens a commit message buffer, so that the user can make adjustments. The commit is not actually created until the user finishes with ‘C-c C-c’. + To create an octopus-merge, separate branches with commas. + ‘m n’ (‘magit-merge-nocommit’) This command merges another branch or an arbitrary revision into the current branch, but does not actually create the merge commit. @@ -5754,6 +5827,8 @@ following suffix commands. the merged branch, then the respective remote branch is also removed. + To create an octopus-merge, separate branches with commas. + ‘m d’ (‘magit-merge-dissolve’) This command merges the current branch into another local branch and then removes the former. The latter becomes the new current @@ -5961,6 +6036,11 @@ Two Remotes::. commits from START to ‘HEAD’ onto NEWBASE. START has to be selected from a list of recent commits. + This command calls ‘git rebase --onto NEWBASE START HEAD’. Because + the range always ends at ‘HEAD’, you must first check out the + branch or commit you want as the upper bound (a detached ‘HEAD’ + works too). + By default Magit uses the ‘--autostash’ argument, which causes uncommitted changes to be stored in a stash before the rebase begins. These changes are restored after the rebase completes and if possible @@ -6809,6 +6889,21 @@ These variables can be set from the transient prefix command value, then only tags are fetched that are reachable from fetched branches. + -- Variable: remote.NAME.followRemoteHEAD + How "git fetch" handles updates to "remotes//HEAD". + + This command sets the local value of the Git variable + ‘remote..followRemoteHEAD’, where is a stand-in + for the actual remote, as displayed in the menu, from which this + command is invoked. This variable is documented in *note + (gitman)git-config::. + + Unfortunately Git does not provide a variable to set a default for + all remotes of all repositories, but you can set the global value + for a remote name used in multiple repository, which will then be + used as the default for that remote in all repositories. You + should consider using "always" for remotes named "origin". +  File: magit.info, Node: Fetching, Next: Pulling, Prev: Remotes, Up: Transferring @@ -7717,10 +7812,10 @@ all, add this to your init file and restart Emacs. (setq magit-define-global-key-bindings nil) ‘C-c f’ (‘magit-file-dispatch’) -‘C-c f s’ (‘magit-stage-file’) -‘C-c f s’ (‘magit-stage-buffer-file’) -‘C-c f u’ (‘magit-unstage-file’) -‘C-c f u’ (‘magit-unstage-buffer-file’) +‘C-c f s’ (‘magit-stage-files’) +‘C-c f s’ (‘magit-file-stage’) +‘C-c f u’ (‘magit-unstage-files’) +‘C-c f u’ (‘magit-file-unstage’) ‘C-c f , x’ (‘magit-file-untrack’) ‘C-c f , r’ (‘magit-file-rename’) ‘C-c f , k’ (‘magit-file-delete’) @@ -7754,14 +7849,14 @@ all, add this to your init file and restart Emacs. This transient prefix command binds the following suffix commands and displays them in a temporary buffer until a suffix is invoked. -‘C-c M-g s’ (‘magit-stage-file’) -‘C-c M-g s’ (‘magit-stage-buffer-file’) +‘C-c M-g s’ (‘magit-stage-files’) +‘C-c M-g s’ (‘magit-file-stage’) Stage all changes to the file being visited in the current buffer. When not visiting a file, then the first command is used, which prompts for a file. -‘C-c M-g u’ (‘magit-unstage-file’) -‘C-c M-g u’ (‘magit-unstage-buffer-file’) +‘C-c M-g u’ (‘magit-unstage-files’) +‘C-c M-g u’ (‘magit-file-unstage’) Unstage all changes to the file being visited in the current buffer. When not visiting a file, then the first command is used, which prompts for a file. @@ -9455,10 +9550,10 @@ Appendix C Keystroke Index * ! S: Running Git. (line 110) * $: Running Git. (line 20) * +: Logging. (line 160) -* + <1>: Diffing. (line 154) +* + <1>: Diffing. (line 190) * -: Logging. (line 163) -* - <1>: Diffing. (line 151) -* 0: Diffing. (line 157) +* - <1>: Diffing. (line 187) +* 0: Diffing. (line 193) * 1: Sections. (line 173) * 2: Sections. (line 173) * 3: Sections. (line 173) @@ -9487,7 +9582,7 @@ Appendix C Keystroke Index * B: Bisecting. (line 9) * b: Blaming. (line 115) * b <1>: Branching. (line 63) -* b <2>: Rebasing. (line 211) +* b <2>: Rebasing. (line 216) * B B: Bisecting. (line 16) * B b: Bisecting. (line 32) * b b: Branching. (line 97) @@ -9508,7 +9603,7 @@ Appendix C Keystroke Index * c: Blaming. (line 141) * C: Cloning Repository. (line 20) * c <1>: Committing. (line 21) -* c <2>: Rebasing. (line 200) +* c <2>: Rebasing. (line 205) * C >: Cloning Repository. (line 38) * c a: Committing. (line 59) * c A: Committing. (line 141) @@ -9532,25 +9627,25 @@ Appendix C Keystroke Index * C-: Sections. (line 148) * C-c C-a: Committing. (line 415) * C-c C-b: Logging. (line 116) -* C-c C-b <1>: Diffing. (line 173) +* C-c C-b <1>: Diffing. (line 209) * C-c C-c: Logging. (line 297) * C-c C-c <1>: Committing. (line 303) -* C-c C-c <2>: Rebasing. (line 123) -* C-c C-d: Diffing. (line 164) +* C-c C-c <2>: Rebasing. (line 128) +* C-c C-d: Diffing. (line 200) * C-c C-d <1>: Committing. (line 339) -* C-c C-e: Diffing. (line 199) +* C-c C-e: Diffing. (line 235) * C-c C-f: Logging. (line 119) -* C-c C-f <1>: Diffing. (line 176) +* C-c C-f <1>: Diffing. (line 212) * C-c C-i: Committing. (line 412) * C-c C-k: Logging. (line 302) * C-c C-k <1>: Committing. (line 307) -* C-c C-k <2>: Rebasing. (line 127) +* C-c C-k <2>: Rebasing. (line 132) * C-c C-n: Logging. (line 122) * C-c C-o: Committing. (line 427) * C-c C-p: Committing. (line 430) * C-c C-r: Committing. (line 418) * C-c C-s: Committing. (line 421) -* C-c C-t: Diffing. (line 190) +* C-c C-t: Diffing. (line 226) * C-c C-t <1>: Committing. (line 424) * C-c C-w: Committing. (line 347) * C-c f: Commands for Buffers Visiting Files. @@ -9688,31 +9783,32 @@ Appendix C Keystroke Index * C-w: Common Commands. (line 22) * C-x g: Status Buffer. (line 23) * C-x M-g: Transient Commands. (line 20) -* C-x u: Rebasing. (line 218) +* C-x u: Rebasing. (line 223) * d: Diffing. (line 22) * D: Diffing. (line 105) * d c: Diffing. (line 82) * d d: Diffing. (line 27) -* D f: Diffing. (line 134) -* D F: Diffing. (line 138) +* D f: Diffing. (line 170) +* D F: Diffing. (line 174) * D g: Diffing. (line 110) * d p: Diffing. (line 75) * d r: Diffing. (line 49) -* D r: Diffing. (line 130) +* D r: Diffing. (line 166) * d s: Diffing. (line 67) * D s: Diffing. (line 114) * d t: Diffing. (line 86) * D t: Diffing. (line 127) +* D T: Diffing. (line 146) * d u: Diffing. (line 72) * d w: Diffing. (line 62) * D w: Diffing. (line 120) * DEL: Logging. (line 146) -* DEL <1>: Diffing. (line 231) +* DEL <1>: Diffing. (line 267) * DEL <2>: Blaming. (line 103) -* DEL <3>: Rebasing. (line 141) +* DEL <3>: Rebasing. (line 146) * e: Ediffing. (line 10) * E: Ediffing. (line 21) -* e <1>: Rebasing. (line 162) +* e <1>: Rebasing. (line 167) * E c: Ediffing. (line 100) * E i: Ediffing. (line 94) * E m: Ediffing. (line 33) @@ -9724,8 +9820,8 @@ Appendix C Keystroke Index * E w: Ediffing. (line 97) * E z: Ediffing. (line 103) * f: Repository List. (line 112) -* f <1>: Rebasing. (line 179) -* F: Rebasing. (line 184) +* f <1>: Rebasing. (line 184) +* F: Rebasing. (line 189) * f <2>: Fetching. (line 10) * F <1>: Pulling. (line 10) * f a: Fetching. (line 45) @@ -9745,16 +9841,16 @@ Appendix C Keystroke Index * H: Sections. (line 350) * I: Creating Repository. (line 7) * j: Logging. (line 127) -* j <1>: Diffing. (line 218) +* j <1>: Diffing. (line 254) * k: Running Git. (line 27) * k <1>: Applying. (line 40) -* k <2>: Rebasing. (line 196) +* k <2>: Rebasing. (line 201) * k <3>: Stashing. (line 114) * l: Logging. (line 28) * L: Logging. (line 75) * L <1>: Logging. (line 103) * L <2>: Logging. (line 263) -* l <1>: Rebasing. (line 235) +* l <1>: Rebasing. (line 240) * l a: Logging. (line 59) * l b: Logging. (line 56) * L d: Logging. (line 277) @@ -9775,21 +9871,21 @@ Appendix C Keystroke Index * m: Repository List. (line 106) * m <1>: Merging. (line 10) * M: Remotes. (line 17) -* m a: Merging. (line 42) -* m a <1>: Merging. (line 91) +* m a: Merging. (line 46) +* m a <1>: Merging. (line 97) * M a: Remotes. (line 51) * M C: Remotes. (line 35) -* m d: Merging. (line 54) -* m e: Merging. (line 30) +* m d: Merging. (line 60) +* m e: Merging. (line 32) * M k: Remotes. (line 63) * m m: Merging. (line 18) -* m m <1>: Merging. (line 86) -* m n: Merging. (line 36) -* m p: Merging. (line 75) +* m m <1>: Merging. (line 92) +* m n: Merging. (line 40) +* m p: Merging. (line 81) * M p: Remotes. (line 66) * M P: Remotes. (line 70) * M r: Remotes. (line 55) -* m s: Merging. (line 67) +* m s: Merging. (line 73) * M u: Remotes. (line 59) * M-1: Sections. (line 179) * M-2: Sections. (line 179) @@ -9798,18 +9894,18 @@ Appendix C Keystroke Index * M-: Sections. (line 163) * M-n: Sections. (line 46) * M-n <1>: Committing. (line 326) -* M-n <2>: Rebasing. (line 156) +* M-n <2>: Rebasing. (line 161) * M-p: Sections. (line 41) * M-p <1>: Committing. (line 321) -* M-p <2>: Rebasing. (line 153) +* M-p <2>: Rebasing. (line 158) * M-w: Blaming. (line 134) * M-w <1>: Common Commands. (line 39) -* MM: Rebasing. (line 243) -* Mt: Rebasing. (line 249) +* MM: Rebasing. (line 248) +* Mt: Rebasing. (line 254) * n: Sections. (line 38) * n <1>: Blaming. (line 118) * N: Blaming. (line 121) -* n <2>: Rebasing. (line 150) +* n <2>: Rebasing. (line 155) * n <3>: Minor Mode for Buffers Visiting Blobs. (line 17) * o: Submodules. (line 56) @@ -9833,7 +9929,7 @@ Appendix C Keystroke Index * p: Sections. (line 33) * p <1>: Blaming. (line 124) * P: Blaming. (line 127) -* p <2>: Rebasing. (line 147) +* p <2>: Rebasing. (line 152) * P <1>: Pushing. (line 10) * p <3>: Minor Mode for Buffers Visiting Blobs. (line 13) @@ -9852,38 +9948,38 @@ Appendix C Keystroke Index * q <3>: Minor Mode for Buffers Visiting Blobs. (line 20) * r: Rebasing. (line 10) -* r <1>: Rebasing. (line 159) -* r a: Rebasing. (line 116) +* r <1>: Rebasing. (line 164) +* r a: Rebasing. (line 121) * r e: Rebasing. (line 42) -* r e <1>: Rebasing. (line 112) -* r f: Rebasing. (line 79) -* r i: Rebasing. (line 76) -* r k: Rebasing. (line 96) -* r m: Rebasing. (line 88) +* r e <1>: Rebasing. (line 117) +* r f: Rebasing. (line 84) +* r i: Rebasing. (line 81) +* r k: Rebasing. (line 101) +* r m: Rebasing. (line 93) * r p: Rebasing. (line 28) -* r r: Rebasing. (line 102) +* r r: Rebasing. (line 107) * r s: Rebasing. (line 47) -* r s <1>: Rebasing. (line 108) +* r s <1>: Rebasing. (line 113) * r u: Rebasing. (line 35) -* r w: Rebasing. (line 92) +* r w: Rebasing. (line 97) * RET: Repository List. (line 103) * RET <1>: References Buffer. (line 159) * RET <2>: Visiting Files and Blobs. (line 41) * RET <3>: Blaming. (line 91) -* RET <4>: Rebasing. (line 131) +* RET <4>: Rebasing. (line 136) * s: Staging and Unstaging. (line 29) * S: Staging and Unstaging. (line 36) -* s <1>: Rebasing. (line 165) -* S <1>: Rebasing. (line 170) +* s <1>: Rebasing. (line 170) +* S <1>: Rebasing. (line 175) * S-: Sections. (line 167) * SPC: Logging. (line 137) -* SPC <1>: Diffing. (line 228) +* SPC <1>: Diffing. (line 264) * SPC <2>: Blaming. (line 94) -* SPC <3>: Rebasing. (line 135) -* t: Rebasing. (line 238) +* SPC <3>: Rebasing. (line 140) +* t: Rebasing. (line 243) * t <1>: Tagging. (line 9) * T: Notes. (line 9) * T a: Notes. (line 47) @@ -9920,7 +10016,7 @@ Appendix C Keystroke Index * w s: Maildir Patches. (line 34) * w w: Maildir Patches. (line 14) * w w <1>: Maildir Patches. (line 31) -* x: Rebasing. (line 203) +* x: Rebasing. (line 208) * x <1>: Resetting. (line 9) * X f: Resetting. (line 44) * X h: Resetting. (line 24) @@ -9932,7 +10028,7 @@ Appendix C Keystroke Index * X w <1>: Wip Modes. (line 59) * Y: Logging. (line 382) * y: References Buffer. (line 7) -* y <1>: Rebasing. (line 215) +* y <1>: Rebasing. (line 220) * y c: References Buffer. (line 25) * y o: References Buffer. (line 30) * y r: References Buffer. (line 34) @@ -9970,7 +10066,7 @@ Appendix D Function and Command Index * Menu: * bug-reference-mode: Committing. (line 481) -* forward-line: Rebasing. (line 150) +* forward-line: Rebasing. (line 155) * git-commit-ack: Committing. (line 415) * git-commit-cc: Committing. (line 427) * git-commit-check-style-conventions: Committing. (line 533) @@ -9988,28 +10084,28 @@ Appendix D Function and Command Index * git-commit-test: Committing. (line 424) * git-commit-turn-on-auto-fill: Committing. (line 466) * git-commit-turn-on-flyspell: Committing. (line 469) -* git-rebase-alter: Rebasing. (line 184) -* git-rebase-backward-line: Rebasing. (line 147) -* git-rebase-break: Rebasing. (line 211) -* git-rebase-edit: Rebasing. (line 162) -* git-rebase-exec: Rebasing. (line 203) -* git-rebase-fixup: Rebasing. (line 179) -* git-rebase-insert: Rebasing. (line 215) -* git-rebase-kill-line: Rebasing. (line 196) -* git-rebase-label: Rebasing. (line 235) -* git-rebase-merge: Rebasing. (line 243) -* git-rebase-merge-toggle-editmsg: Rebasing. (line 249) -* git-rebase-move-line-down: Rebasing. (line 156) -* git-rebase-move-line-up: Rebasing. (line 153) -* git-rebase-pick: Rebasing. (line 200) -* git-rebase-reset: Rebasing. (line 238) -* git-rebase-reword: Rebasing. (line 159) -* git-rebase-show-commit: Rebasing. (line 131) -* git-rebase-show-or-scroll-down: Rebasing. (line 141) -* git-rebase-show-or-scroll-up: Rebasing. (line 135) -* git-rebase-squash: Rebasing. (line 165) -* git-rebase-squish: Rebasing. (line 170) -* git-rebase-undo: Rebasing. (line 218) +* git-rebase-alter: Rebasing. (line 189) +* git-rebase-backward-line: Rebasing. (line 152) +* git-rebase-break: Rebasing. (line 216) +* git-rebase-edit: Rebasing. (line 167) +* git-rebase-exec: Rebasing. (line 208) +* git-rebase-fixup: Rebasing. (line 184) +* git-rebase-insert: Rebasing. (line 220) +* git-rebase-kill-line: Rebasing. (line 201) +* git-rebase-label: Rebasing. (line 240) +* git-rebase-merge: Rebasing. (line 248) +* git-rebase-merge-toggle-editmsg: Rebasing. (line 254) +* git-rebase-move-line-down: Rebasing. (line 161) +* git-rebase-move-line-up: Rebasing. (line 158) +* git-rebase-pick: Rebasing. (line 205) +* git-rebase-reset: Rebasing. (line 243) +* git-rebase-reword: Rebasing. (line 164) +* git-rebase-show-commit: Rebasing. (line 136) +* git-rebase-show-or-scroll-down: Rebasing. (line 146) +* git-rebase-show-or-scroll-up: Rebasing. (line 140) +* git-rebase-squash: Rebasing. (line 170) +* git-rebase-squish: Rebasing. (line 175) +* git-rebase-undo: Rebasing. (line 223) * magit-add-section-hook: Sections. (line 310) * magit-after-save-refresh-status: Modes and Buffers. (line 294) * magit-am: Maildir Patches. (line 9) @@ -10153,12 +10249,12 @@ Appendix D Function and Command Index (line 52) * magit-diff-buffer-file <1>: Commands for Buffers Visiting Files. (line 101) -* magit-diff-default-context: Diffing. (line 157) +* magit-diff-default-context: Diffing. (line 193) * magit-diff-dwim: Diffing. (line 27) -* magit-diff-edit-hunk-commit: Diffing. (line 199) -* magit-diff-flip-revs: Diffing. (line 134) -* magit-diff-less-context: Diffing. (line 151) -* magit-diff-more-context: Diffing. (line 154) +* magit-diff-edit-hunk-commit: Diffing. (line 235) +* magit-diff-flip-revs: Diffing. (line 170) +* magit-diff-less-context: Diffing. (line 187) +* magit-diff-more-context: Diffing. (line 190) * magit-diff-paths: Diffing. (line 75) * magit-diff-range: Diffing. (line 49) * magit-diff-refresh: Diffing. (line 105) @@ -10171,10 +10267,11 @@ Appendix D Function and Command Index * magit-diff-show-or-scroll-up: Logging. (line 137) * magit-diff-show-or-scroll-up <1>: Blaming. (line 94) * magit-diff-staged: Diffing. (line 67) -* magit-diff-switch-range-type: Diffing. (line 130) -* magit-diff-toggle-file-filter: Diffing. (line 138) +* magit-diff-switch-range-type: Diffing. (line 166) +* magit-diff-toggle-file-filter: Diffing. (line 174) +* magit-diff-toggle-fontify-hunk: Diffing. (line 146) * magit-diff-toggle-refine-hunk: Diffing. (line 127) -* magit-diff-trace-definition: Diffing. (line 190) +* magit-diff-trace-definition: Diffing. (line 226) * magit-diff-type: Section Plumbing. (line 206) * magit-diff-unstaged: Diffing. (line 72) * magit-diff-visit-file: Visiting Files and Blobs. @@ -10189,7 +10286,7 @@ Appendix D Function and Command Index (line 87) * magit-diff-visit-worktree-file-other-window: Visiting Files and Blobs. (line 86) -* magit-diff-while-committing: Diffing. (line 164) +* magit-diff-while-committing: Diffing. (line 200) * magit-diff-while-committing <1>: Committing. (line 339) * magit-diff-working-tree: Diffing. (line 62) * magit-disable-section-inserter: Per-Repository Configuration. @@ -10252,6 +10349,14 @@ Appendix D Function and Command Index (line 52) * magit-file-rename <1>: Commands for Buffers Visiting Files. (line 78) +* magit-file-stage: Commands for Buffers Visiting Files. + (line 52) +* magit-file-stage <1>: Commands for Buffers Visiting Files. + (line 63) +* magit-file-unstage: Commands for Buffers Visiting Files. + (line 52) +* magit-file-unstage <1>: Commands for Buffers Visiting Files. + (line 69) * magit-file-untrack: Commands for Buffers Visiting Files. (line 52) * magit-file-untrack <1>: Commands for Buffers Visiting Files. @@ -10286,9 +10391,9 @@ Appendix D Function and Command Index * magit-git-true: Calling Git. (line 48) * magit-git-wash: Calling Git. (line 160) * magit-go-backward: Logging. (line 116) -* magit-go-backward <1>: Diffing. (line 173) +* magit-go-backward <1>: Diffing. (line 209) * magit-go-forward: Logging. (line 119) -* magit-go-forward <1>: Diffing. (line 176) +* magit-go-forward <1>: Diffing. (line 212) * magit-hunk-set-window-start: Sections. (line 69) * magit-init: Creating Repository. (line 7) * magit-insert-am-sequence: Status Buffer. (line 128) @@ -10338,7 +10443,7 @@ Appendix D Function and Command Index * magit-insert-untracked-files: Status Buffer. (line 187) * magit-insert-upstream-branch-header: Status Buffer. (line 315) * magit-insert-user-header: Status Buffer. (line 339) -* magit-jump-to-diffstat-or-diff: Diffing. (line 218) +* magit-jump-to-diffstat-or-diff: Diffing. (line 254) * magit-list-repositories: Repository List. (line 6) * magit-list-submodules: Submodules. (line 18) * magit-list-submodules <1>: Submodules. (line 97) @@ -10385,15 +10490,15 @@ Appendix D Function and Command Index * magit-margin-settings: Logging. (line 263) * magit-maybe-set-dedicated: Modes and Buffers. (line 121) * magit-merge: Merging. (line 10) -* magit-merge <1>: Merging. (line 86) -* magit-merge-abort: Merging. (line 91) -* magit-merge-absorb: Merging. (line 42) -* magit-merge-dissolve: Merging. (line 54) -* magit-merge-editmsg: Merging. (line 30) -* magit-merge-nocommit: Merging. (line 36) +* magit-merge <1>: Merging. (line 92) +* magit-merge-abort: Merging. (line 97) +* magit-merge-absorb: Merging. (line 46) +* magit-merge-dissolve: Merging. (line 60) +* magit-merge-editmsg: Merging. (line 32) +* magit-merge-nocommit: Merging. (line 40) * magit-merge-plain: Merging. (line 18) -* magit-merge-preview: Merging. (line 75) -* magit-merge-squash: Merging. (line 67) +* magit-merge-preview: Merging. (line 81) +* magit-merge-squash: Merging. (line 73) * magit-mode-bury-buffer: Modes and Buffers. (line 206) * magit-mode-display-buffer: Refreshing Buffers. (line 32) * magit-mode-quit-window: Modes and Buffers. (line 233) @@ -10432,18 +10537,18 @@ Appendix D Function and Command Index * magit-push-tags: Pushing. (line 52) * magit-push-to-remote: Pushing. (line 91) * magit-rebase: Rebasing. (line 10) -* magit-rebase-abort: Rebasing. (line 116) -* magit-rebase-autosquash: Rebasing. (line 79) +* magit-rebase-abort: Rebasing. (line 121) +* magit-rebase-autosquash: Rebasing. (line 84) * magit-rebase-branch: Rebasing. (line 42) -* magit-rebase-continue: Rebasing. (line 102) -* magit-rebase-edit: Rebasing. (line 112) -* magit-rebase-edit-commit: Rebasing. (line 88) -* magit-rebase-interactive: Rebasing. (line 76) +* magit-rebase-continue: Rebasing. (line 107) +* magit-rebase-edit: Rebasing. (line 117) +* magit-rebase-edit-commit: Rebasing. (line 93) +* magit-rebase-interactive: Rebasing. (line 81) * magit-rebase-onto-pushremote: Rebasing. (line 28) * magit-rebase-onto-upstream: Rebasing. (line 35) -* magit-rebase-remove-commit: Rebasing. (line 96) -* magit-rebase-reword-commit: Rebasing. (line 92) -* magit-rebase-skip: Rebasing. (line 108) +* magit-rebase-remove-commit: Rebasing. (line 101) +* magit-rebase-reword-commit: Rebasing. (line 97) +* magit-rebase-skip: Rebasing. (line 113) * magit-rebase-subset: Rebasing. (line 47) * magit-reflog-current: Logging. (line 336) * magit-reflog-head: Logging. (line 342) @@ -10563,15 +10668,11 @@ Appendix D Function and Command Index * magit-sparse-checkout-set: Sparse checkouts. (line 33) * magit-stage: Staging and Unstaging. (line 29) -* magit-stage-buffer-file: Commands for Buffers Visiting Files. - (line 52) -* magit-stage-buffer-file <1>: Commands for Buffers Visiting Files. - (line 63) -* magit-stage-file: Staging and Unstaging. +* magit-stage-files: Staging and Unstaging. (line 90) -* magit-stage-file <1>: Commands for Buffers Visiting Files. +* magit-stage-files <1>: Commands for Buffers Visiting Files. (line 52) -* magit-stage-file <2>: Commands for Buffers Visiting Files. +* magit-stage-files <2>: Commands for Buffers Visiting Files. (line 63) * magit-stage-modified: Staging and Unstaging. (line 36) @@ -10641,15 +10742,11 @@ Appendix D Function and Command Index (line 42) * magit-unstage-all: Staging and Unstaging. (line 50) -* magit-unstage-buffer-file: Commands for Buffers Visiting Files. - (line 52) -* magit-unstage-buffer-file <1>: Commands for Buffers Visiting Files. - (line 69) -* magit-unstage-file: Staging and Unstaging. +* magit-unstage-files: Staging and Unstaging. (line 97) -* magit-unstage-file <1>: Commands for Buffers Visiting Files. +* magit-unstage-files <1>: Commands for Buffers Visiting Files. (line 52) -* magit-unstage-file <2>: Commands for Buffers Visiting Files. +* magit-unstage-files <2>: Commands for Buffers Visiting Files. (line 69) * magit-version: Running Git. (line 195) * magit-version <1>: Debugging Tools. (line 11) @@ -10663,13 +10760,13 @@ Appendix D Function and Command Index * magit-worktree-delete: Worktree. (line 22) * magit-worktree-move: Worktree. (line 19) * magit-worktree-status: Worktree. (line 26) -* scroll-down: Diffing. (line 231) -* scroll-up: Diffing. (line 228) +* scroll-down: Diffing. (line 267) +* scroll-up: Diffing. (line 264) * with-editor-cancel: Committing. (line 307) -* with-editor-cancel <1>: Rebasing. (line 127) +* with-editor-cancel <1>: Rebasing. (line 132) * with-editor-debug: Debugging Tools. (line 85) * with-editor-finish: Committing. (line 303) -* with-editor-finish <1>: Rebasing. (line 123) +* with-editor-finish <1>: Rebasing. (line 128) * with-editor-usage-message: Committing. (line 484)  @@ -10702,9 +10799,9 @@ Appendix E Variable Index * git-commit-setup-hook: Committing. (line 454) * git-commit-style-convention-checks: Committing. (line 538) * git-commit-summary-max-length: Committing. (line 513) -* git-rebase-auto-advance: Rebasing. (line 221) -* git-rebase-confirm-cancel: Rebasing. (line 227) -* git-rebase-show-instructions: Rebasing. (line 224) +* git-rebase-auto-advance: Rebasing. (line 226) +* git-rebase-confirm-cancel: Rebasing. (line 232) +* git-rebase-show-instructions: Rebasing. (line 229) * global-auto-revert-mode: Modes and Buffers. (line 343) * magit-auto-revert-immediately: Modes and Buffers. (line 352) * magit-auto-revert-mode: Modes and Buffers. (line 339) @@ -10738,19 +10835,22 @@ Appendix E Variable Index * magit-completing-read-function: Completion Confirmation and the Selection. (line 340) * magit-define-global-key-bindings: Essential Settings. (line 239) -* magit-diff-adjust-tab-width: Diffing. (line 250) +* magit-diff-adjust-tab-width: Diffing. (line 319) * magit-diff-buffer-file-locked: Commands for Buffers Visiting Files. (line 104) -* magit-diff-extra-stat-arguments: Diffing. (line 345) -* magit-diff-hide-trailing-cr-characters: Diffing. (line 310) -* magit-diff-highlight-hunk-region-functions: Diffing. (line 313) -* magit-diff-highlight-indentation: Diffing. (line 296) -* magit-diff-highlight-trailing: Diffing. (line 292) -* magit-diff-paint-whitespace: Diffing. (line 271) -* magit-diff-paint-whitespace-lines: Diffing. (line 285) -* magit-diff-refine-hunk: Diffing. (line 236) -* magit-diff-refine-ignore-whitespace: Diffing. (line 246) -* magit-diff-unmarked-lines-keep-foreground: Diffing. (line 338) +* magit-diff-extra-stat-arguments: Diffing. (line 414) +* magit-diff-fontify-hunk: Diffing. (line 286) +* magit-diff-hide-trailing-cr-characters: Diffing. (line 379) +* magit-diff-highlight-hunk-region-functions: Diffing. (line 382) +* magit-diff-highlight-indentation: Diffing. (line 365) +* magit-diff-highlight-trailing: Diffing. (line 361) +* magit-diff-paint-whitespace: Diffing. (line 340) +* magit-diff-paint-whitespace-lines: Diffing. (line 354) +* magit-diff-refine-hunk: Diffing. (line 272) +* magit-diff-refine-ignore-whitespace: Diffing. (line 282) +* magit-diff-specify-hunk-foreground: Diffing. (line 307) +* magit-diff-unmarked-lines-keep-foreground: Diffing. (line 407) +* magit-diff-use-indicator-faces: Diffing. (line 312) * magit-diff-visit-prefer-worktree: Visiting Files and Blobs. (line 92) * magit-diff-visit-previous-blob: Visiting Files and Blobs. @@ -10765,7 +10865,7 @@ Appendix E Variable Index * magit-ediff-dwim-show-on-hunks: Ediffing. (line 111) * magit-ediff-quit-hook: Ediffing. (line 124) * magit-ediff-show-stash-with-index: Ediffing. (line 118) -* magit-format-file-function: Diffing. (line 355) +* magit-format-file-function: Diffing. (line 424) * magit-generate-buffer-name-function: Modes and Buffers. (line 131) * magit-git-debug: Calling Git. (line 95) * magit-git-executable: Running Git. (line 162) @@ -10784,7 +10884,7 @@ Appendix E Variable Index * magit-log-show-color-graph-limit: Logging. (line 174) * magit-log-show-refname-after-summary: Logging. (line 170) * magit-log-show-signatures-limit: Logging. (line 180) -* magit-log-trace-definition-function: Diffing. (line 192) +* magit-log-trace-definition-function: Diffing. (line 228) * magit-module-sections-hook: Status Buffer. (line 358) * magit-module-sections-nested: Status Buffer. (line 361) * magit-no-confirm: Completion Confirmation and the Selection. @@ -10818,10 +10918,10 @@ Appendix E Variable Index * magit-remote-git-executable: Running Git. (line 168) * magit-repolist-columns: Repository List. (line 12) * magit-repository-directories: Status Buffer. (line 57) -* magit-revision-filter-files-on-follow: Diffing. (line 415) -* magit-revision-insert-related-refs: Diffing. (line 366) -* magit-revision-show-gravatars: Diffing. (line 375) -* magit-revision-use-hash-sections: Diffing. (line 391) +* magit-revision-filter-files-on-follow: Diffing. (line 484) +* magit-revision-insert-related-refs: Diffing. (line 435) +* magit-revision-show-gravatars: Diffing. (line 444) +* magit-revision-use-hash-sections: Diffing. (line 460) * magit-root-section: Section Plumbing. (line 199) * magit-save-repository-buffers: Modes and Buffers. (line 314) * magit-section-cache-visibility: Sections. (line 229) @@ -10851,6 +10951,7 @@ Appendix E Variable Index * notes.displayRef: Notes. (line 57) * pull.rebase: Branching. (line 373) * remote.NAME.fetch: Remotes. (line 108) +* remote.NAME.followRemoteHEAD: Remotes. (line 128) * remote.NAME.push: Remotes. (line 117) * remote.NAME.pushurl: Remotes. (line 112) * remote.NAME.tagOpts: Remotes. (line 121) @@ -10916,127 +11017,127 @@ Ref: Reflog135168 Ref: Cherries136721 Node: Diffing138499 Ref: Refreshing Diffs142450 -Ref: Commands Available in Diffs146044 -Ref: Diff Options148441 -Ref: Revision Buffer154449 -Node: Ediffing157719 -Node: References Buffer163775 -Ref: References Sections174358 -Node: Bisecting175143 -Node: Visiting Files and Blobs177454 -Ref: General-Purpose Visit Commands177896 -Ref: Visiting Files and Blobs from a Diff178714 -Node: Blaming183968 -Node: Manipulating190956 -Node: Creating Repository191298 -Node: Cloning Repository191835 -Node: Staging and Unstaging198276 -Ref: Staging from File-Visiting Buffers202206 -Node: Applying203221 -Node: Committing205294 -Ref: Initiating a Commit205921 -Ref: Creating a new commit206233 -Ref: Editing the last commit206343 -Ref: Editing any reachable commit208322 -Ref: Editing any reachable commit and rebasing immediately212735 -Ref: Options used by commit commands214383 -Ref: Used by all or most commit commands214455 -Ref: Used by all squash and fixup commands216686 -Ref: Used by specific commit commands217240 -Ref: Editing Commit Messages217564 -Ref: Using the Revision Stack220118 -Ref: Commit Pseudo Headers223080 -Ref: Commit Mode and Hooks224232 -Ref: Commit Message Conventions226945 -Node: Branching228835 -Ref: The Two Remotes228956 -Ref: Branch Commands231525 -Ref: Branch Git Variables244275 -Ref: Auxiliary Branch Commands249522 -Node: Merging250539 -Node: Resolving Conflicts254699 -Node: Rebasing260073 -Ref: Editing Rebase Sequences265033 -Ref: Information About In-Progress Rebase270266 -Ref: Rebasing-Footnote-1279266 -Node: Cherry Picking279862 -Ref: Reverting284172 -Node: Resetting285532 -Node: Stashing287358 -Node: Transferring293605 -Node: Remotes293827 -Ref: Remote Commands293924 -Ref: Remote Git Variables297876 -Node: Fetching299060 -Node: Pulling301543 -Node: Pushing302569 -Node: Plain Patches306860 -Node: Maildir Patches308331 -Node: Miscellaneous309810 -Node: Tagging310156 -Node: Notes312049 -Node: Submodules314384 -Ref: Listing Submodules314545 -Ref: Submodule Transient316612 -Node: Subtree318971 -Node: Worktree320902 -Node: Sparse checkouts322217 -Node: Bundle324993 -Node: Common Commands325368 -Node: Wip Modes327996 -Ref: Wip Graph332574 -Node: Commands for Buffers Visiting Files335013 -Node: Minor Mode for Buffers Visiting Blobs343354 -Node: Customizing344517 -Node: Per-Repository Configuration346113 -Node: Essential Settings348367 -Ref: Safety348656 -Ref: Performance350337 -Ref: Log Performance353130 -Ref: Diff Performance354435 -Ref: Refs Buffer Performance355776 -Ref: Committing Performance356351 -Ref: Microsoft Windows Performance357333 -Ref: MacOS Performance358422 -Ref: Global Bindings359307 -Ref: Essential Settings-Footnote-1361482 -Node: Plumbing361564 -Node: Calling Git362393 -Ref: Getting a Value from Git363852 -Ref: Calling Git for Effect367484 -Node: Section Plumbing373429 -Ref: Creating Sections373581 -Ref: Section Selection377399 -Ref: Matching Sections379098 -Node: Refreshing Buffers385012 -Node: Conventions388156 -Ref: Theming Faces388320 -Node: FAQ396365 -Node: FAQ - How to ...?396803 -Ref: How to pronounce Magit?396936 -Ref: How to show git's output?397630 -Ref: How to install the gitman info manual?398255 -Ref: How to show diffs for gpg-encrypted files?399066 -Ref: How does branching and pushing work?399475 -Ref: Should I disable VC?399639 -Node: FAQ - Issues and Errors400124 -Ref: Magit is slow400269 -Ref: I changed several thousand files at once and now Magit is unusable400415 -Ref: I am having problems committing400954 -Ref: I am using MS Windows and cannot push with Magit401219 -Ref: I am using macOS and SOMETHING works in shell but not in Magit401619 -Ref: Expanding a file to show the diff causes it to disappear402210 -Ref: Point is wrong in the COMMIT_EDITMSG buffer402560 -Ref: The mode-line information isn't always up-to-date403384 -Ref: A branch and tag sharing the same name breaks SOMETHING404223 -Ref: My Git hooks work on the command-line but not inside Magit404871 -Ref: git-commit-mode isn't used when committing from the command-line405463 -Ref: Point ends up inside invisible text when jumping to a file-visiting buffer407461 -Ref: I am no longer able to save popup defaults408053 -Node: Debugging Tools408848 -Node: Keystroke Index412787 -Node: Function and Command Index450883 -Node: Variable Index502455 +Ref: Commands Available in Diffs147734 +Ref: Diff Options150131 +Ref: Revision Buffer157644 +Node: Ediffing160914 +Node: References Buffer166970 +Ref: References Sections177553 +Node: Bisecting178338 +Node: Visiting Files and Blobs180649 +Ref: General-Purpose Visit Commands181091 +Ref: Visiting Files and Blobs from a Diff181909 +Node: Blaming187163 +Node: Manipulating194151 +Node: Creating Repository194493 +Node: Cloning Repository195030 +Node: Staging and Unstaging201471 +Ref: Staging from File-Visiting Buffers205401 +Node: Applying206418 +Node: Committing208491 +Ref: Initiating a Commit209118 +Ref: Creating a new commit209430 +Ref: Editing the last commit209540 +Ref: Editing any reachable commit211519 +Ref: Editing any reachable commit and rebasing immediately215932 +Ref: Options used by commit commands217580 +Ref: Used by all or most commit commands217652 +Ref: Used by all squash and fixup commands219883 +Ref: Used by specific commit commands220437 +Ref: Editing Commit Messages220761 +Ref: Using the Revision Stack223315 +Ref: Commit Pseudo Headers226277 +Ref: Commit Mode and Hooks227429 +Ref: Commit Message Conventions230142 +Node: Branching232032 +Ref: The Two Remotes232153 +Ref: Branch Commands234722 +Ref: Branch Git Variables247472 +Ref: Auxiliary Branch Commands252719 +Node: Merging253736 +Node: Resolving Conflicts258091 +Node: Rebasing263465 +Ref: Editing Rebase Sequences268664 +Ref: Information About In-Progress Rebase273897 +Ref: Rebasing-Footnote-1282897 +Node: Cherry Picking283493 +Ref: Reverting287803 +Node: Resetting289163 +Node: Stashing290989 +Node: Transferring297236 +Node: Remotes297458 +Ref: Remote Commands297555 +Ref: Remote Git Variables301507 +Node: Fetching303440 +Node: Pulling305923 +Node: Pushing306949 +Node: Plain Patches311240 +Node: Maildir Patches312711 +Node: Miscellaneous314190 +Node: Tagging314536 +Node: Notes316429 +Node: Submodules318764 +Ref: Listing Submodules318925 +Ref: Submodule Transient320992 +Node: Subtree323351 +Node: Worktree325282 +Node: Sparse checkouts326597 +Node: Bundle329373 +Node: Common Commands329748 +Node: Wip Modes332376 +Ref: Wip Graph336954 +Node: Commands for Buffers Visiting Files339393 +Node: Minor Mode for Buffers Visiting Blobs347710 +Node: Customizing348873 +Node: Per-Repository Configuration350469 +Node: Essential Settings352723 +Ref: Safety353012 +Ref: Performance354693 +Ref: Log Performance357486 +Ref: Diff Performance358791 +Ref: Refs Buffer Performance360132 +Ref: Committing Performance360707 +Ref: Microsoft Windows Performance361689 +Ref: MacOS Performance362778 +Ref: Global Bindings363663 +Ref: Essential Settings-Footnote-1365838 +Node: Plumbing365920 +Node: Calling Git366749 +Ref: Getting a Value from Git368208 +Ref: Calling Git for Effect371840 +Node: Section Plumbing377785 +Ref: Creating Sections377937 +Ref: Section Selection381755 +Ref: Matching Sections383454 +Node: Refreshing Buffers389368 +Node: Conventions392512 +Ref: Theming Faces392676 +Node: FAQ400721 +Node: FAQ - How to ...?401159 +Ref: How to pronounce Magit?401292 +Ref: How to show git's output?401986 +Ref: How to install the gitman info manual?402611 +Ref: How to show diffs for gpg-encrypted files?403422 +Ref: How does branching and pushing work?403831 +Ref: Should I disable VC?403995 +Node: FAQ - Issues and Errors404480 +Ref: Magit is slow404625 +Ref: I changed several thousand files at once and now Magit is unusable404771 +Ref: I am having problems committing405310 +Ref: I am using MS Windows and cannot push with Magit405575 +Ref: I am using macOS and SOMETHING works in shell but not in Magit405975 +Ref: Expanding a file to show the diff causes it to disappear406566 +Ref: Point is wrong in the COMMIT_EDITMSG buffer406916 +Ref: The mode-line information isn't always up-to-date407740 +Ref: A branch and tag sharing the same name breaks SOMETHING408579 +Ref: My Git hooks work on the command-line but not inside Magit409227 +Ref: git-commit-mode isn't used when committing from the command-line409819 +Ref: Point ends up inside invisible text when jumping to a file-visiting buffer411817 +Ref: I am no longer able to save popup defaults412409 +Node: Debugging Tools413204 +Node: Keystroke Index417143 +Node: Function and Command Index455312 +Node: Variable Index506957  End Tag Table diff --git a/elpa/magit-section-20260422.2206/README-elpa b/elpa/magit-section-20260422.2206/README-elpa new file mode 100644 index 00000000..d6b2ddde --- /dev/null +++ b/elpa/magit-section-20260422.2206/README-elpa @@ -0,0 +1,4 @@ +This package implements the main user interface of Magit — the +collapsible sections that make up its buffers. This package used +to be distributed as part of Magit but now it can also be used by +other packages that have nothing to do with Magit or Git. diff --git a/elpa/magit-section-20251220.917/dir b/elpa/magit-section-20260422.2206/dir similarity index 100% rename from elpa/magit-section-20251220.917/dir rename to elpa/magit-section-20260422.2206/dir diff --git a/elpa/magit-section-20251220.917/magit-section-autoloads.el b/elpa/magit-section-20260422.2206/magit-section-autoloads.el similarity index 91% rename from elpa/magit-section-20251220.917/magit-section-autoloads.el rename to elpa/magit-section-20260422.2206/magit-section-autoloads.el index aa1f445f..bcb384e1 100644 --- a/elpa/magit-section-20251220.917/magit-section-autoloads.el +++ b/elpa/magit-section-20260422.2206/magit-section-autoloads.el @@ -11,8 +11,8 @@ ;;; Generated autoloads from magit-section.el -(autoload 'magit-add-section-hook "magit-section" "\ -Add to the value of section hook HOOK the function FUNCTION. +(autoload 'magit-add-section-hook "magit-section" +"Add to the value of section hook HOOK the function FUNCTION. Add FUNCTION at the beginning of the hook list unless optional APPEND is non-nil, in which case FUNCTION is added at the end. @@ -39,8 +39,8 @@ should not be abused for other side-effects. To remove FUNCTION again use `remove-hook'. (fn HOOK FUNCTION &optional AT APPEND LOCAL)") -(autoload 'magit--handle-bookmark "magit-section" "\ -Open a bookmark created by `magit--make-bookmark'. +(autoload 'magit--handle-bookmark "magit-section" +"Open a bookmark created by `magit--make-bookmark'. Call the generic function `magit-bookmark-get-buffer-create' to get the appropriate buffer without displaying it. diff --git a/elpa/magit-section-20251220.917/magit-section-pkg.el b/elpa/magit-section-20260422.2206/magit-section-pkg.el similarity index 72% rename from elpa/magit-section-20251220.917/magit-section-pkg.el rename to elpa/magit-section-20260422.2206/magit-section-pkg.el index d23fa1fa..c4c84ccb 100644 --- a/elpa/magit-section-20251220.917/magit-section-pkg.el +++ b/elpa/magit-section-20260422.2206/magit-section-pkg.el @@ -1,14 +1,14 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "magit-section" "20251220.917" +(define-package "magit-section" "20260422.2206" "Sections for read-only buffers." '((emacs "28.1") (compat "30.1") - (cond-let "0.1") + (cond-let "0.2") (llama "1.0") (seq "2.24")) :url "https://github.com/magit/magit" - :commit "649b4c972151c0ee495876c0d4c8c13787614886" - :revdesc "649b4c972151" + :commit "569b9656d6a2c792b07d3980796c76b121c9737e" + :revdesc "569b9656d6a2" :keywords '("tools") :authors '(("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev")) :maintainers '(("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev"))) diff --git a/elpa/magit-section-20251220.917/magit-section.el b/elpa/magit-section-20260422.2206/magit-section.el similarity index 92% rename from elpa/magit-section-20251220.917/magit-section.el rename to elpa/magit-section-20260422.2206/magit-section.el index 48fae5f2..c0d7cbe4 100644 --- a/elpa/magit-section-20251220.917/magit-section.el +++ b/elpa/magit-section-20260422.2206/magit-section.el @@ -1,6 +1,6 @@ ;;; magit-section.el --- Sections for read-only buffers -*- lexical-binding:t; coding:utf-8 -*- -;; Copyright (C) 2008-2025 The Magit Project Contributors +;; Copyright (C) 2008-2026 The Magit Project Contributors ;; Author: Jonas Bernoulli ;; Maintainer: Jonas Bernoulli @@ -8,12 +8,12 @@ ;; Homepage: https://github.com/magit/magit ;; Keywords: tools -;; Package-Version: 20251220.917 -;; Package-Revision: 649b4c972151 +;; Package-Version: 20260422.2206 +;; Package-Revision: 569b9656d6a2 ;; Package-Requires: ( ;; (emacs "28.1") ;; (compat "30.1") -;; (cond-let "0.1") +;; (cond-let "0.2") ;; (llama "1.0") ;; (seq "2.24")) @@ -51,15 +51,10 @@ (require 'llama) ; For (##these ...) see M-x describe-function RET # # RET. (require 'subr-x) -;; For older Emacs releases we depend on an updated `seq' release from GNU -;; ELPA, for `seq-keep'. Unfortunately something else may require `seq' -;; before `package' had a chance to put this version on the `load-path'. -(when (and (featurep 'seq) - (not (fboundp 'seq-keep))) - (unload-feature 'seq 'force)) -(require 'seq) -;; Furthermore, by default `package' just silently refuses to upgrade. -(defconst magit--core-upgrade-instructions "\ +(defun magit--display-core-upgrade-instructions (package version) + (display-warning 'magit + (substitute-command-keys + (format "\ Magit requires `%s' >= %s, but due to bad defaults, Emacs' package manager, refuses to upgrade this and other built-in packages to higher releases @@ -87,13 +82,29 @@ reinstalling Magit. If you don't use the `package' package manager but still get this warning, then your chosen package manager likely has a -similar defect.") -(unless (fboundp 'seq-keep) - (display-warning 'magit (substitute-command-keys - (format magit--core-upgrade-instructions - 'seq "2.24" 'seq 'seq 'seq 'seq)) +similar defect." + package version package package package package)) :emergency)) +;; For older Emacs releases we depend on an updated `seq' release from GNU +;; ELPA, for `seq-keep'. Unfortunately something else may require `seq' +;; before `package' had a chance to put this version on the `load-path'. +(when (and (featurep 'seq) + (not (fboundp 'seq-keep))) + (unload-feature 'seq 'force)) +(require 'seq) +;; Furthermore, by default `package' just silently refuses to upgrade. +(unless (fboundp 'seq-keep) + (magit--display-core-upgrade-instructions 'seq "2.24")) + +;; Likewise, we require a recent `transient'. +(when (and (featurep 'transient) + (not (fboundp 'transient--string-pixel-width))) + (unload-feature 'transient 'force)) +(require 'transient) +(unless (fboundp 'transient--string-pixel-width) + (magit--display-core-upgrade-instructions 'transient "0.13")) + (require 'cursor-sensor) (require 'format-spec) @@ -106,7 +117,8 @@ similar defect.") 'magit-section-keep-region-overlay "Magit-Section 4.0.0") (make-obsolete-variable 'magit-section-visibility-indicator - 'magit-section-visibility-indicators "Magit-Section 4.5.0") + 'magit-section-visibility-indicators + "Magit-Section 4.5.0") ;;; Hooks @@ -817,33 +829,33 @@ the beginning of the current section." (user-error "No previous section") (let ((section (magit-current-section)) children) (cond - ((and (= (point) - (1- (oref section end))) - (setq children (oref section children))) - (magit-section-goto (car (last children)))) - ((and (oref section parent) - (not (= (point) - (oref section start)))) - (magit-section-goto section)) - (t - (let ((prev (car (magit-section-siblings section 'prev)))) - (if prev - (while (and (not (oref prev hidden)) - (setq children (oref prev children))) - (setq prev (car (last children)))) - (setq prev (oref section parent))) - (cond (prev - (magit-section-goto prev)) - ((oref section parent) - (user-error "No previous section")) - ;; Eob special cases. - ((not (get-text-property (1- (point)) 'invisible)) - (magit-section-goto -1)) - (t - (goto-char (previous-single-property-change - (1- (point)) 'invisible)) - (forward-line -1) - (magit-section-goto (magit-current-section)))))))))) + ((and (= (point) + (1- (oref section end))) + (setq children (oref section children))) + (magit-section-goto (car (last children)))) + ((and (oref section parent) + (not (= (point) + (oref section start)))) + (magit-section-goto section)) + (t + (let ((prev (car (magit-section-siblings section 'prev)))) + (if prev + (while (and (not (oref prev hidden)) + (setq children (oref prev children))) + (setq prev (car (last children)))) + (setq prev (oref section parent))) + (cond (prev + (magit-section-goto prev)) + ((oref section parent) + (user-error "No previous section")) + ;; Eob special cases. + ((not (get-text-property (1- (point)) 'invisible)) + (magit-section-goto -1)) + (t + (goto-char (previous-single-property-change + (1- (point)) 'invisible)) + (forward-line -1) + (magit-section-goto (magit-current-section)))))))))) (defun magit-section-up () "Move to the beginning of the parent section." @@ -885,10 +897,10 @@ If there is no previous sibling section, then move to the parent." (defun magit-section-goto (arg) "Run `magit-section-movement-hook'. See info node `(magit)Section Movement'." - (if (integerp arg) - (progn (forward-line arg) - (setq arg (magit-current-section))) - (goto-char (oref arg start))) + (cond ((integerp arg) + (forward-line arg) + (setq arg (magit-current-section))) + ((goto-char (oref arg start)))) (run-hook-with-args 'magit-section-movement-hook arg)) (defun magit-section-set-window-start (section) @@ -936,8 +948,8 @@ With a prefix argument also expand it." heading) (oset section hidden nil) (magit-section--opportunistic-wash section) (magit-section--opportunistic-paint section) - (when-let ((beg (oref section content))) - (remove-overlays beg (oref section end) 'invisible t)) + (when$ (oref section content) + (remove-overlays $ (oref section end) 'invisible t)) (magit-section-maybe-update-visibility-indicator section) (magit-section-maybe-cache-visibility section) (dolist (child (oref section children)) @@ -1442,19 +1454,19 @@ anything this time around. (oset obj hidden (let (set old) (cond - ((setq set (run-hook-with-args-until-success - 'magit-section-set-visibility-hook obj)) - (eq set 'hide)) - ((setq old (and (not magit-section-preserve-visibility) - magit-insert-section--oldroot - (magit-get-section - (magit-section-ident obj) - magit-insert-section--oldroot))) - (oref old hidden)) - ((setq set (magit-section-match-assoc - obj magit-section-initial-visibility-alist)) - (eq (if (functionp set) (funcall set obj) set) 'hide)) - (hide))))) + ((setq set (run-hook-with-args-until-success + 'magit-section-set-visibility-hook obj)) + (eq set 'hide)) + ((setq old (and (not magit-section-preserve-visibility) + magit-insert-section--oldroot + (magit-get-section + (magit-section-ident obj) + magit-insert-section--oldroot))) + (oref old hidden)) + ((setq set (magit-section-match-assoc + obj magit-section-initial-visibility-alist)) + (eq (if (functionp set) (funcall set obj) set) 'hide)) + (hide))))) (unless (oref obj keymap) (let ((type (oref obj type))) (oset obj keymap @@ -1471,24 +1483,24 @@ anything this time around. (oset obj end (point-marker)) (set-marker-insertion-type (oref obj start) t)) (cond - ((eq obj magit-root-section) - (when (eq magit-section-inhibit-markers 'delay) - (setq magit-section-inhibit-markers nil) - (magit-map-sections - (lambda (section) - (oset section start (copy-marker (oref section start) t)) - (oset section end (copy-marker (oref section end) t)))))) - (t - (magit-section--set-section-properties obj) - (magit-section-maybe-add-heading-map obj) - (when (oref obj children) - (magit-insert-child-count obj)) - (if magit-section-insert-in-reverse - (push obj (oref (oref obj parent) children)) - (let ((parent (oref obj parent))) - (oset parent children - (nconc (oref parent children) - (list obj))))))) + ((eq obj magit-root-section) + (when (eq magit-section-inhibit-markers 'delay) + (setq magit-section-inhibit-markers nil) + (magit-map-sections + (lambda (section) + (oset section start (copy-marker (oref section start) t)) + (oset section end (copy-marker (oref section end) t)))))) + (t + (magit-section--set-section-properties obj) + (magit-section-maybe-add-heading-map obj) + (when (oref obj children) + (magit-insert-child-count obj)) + (if magit-section-insert-in-reverse + (push obj (oref (oref obj parent) children)) + (let ((parent (oref obj parent))) + (oset parent children + (nconc (oref parent children) + (list obj))))))) (when magit-section-insert-in-reverse (oset obj children (nreverse (oref obj children))))) @@ -1665,24 +1677,24 @@ This function is called by `magit-insert-section' after that has evaluated its BODY. Admittedly that's a bit of a hack." (let (content count) (cond - ((not (and magit-section-show-child-count - (setq content (oref section content)) - (setq count (length (oref section children))) - (> count 0)))) - ((eq (char-before (- content 1)) ?:) - (save-excursion - (goto-char (- content 2)) - (insert (magit--propertize-face (format " (%s)" count) - 'magit-section-child-count)) - (delete-char 1))) - ((and (eq (char-before (- content 4)) ?\s) - (eq (char-before (- content 3)) ?\() - (eq (char-before (- content 2)) ?t ) - (eq (char-before (- content 1)) ?\))) - (save-excursion - (goto-char (- content 3)) - (delete-char 1) - (insert (format "%s" count))))))) + ((not (and magit-section-show-child-count + (setq content (oref section content)) + (setq count (length (oref section children))) + (> count 0)))) + ((eq (char-before (- content 1)) ?:) + (save-excursion + (goto-char (- content 2)) + (insert (magit--propertize-face (format " (%s)" count) + 'magit-section-child-count)) + (delete-char 1))) + ((and (eq (char-before (- content 4)) ?\s) + (eq (char-before (- content 3)) ?\() + (eq (char-before (- content 2)) ?t ) + (eq (char-before (- content 1)) ?\))) + (save-excursion + (goto-char (- content 3)) + (delete-char 1) + (insert (format "%s" count))))))) (defun magit-section--opportunistic-wash (section) (when-let ((washer (oref section washer))) @@ -1739,37 +1751,37 @@ evaluated its BODY. Admittedly that's a bit of a hack." (let ((section (magit-current-section)) (focused (magit-focused-sections))) (cond - ((or force - magit-section-highlight-force-update - (xor magit-section-pre-command-region-p (region-active-p)) - (not (eq magit-section-pre-command-section section))) - (let ((inhibit-read-only t) - (deactivate-mark nil) - (selection (magit-region-sections))) - (mapc #'delete-overlay magit-section-highlight-overlays) - (mapc #'delete-overlay magit-section-selection-overlays) - (setq magit-section-highlight-overlays nil) - (setq magit-section-selection-overlays nil) - (cond ((magit-section--maybe-enable-long-lines-shortcuts)) - ((eq section magit-root-section)) - ((not magit-section-highlight-current) - (when selection - (magit-section-highlight-selection selection))) - ((not selection) - (magit-section-highlight section)) - (t - (mapc #'magit-section-highlight selection) - (magit-section-highlight-selection selection))) - (dolist (section (cl-union magit-section-highlighted-sections focused)) - (when (slot-boundp section 'painted) - (magit-section-update-paint section focused))) - (restore-buffer-modified-p nil))) - ((and (eq magit-section-pre-command-section section) - magit-section-selection-overlays - (region-active-p) - (not (magit-region-sections))) - (mapc #'delete-overlay magit-section-selection-overlays) - (setq magit-section-selection-overlays nil))) + ((or force + magit-section-highlight-force-update + (xor magit-section-pre-command-region-p (region-active-p)) + (not (eq magit-section-pre-command-section section))) + (let ((inhibit-read-only t) + (deactivate-mark nil) + (selection (magit-region-sections))) + (mapc #'delete-overlay magit-section-highlight-overlays) + (mapc #'delete-overlay magit-section-selection-overlays) + (setq magit-section-highlight-overlays nil) + (setq magit-section-selection-overlays nil) + (cond ((magit-section--maybe-enable-long-lines-shortcuts)) + ((eq section magit-root-section)) + ((not magit-section-highlight-current) + (when selection + (magit-section-highlight-selection selection))) + ((not selection) + (magit-section-highlight section)) + (t + (mapc #'magit-section-highlight selection) + (magit-section-highlight-selection selection))) + (dolist (section (cl-union magit-section-highlighted-sections focused)) + (when (slot-boundp section 'painted) + (magit-section-update-paint section focused))) + (restore-buffer-modified-p nil))) + ((and (eq magit-section-pre-command-section section) + magit-section-selection-overlays + (region-active-p) + (not (magit-region-sections))) + (mapc #'delete-overlay magit-section-selection-overlays) + (setq magit-section-selection-overlays nil))) (setq magit-section-highlight-force-update nil) (magit-section-maybe-paint-visibility-ellipses))) @@ -1779,22 +1791,22 @@ evaluated its BODY. Admittedly that's a bit of a hack." (headlight heading-highlight-face) (selective (magit-section-selective-highlight-p section))) (cond - (selective - (magit-section-highlight-range start (or content end) headlight) - (cond (children - (let ((child-start (oref (car children) start))) - (when (and content (< content child-start)) - (magit-section-highlight-range content child-start))) - (mapc #'magit-section-highlight children)) - ((and content (not (slot-boundp section 'painted))) - (magit-section-highlight-range content end)) - ;; Unfortunate kludge for delayed hunk refinement. - ((magit-section--refine section)))) - (headlight - (magit-section-highlight-range start (or content end) headlight) - (when content - (magit-section-highlight-range (if headlight content start) end))) - ((magit-section-highlight-range start end))))) + (selective + (magit-section-highlight-range start (or content end) headlight) + (cond (children + (let ((child-start (oref (car children) start))) + (when (and content (< content child-start)) + (magit-section-highlight-range content child-start))) + (mapc #'magit-section-highlight children)) + ((and content (not (slot-boundp section 'painted))) + (magit-section-highlight-range content end)) + ;; Unfortunate kludge for delayed hunk refinement. + ((magit-section--refine section)))) + (headlight + (magit-section-highlight-range start (or content end) headlight) + (when content + (magit-section-highlight-range (if headlight content start) end))) + ((magit-section-highlight-range start end))))) (defun magit-section-highlight-selection (selection) (when magit-section-highlight-selection @@ -1940,7 +1952,7 @@ to nil." (bound-and-true-p long-line-threshold)) :warning))))) ('unstaged 'staged) ('unpushed 'unpulled) ('unpulled 'unpushed)) - (magit-get-section `((,$) (status)))) + (magit-get-section `((,$) (status)))) (and$ (magit-section-siblings section 'next) (magit-get-section (magit-section-ident (car $)))) (and$ (magit-section-siblings section 'prev) @@ -2474,21 +2486,21 @@ This is like moving to POS and then calling `pos-eol'." (mapcan (lambda (section) (cond - (magit--imenu-group-types - (and (if (eq (car-safe magit--imenu-group-types) 'not) - (not (magit-section-match - (cdr magit--imenu-group-types) - section)) - (magit-section-match magit--imenu-group-types section)) - (and-let ((children (oref section children))) - `((,(magit--imenu-index-name section) - ,@(mapcar (##cons (magit--imenu-index-name %) - (oref % start)) - children)))))) - (magit--imenu-item-types - (and (magit-section-match magit--imenu-item-types section) - `((,(magit--imenu-index-name section) - . ,(oref section start))))))) + (magit--imenu-group-types + (and (if (eq (car-safe magit--imenu-group-types) 'not) + (not (magit-section-match + (cdr magit--imenu-group-types) + section)) + (magit-section-match magit--imenu-group-types section)) + (and-let ((children (oref section children))) + `((,(magit--imenu-index-name section) + ,@(mapcar (##cons (magit--imenu-index-name %) + (oref % start)) + children)))))) + (magit--imenu-item-types + (and (magit-section-match magit--imenu-item-types section) + `((,(magit--imenu-index-name section) + . ,(oref section start))))))) (oref magit-root-section children)))) (if (and magit--imenu-group-types (symbolp magit--imenu-group-types)) (cdar index) @@ -2501,18 +2513,18 @@ This is like moving to POS and then calling `pos-eol'." (oref section end)))))) (save-match-data (cond - ((and (magit-section-match [commit logbuf] section) - (string-match "[^ ]+\\([ *|]*\\).+" heading)) - (replace-match " " t t heading 1)) - ((magit-section-match - '([branch local branchbuf] [tag tags branchbuf]) section) - (oref section value)) - ((magit-section-match [branch remote branchbuf] section) - (concat (oref (oref section parent) value) "/" - (oref section value))) - ((string-match " ([0-9]+)\\'" heading) - (substring heading 0 (match-beginning 0))) - (heading))))) + ((and (magit-section-match [commit logbuf] section) + (string-match "[^ ]+\\([ *|]*\\).+" heading)) + (replace-match " " t t heading 1)) + ((magit-section-match + '([branch local branchbuf] [tag tags branchbuf]) section) + (oref section value)) + ((magit-section-match [branch remote branchbuf] section) + (concat (oref (oref section parent) value) "/" + (oref section value))) + ((string-match " ([0-9]+)\\'" heading) + (substring heading 0 (match-beginning 0))) + (heading))))) (defun magit--imenu-goto-function (_name position &rest _rest) "Go to the section at POSITION. @@ -2677,6 +2689,7 @@ with the variables' values as arguments, which were recorded by ;; ("and>" . "cond-let--and>") ;; ("and-let" . "cond-let--and-let") ;; ("if-let" . "cond-let--if-let") +;; ("when$" . "cond-let--when$") ;; ("when-let" . "cond-let--when-let") ;; ("while-let" . "cond-let--while-let") ;; ("match-string" . "match-string") diff --git a/elpa/magit-section-20251220.917/magit-section.info b/elpa/magit-section-20260422.2206/magit-section.info similarity index 99% rename from elpa/magit-section-20251220.917/magit-section.info rename to elpa/magit-section-20260422.2206/magit-section.info index 78544699..f6814a05 100644 --- a/elpa/magit-section-20251220.917/magit-section.info +++ b/elpa/magit-section-20260422.2206/magit-section.info @@ -1,7 +1,7 @@ This is magit-section.info, produced by makeinfo version 6.8 from magit-section.texi. - Copyright (C) 2015-2025 Jonas Bernoulli + Copyright (C) 2015-2026 Jonas Bernoulli You can redistribute this document and/or modify it under the terms @@ -34,9 +34,9 @@ packages that have nothing to do with Magit or Git. and user options see *note (magit)Sections::. This manual documents how you can use sections in your own packages. -This manual is for Magit-Section version 4.4.2. +This manual is for Magit-Section version 4.5.0. - Copyright (C) 2015-2025 Jonas Bernoulli + Copyright (C) 2015-2026 Jonas Bernoulli You can redistribute this document and/or modify it under the terms diff --git a/elpa/magit-todos-readme.txt b/elpa/magit-todos-20250928.1611/README-elpa similarity index 62% rename from elpa/magit-todos-readme.txt rename to elpa/magit-todos-20250928.1611/README-elpa index a5a1f21c..f5367300 100644 --- a/elpa/magit-todos-readme.txt +++ b/elpa/magit-todos-20250928.1611/README-elpa @@ -1,3 +1,11 @@ This package displays keyword entries from source code comments and Org files in the Magit status buffer. Activating an item jumps to it in its file. By default, it uses keywords from `hl-todo', minus a few (like "NOTE"). + +;; Usage: + +Run `magit-todos-mode', then open a Magit status buffer. + +;; Tips: + ++ You can customize settings in the `magit-todos' group. diff --git a/elpa/magit-todos-20240927.52/magit-todos-autoloads.el b/elpa/magit-todos-20250928.1611/magit-todos-autoloads.el similarity index 80% rename from elpa/magit-todos-20240927.52/magit-todos-autoloads.el rename to elpa/magit-todos-20250928.1611/magit-todos-autoloads.el index 70bffb2e..9585d423 100644 --- a/elpa/magit-todos-20240927.52/magit-todos-autoloads.el +++ b/elpa/magit-todos-20250928.1611/magit-todos-autoloads.el @@ -11,16 +11,16 @@ ;;; Generated autoloads from magit-todos.el -(defvar magit-todos-mode nil "\ -Non-nil if Magit-Todos mode is enabled. +(defvar magit-todos-mode nil +"Non-nil if Magit-Todos mode is enabled. See the `magit-todos-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `magit-todos-mode'.") (custom-autoload 'magit-todos-mode "magit-todos" nil) -(autoload 'magit-todos-mode "magit-todos" "\ -Show list of to-do items in Magit status buffer for tracked files in repo. +(autoload 'magit-todos-mode "magit-todos" +"Show list of to-do items in Magit status buffer for tracked files in repo. This is a global minor mode. If called interactively, toggle the `Magit-Todos mode' mode. If the prefix argument is positive, enable the @@ -37,14 +37,14 @@ The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG)" t) -(autoload 'magit-todos-list "magit-todos" "\ -Show to-do list of the current Git repository in a buffer. +(autoload 'magit-todos-list "magit-todos" +"Show to-do list of the current Git repository in a buffer. With prefix, prompt for repository. Use repository in DIRECTORY, or `default-directory' if nil. (fn &optional DIRECTORY)" t) -(autoload 'magit-todos-list-internal "magit-todos" "\ -Open buffer showing to-do list of repository at DIRECTORY. +(autoload 'magit-todos-list-internal "magit-todos" +"Open buffer showing to-do list of repository at DIRECTORY. (fn DIRECTORY)") (register-definition-prefixes "magit-todos" '("magit-todos-")) diff --git a/elpa/magit-todos-20240927.52/magit-todos-pkg.el b/elpa/magit-todos-20250928.1611/magit-todos-pkg.el similarity index 79% rename from elpa/magit-todos-20240927.52/magit-todos-pkg.el rename to elpa/magit-todos-20250928.1611/magit-todos-pkg.el index bda7d174..c5a128c5 100644 --- a/elpa/magit-todos-20240927.52/magit-todos-pkg.el +++ b/elpa/magit-todos-20250928.1611/magit-todos-pkg.el @@ -1,5 +1,5 @@ ;; -*- no-byte-compile: t; lexical-binding: nil -*- -(define-package "magit-todos" "20240927.52" +(define-package "magit-todos" "20250928.1611" "Show source file TODOs in Magit." '((emacs "26.1") (async "1.9.2") @@ -11,8 +11,8 @@ (s "1.12.0") (transient "0.2.0")) :url "https://github.com/alphapapa/magit-todos" - :commit "bd27c57eada0fda1cc0a813db04731a9bcc51b7b" - :revdesc "bd27c57eada0" + :commit "7294a95580bddf7232f2d205efae312dc24c5f61" + :revdesc "7294a95580bd" :keywords '("magit" "vc") :authors '(("Adam Porter" . "adam@alphapapa.net")) :maintainers '(("Adam Porter" . "adam@alphapapa.net"))) diff --git a/elpa/magit-todos-20240927.52/magit-todos.el b/elpa/magit-todos-20250928.1611/magit-todos.el similarity index 98% rename from elpa/magit-todos-20240927.52/magit-todos.el rename to elpa/magit-todos-20250928.1611/magit-todos.el index e75b2c1f..b70e2d69 100644 --- a/elpa/magit-todos-20240927.52/magit-todos.el +++ b/elpa/magit-todos-20250928.1611/magit-todos.el @@ -4,8 +4,8 @@ ;; Author: Adam Porter ;; URL: http://github.com/alphapapa/magit-todos -;; Package-Version: 20240927.52 -;; Package-Revision: bd27c57eada0 +;; Package-Version: 20250928.1611 +;; Package-Revision: 7294a95580bd ;; Package-Requires: ((emacs "26.1") (async "1.9.2") (dash "2.13.0") (f "0.17.2") (hl-todo "1.9.0") (magit "2.13.0") (pcre2el "1.8") (s "1.12.0") (transient "0.2.0")) ;; Keywords: magit, vc @@ -833,11 +833,15 @@ If BRANCH-P is non-nil, do not update `magit-todos-item-cache', ;; Manual updates: Insert section to remind user (let ((magit-insert-section--parent magit-root-section)) (magit-insert-section (todos) - (magit-insert-heading (concat (propertize magit-todos-section-heading 'face 'magit-section-heading) + (magit-insert-heading (concat (propertize magit-todos-section-heading + 'face 'magit-section-heading + 'font-lock-face 'magit-section-heading) " (0)" reminder "\n"))))) (let ((section (magit-todos--insert-groups :type 'todos :heading (format "%s (%s)%s" - (propertize magit-todos-section-heading 'face 'magit-section-heading) + (propertize magit-todos-section-heading + 'face 'magit-section-heading + 'font-lock-face 'magit-section-heading) num-items reminder) :group-fns group-fns :items items @@ -864,7 +868,7 @@ sections." ;; NOTE: `magit-insert-section' seems to bind `magit-section-visibility-cache' to nil, so setting ;; visibility within calls to it probably won't work as intended. (declare (indent defun)) - (let* ((indent (propertize (s-repeat (* 2 depth) " ") 'face nil)) + (let* ((indent (propertize (s-repeat (* 2 depth) " ") 'face nil 'font-lock-face nil)) (heading (concat indent heading)) (magit-insert-section--parent (if (= 0 depth) magit-root-section @@ -897,7 +901,8 @@ sections." :heading (concat (if (and magit-todos-fontify-keyword-headers (member group-name magit-todos-keywords-list)) - (propertize group-name 'face (magit-todos--keyword-face group-name)) + (let ((face (magit-todos--keyword-face group-name))) + (propertize group-name 'face face 'font-lock-face face)) group-name) ;; Item count (if (= 1 (length group-fns)) @@ -930,7 +935,7 @@ sections." ;; NOTE: `magit-insert-section' seems to bind `magit-section-visibility-cache' to nil, so setting ;; visibility within calls to it probably won't work as intended. (declare (indent defun)) - (let* ((indent (propertize (s-repeat (* 2 depth) " ") 'face nil)) + (let* ((indent (propertize (s-repeat (* 2 depth) " ") 'face nil 'font-lock-face nil)) (magit-insert-section--parent (if (= 0 depth) magit-root-section magit-insert-section--parent)) @@ -938,7 +943,9 @@ sections." (section (magit-insert-section ((eval type)) (magit-insert-heading heading) (dolist (item items) - (let* ((filename (propertize (magit-todos-item-filename item) 'face 'magit-filename)) + (let* ((filename (propertize (magit-todos-item-filename item) + 'face 'magit-filename + 'font-lock-face 'magit-filename)) (string (--> (concat indent (when magit-todos-show-filenames (when magit-todos-filename-filter @@ -1115,11 +1122,12 @@ if the process's buffer has already been deleted." (defun magit-todos--format-plain (item) "Return ITEM formatted as from a non-Org file." - (format "%s%s %s" - (propertize (magit-todos-item-keyword item) - 'face (magit-todos--keyword-face (magit-todos-item-keyword item))) - (or (magit-todos-item-suffix item) "") - (or (magit-todos-item-description item) ""))) + (let ((face (magit-todos--keyword-face (magit-todos-item-keyword item)))) + (format "%s%s %s" + (propertize (magit-todos-item-keyword item) + 'face face 'font-lock-face face) + (or (magit-todos-item-suffix item) "") + (or (magit-todos-item-description item) "")))) (defun magit-todos--format-org (item) "Return ITEM formatted as from an Org file." -- 2.47.3