update packages and add valign
This commit is contained in:
@@ -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 <emacs.magit@jonas.bernoulli.dev>
|
||||
;; Maintainer: Jonas Bernoulli <emacs.magit@jonas.bernoulli.dev>
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user