update packages

This commit is contained in:
2025-07-05 20:36:47 +02:00
parent 4a4f30e3b1
commit 65dedd3df8
60 changed files with 15454 additions and 342 deletions

View File

@@ -490,10 +490,7 @@ of a side, then keep that side without prompting."
(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-files--delete
(magit-with-toplevel
(magit-untracked-files nil nil "--directory"))
nil))
(`(untracked list) (magit-discard-untracked))
(`(,_ region) (magit-discard-region s))
(`(,_ hunk) (magit-discard-hunk s))
(`(,_ hunks) (magit-discard-hunks s))
@@ -501,6 +498,12 @@ of a side, then keep that side without prompting."
(`(,_ files) (magit-discard-files s))
(`(,_ list) (magit-discard-files s)))))
(defun magit-discard-untracked ()
(magit-discard-files--delete
(magit-with-toplevel (magit-list-untracked-files))
nil)
(magit-refresh))
(defun magit-discard-region (section)
(magit-confirm 'discard "Discard region")
(magit-discard-apply section 'magit-apply-region))

View File

@@ -63,6 +63,9 @@
(defvar magit-this-error)
(defvar magit-process-error-message-regexps)
;; From `magit-status'.
(defvar magit-status-show-untracked-files)
(eval-when-compile
(cl-pushnew 'orig-rev eieio--known-slot-names)
(cl-pushnew 'number eieio--known-slot-names))
@@ -1069,10 +1072,42 @@ tracked file."
(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))
(defun magit-list-untracked-files (&optional files)
"Return a list of untracked files.
List files if `magit-status-show-untracked-files' is non-nil, but also
take the local value of Git variable `status.showUntrackedFiles' into
account. The local value of the Lisp variable takes precedence over the
local value of the Git variable. The global value of the Git variable
is always ignored.
See also `magit-untracked-files'."
(and-let*
((value (or (and (local-variable-p 'magit-status-show-untracked-files)
magit-status-show-untracked-files)
(pcase (magit-get "--local" "status.showUntrackedFiles")
((or "no" "off" "false" "0") 'no)
((or "yes" "on" "true" "1") t)
("all" 'all))
magit-status-show-untracked-files))
((not (eq value 'no))))
(mapcan (##and (eq (aref % 0) ??)
(list (substring % 3)))
(apply #'magit-git-items "status" "-z" "--porcelain"
(format "--untracked-files=%s"
(if (eq value 'all) "all" "normal"))
"--" files))))
(defun magit-ignored-files (&rest args)
(magit-list-files "--others" "--ignored" "--exclude-standard" args))

View File

@@ -1070,59 +1070,85 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'."
(defun magit-refresh-buffer (&optional created)
"Refresh the current Magit buffer."
(interactive)
(let ((magit--refreshing-buffer-p t)
(magit--refresh-start-time (current-time))
(magit--refresh-cache (or magit--refresh-cache (list (cons 0 0))))
(refresh (intern (format "%s-refresh-buffer"
(substring (symbol-name major-mode) 0 -5)))))
(when (functionp refresh)
(when-let ((refresh (magit--refresh-buffer-function)))
(let ((magit--refreshing-buffer-p t)
(magit--refresh-start-time (current-time))
(magit--refresh-cache (or magit--refresh-cache (list (cons 0 0))))
(action (if created "Creating" "Refreshing")))
(when magit-refresh-verbose
(message "Refreshing buffer `%s'..." (buffer-name)))
(let* ((buffer (current-buffer))
(windows (mapcan
(lambda (window)
(with-selected-window window
(with-current-buffer buffer
(and-let* ((section (magit-section-at)))
`(( ,window
,section
,@(magit-section-get-relative-position
section)))))))
;; If it qualifies, then the selected window
;; comes first, but we want to handle it last
;; so that its `magit-section-movement-hook'
;; run can override the effects of other runs.
(or (nreverse (get-buffer-window-list buffer nil t))
(list (selected-window))))))
(message "%s buffer `%s'..." action (buffer-name)))
(cond
(created
(funcall refresh)
(run-hooks 'magit--initial-section-hook)
(setq-local magit--initial-section-hook nil))
(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)
(let ((inhibit-read-only t))
(erase-buffer)
(save-excursion
(funcall refresh)))
(pcase-dolist (`(,window . ,args) windows)
(if (eq buffer (window-buffer window))
(with-selected-window window
(apply #'magit-section-goto-successor args))
(with-current-buffer buffer
(let ((magit-section-movement-hook nil))
(apply #'magit-section-goto-successor args)))))
(when created
(run-hooks 'magit--initial-section-hook)
(setq-local magit--initial-section-hook nil))
(let ((magit-section-cache-visibility nil))
(magit-section-show magit-root-section))
(run-hooks 'magit-refresh-buffer-hook)
(magit-section-update-highlight)
(set-buffer-modified-p nil)
(push buffer magit-section--refreshed-buffers))
(setq magit-section-focused-sections nil)
(let ((positions (magit--refresh-buffer-get-positions)))
(funcall refresh)
(magit--refresh-buffer-set-positions positions))))
(let ((magit-section-cache-visibility nil))
(magit-section-show magit-root-section))
(run-hooks 'magit-refresh-buffer-hook)
(magit-section-update-highlight)
(set-buffer-modified-p nil)
(push (current-buffer) magit-section--refreshed-buffers)
(when magit-refresh-verbose
(message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name)
(message "%s buffer `%s'...done (%.3fs)" action (buffer-name)
(float-time (time-since magit--refresh-start-time)))))))
(defun magit--refresh-buffer-function ()
(let ((fn (intern (format "%s-refresh-buffer"
(substring (symbol-name major-mode) 0 -5)))))
(and (functionp fn)
(lambda ()
(let ((inhibit-read-only t))
(erase-buffer)
(save-excursion (funcall fn)))))))
(defun magit--refresh-buffer-get-positions ()
(or (let ((buffer (current-buffer)))
(mapcan
(lambda (window)
(with-selected-window window
(with-current-buffer buffer
(and-let* ((section (magit-section-at)))
`((,window
,section
,@(magit-section-get-relative-position section)
,@(and-let* ((ws (magit-section-at (window-start))))
(list ws
(car (magit-section-get-relative-position ws))
(window-start)))))))))
(get-buffer-window-list buffer nil t)))
(and-let* ((section (magit-section-at)))
`((nil ,section ,@(magit-section-get-relative-position section))))))
(defun magit--refresh-buffer-set-positions (positions)
(pcase-dolist
(`(,window ,section ,line ,char ,ws-section ,ws-line ,window-start)
positions)
(if window
(with-selected-window window
(magit-section-goto-successor section line char)
(cond
((or (not window-start)
(> window-start (point))))
((magit-section-equal ws-section (magit-section-at window-start))
(set-window-start window window-start t))
((not (derived-mode-p 'magit-log-mode))
(when-let ((pos (save-excursion
(and (magit-section-goto-successor--same
ws-section ws-line 0)
(point)))))
(set-window-start window pos t)))))
(magit-section-goto-successor section line char))))
(defun magit-revert-buffer (_ignore-auto _noconfirm)
"Wrapper around `magit-refresh-buffer' suitable as `revert-buffer-function'."
(magit-refresh-buffer))
@@ -1188,7 +1214,7 @@ Note that refreshing a Magit buffer is done by re-creating its
contents from scratch, which can be slow in large repositories.
If you are not satisfied with Magit's performance, then you
should obviously not add this function to that hook."
(when-let (((and (not magit--disable-save-buffers)
(when-let (((and (not magit-inhibit-refresh)
(magit-inside-worktree-p t)))
(buf (ignore-errors (magit-get-mode-buffer 'magit-status-mode))))
(cl-pushnew buf magit-after-save-refresh-buffers)

View File

@@ -1,16 +1,16 @@
;; -*- no-byte-compile: t; lexical-binding: nil -*-
(define-package "magit" "20250621.2237"
(define-package "magit" "20250704.2300"
"A Git porcelain inside Emacs."
'((emacs "27.1")
(compat "30.1")
(llama "0.6.3")
(magit-section "4.3.6")
(llama "1.0.0")
(magit-section "4.3.8")
(seq "2.24")
(transient "0.9.0")
(transient "0.9.3")
(with-editor "3.4.4"))
:url "https://github.com/magit/magit"
:commit "a4f73fb2fb55f7644a80b4442379ef43840ec5e9"
:revdesc "a4f73fb2fb55"
:commit "5b820a1d1e94649e0f218362286d520d9f29ac2c"
:revdesc "5b820a1d1e94"
:keywords '("git" "tools" "vc")
:authors '(("Marius Vollmer" . "marius.vollmer@gmail.com")
("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev"))

View File

@@ -752,31 +752,14 @@ remote in alphabetic order."
magit-insert-assume-unchanged-files)
(defun magit-insert-untracked-files ()
"Maybe insert list of untracked files.
"Maybe insert a list of untracked files.
List files if `magit-status-show-untracked-files' is non-nil, but also
take the local value of Git variable `status.showUntrackedFiles' into
account. The local value of the Lisp variable takes precedence over the
local value of the Git variable. The global value of the Git variable
is always ignored."
(when-let*
((value (or (and (local-variable-p 'magit-status-show-untracked-files)
magit-status-show-untracked-files)
(pcase (magit-get "--local" "status.showUntrackedFiles")
((or "no" "off" "false" "0") 'no)
((or "yes" "on" "true" "1") t)
("all" 'all))
magit-status-show-untracked-files))
((not (eq value 'no))))
(magit-insert-files
'untracked
(lambda (files)
(mapcan (##and (eq (aref % 0) ??)
(list (substring % 3)))
(apply #'magit-git-items "status" "-z" "--porcelain"
(format "--untracked-files=%s"
(if (eq value 'all) "all" "normal"))
"--" files))))))
(magit-insert-files 'untracked #'magit-list-untracked-files))
(defun magit-insert-tracked-files ()
"Insert a list of tracked files.

View File

@@ -1,6 +1,6 @@
;;; magit-version.el --- The Magit version you are using -*- lexical-binding:t -*-
(setq magit-version "4.3.6")
(setq magit-version "4.3.8")
(provide 'magit-version)

View File

@@ -17,15 +17,15 @@
;; Homepage: https://github.com/magit/magit
;; Keywords: git tools vc
;; Package-Version: 20250621.2237
;; Package-Revision: a4f73fb2fb55
;; Package-Version: 20250704.2300
;; Package-Revision: 5b820a1d1e94
;; Package-Requires: (
;; (emacs "27.1")
;; (compat "30.1")
;; (llama "0.6.3")
;; (magit-section "4.3.6")
;; (llama "1.0.0")
;; (magit-section "4.3.8")
;; (seq "2.24")
;; (transient "0.9.0")
;; (transient "0.9.3")
;; (with-editor "3.4.4"))
;; SPDX-License-Identifier: GPL-3.0-or-later

View File

@@ -32,7 +32,7 @@ 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.3.6.
This manual is for Magit version 4.3.8.
Copyright (C) 2015-2025 Jonas Bernoulli
<emacs.magit@jonas.bernoulli.dev>