[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit df8095b4da 2/7: magit-{un, }stage-file: Support
|
From: |
ELPA Syncer |
|
Subject: |
[nongnu] elpa/git-commit df8095b4da 2/7: magit-{un, }stage-file: Support acting on multiple files |
|
Date: |
Sat, 20 May 2023 18:01:02 -0400 (EDT) |
branch: elpa/git-commit
commit df8095b4da310997242578559726a0870fd72738
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-{un,}stage-file: Support acting on multiple files
---
lisp/magit-apply.el | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/lisp/magit-apply.el b/lisp/magit-apply.el
index 8ec78e6007..744dfec7a3 100644
--- a/lisp/magit-apply.el
+++ b/lisp/magit-apply.el
@@ -298,18 +298,20 @@ at point, stage the file but not its content."
(call-interactively #'magit-stage-file)))
;;;###autoload
-(defun magit-stage-file (file)
- "Read a file and stage all changes to that file."
+(defun magit-stage-file (files)
+ "Read one or more files and stage all changes in those files."
(interactive
(let* ((choices (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 "Stage file" choices
- nil t nil nil default))))
+ (list (magit-completing-read-multiple "Stage file,s" choices
+ nil t nil nil default))))
(magit-with-toplevel
- (magit-stage-1 nil (list file))))
+ ;; For backward compatibility, and because of
+ ;; the function's name, don't require a list.
+ (magit-stage-1 nil (if (listp files) files (list files)))))
;;;###autoload
(defun magit-stage-modified (&optional all)
@@ -412,17 +414,19 @@ ignored) files."
(`(undefined ,_ ,_) (user-error "Cannot unstage this change")))))
;;;###autoload
-(defun magit-unstage-file (file)
- "Read a file and unstage all changes to that file."
+(defun magit-unstage-file (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 "Unstage file" choices
- nil t nil nil default))))
+ (list (magit-completing-read-multiple "Unstage file,s" choices
+ nil t nil nil default))))
(magit-with-toplevel
- (magit-unstage-1 (list file))))
+ ;; For backward compatibility, and because of
+ ;; the function's name, don't require a list.
+ (magit-unstage-1 (if (listp files) files (list files)))))
(defun magit-unstage-1 (files)
(magit-wip-commit-before-change files " before unstage")
- [nongnu] elpa/git-commit updated (33d1e41d69 -> ebd7a0635d), ELPA Syncer, 2023/05/20
- [nongnu] elpa/git-commit be12ac7511 3/7: magit-stage-file: With a prefix argument offer ignored files, ELPA Syncer, 2023/05/20
- [nongnu] elpa/git-commit 09f600fdcd 1/7: magit-{un, }stage-file: Always prompt, ELPA Syncer, 2023/05/20
- [nongnu] elpa/git-commit df8095b4da 2/7: magit-{un, }stage-file: Support acting on multiple files,
ELPA Syncer <=
- [nongnu] elpa/git-commit 9c6207bb84 4/7: magit-file-dispatch: No longer pivot if not visiting file, ELPA Syncer, 2023/05/20
- [nongnu] elpa/git-commit a4a007f51b 6/7: magit-file-tracked-p: Separate file arguments from other arguments, ELPA Syncer, 2023/05/20
- [nongnu] elpa/git-commit ebd7a0635d 7/7: magit-{un, }stage-buffer-file: New commands, ELPA Syncer, 2023/05/20
- [nongnu] elpa/git-commit 98a1f1d74b 5/7: magit-file-ignored-p: New function, ELPA Syncer, 2023/05/20