branch: elpa/magit
commit 993cdf0aa4e4fee150aa583d937a9f4d2dde2928
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-{stage,unstage}-file: Rename to magit-{stage,unstage}-files
    
    Also no longer allow the FILES argument to be a single file instead
    of a list of one or more files.
---
 lisp/magit-apply.el     | 19 +++++++------------
 lisp/magit-diff.el      |  8 ++++----
 lisp/magit-ediff.el     |  2 +-
 lisp/magit-files.el     |  4 ++--
 lisp/magit-mode.el      |  4 ++--
 lisp/magit-status.el    |  2 +-
 lisp/magit-submodule.el |  6 +++---
 7 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/lisp/magit-apply.el b/lisp/magit-apply.el
index 43986e5a98..566c80d1bb 100644
--- a/lisp/magit-apply.el
+++ b/lisp/magit-apply.el
@@ -303,10 +303,10 @@ at point, stage the file but not its content."
         (`(staged        ,_  ,_) (user-error "Already staged"))
         (`(committed     ,_  ,_) (user-error "Cannot stage committed changes"))
         (`(undefined     ,_  ,_) (user-error "Cannot stage this change")))
-    (call-interactively #'magit-stage-file)))
+    (call-interactively #'magit-stage-files)))
 
 ;;;###autoload
-(defun magit-stage-file (files &optional force)
+(defun magit-stage-files (files &optional force)
   "Read one or more files and stage all changes in those files.
 With prefix argument FORCE, offer ignored files for completion."
   (interactive
@@ -322,10 +322,7 @@ With prefix argument FORCE, offer ignored files for 
completion."
             choices nil t nil nil default)
            current-prefix-arg)))
   (magit-with-toplevel
-    ;; For backward compatibility, and because of
-    ;; the function's name, don't require a list.
-    (magit-stage-1 (and force "--force")
-                   (ensure-list files))))
+    (magit-stage-1 (and force "--force") files)))
 
 ;;;###autoload
 (defun magit-stage-modified (&optional all)
@@ -395,7 +392,7 @@ ignored) files."
 
 (defvar magit-post-stage-hook-commands
   (list #'magit-stage
-        #'magit-stage-file
+        #'magit-stage-files
         #'magit-stage-modified
         'magit-file-stage))
 
@@ -432,7 +429,7 @@ ignored) files."
       (`(undefined     ,_  ,_) (user-error "Cannot unstage this change")))))
 
 ;;;###autoload
-(defun magit-unstage-file (files)
+(defun magit-unstage-files (files)
   "Read one or more files and unstage all changes to those files."
   (interactive
    (let* ((choices (magit-staged-files))
@@ -442,9 +439,7 @@ ignored) files."
      (list (magit-completing-read-multiple "Unstage file,s: " choices
                                            nil t nil nil default))))
   (magit-with-toplevel
-    ;; For backward compatibility, and because of
-    ;; the function's name, don't require a list.
-    (magit-unstage-1 (ensure-list files))))
+    (magit-unstage-1 files)))
 
 (defun magit-unstage-1 (files)
   (magit-wip-commit-before-change files " before unstage")
@@ -474,7 +469,7 @@ ignored) files."
 
 (defvar magit-post-unstage-hook-commands
   (list #'magit-unstage
-        #'magit-unstage-file
+        #'magit-unstage-files
         #'magit-unstage-all
         'magit-file-unstage))
 
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 7e87fa5b33..cf1e365d9a 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2125,8 +2125,8 @@ keymap is the parent of their keymaps."
   "<remap> <magit-visit-thing>"      #'magit-diff-visit-file
   "<remap> <magit-revert-no-commit>" #'magit-reverse
   "<remap> <magit-delete-thing>"     #'magit-discard
-  "<remap> <magit-unstage-file>"     #'magit-unstage
-  "<remap> <magit-stage-file>"       #'magit-stage
+  "<remap> <magit-unstage-files>"    #'magit-unstage
+  "<remap> <magit-stage-files>"      #'magit-stage
   "<remap> <magit-cherry-apply>"     #'magit-apply
   "<8>" (magit-menu-item "Rename file" #'magit-file-rename
                          '(:enable (eq (magit-diff-scope) 'file)))
@@ -3107,7 +3107,7 @@ It the SECTION has a different type, then do nothing."
 (defvar-keymap magit-unstaged-section-map
   :doc "Keymap for the `unstaged' section."
   "<remap> <magit-visit-thing>"  #'magit-diff-unstaged
-  "<remap> <magit-stage-file>"   #'magit-stage
+  "<remap> <magit-stage-files>"  #'magit-stage
   "<remap> <magit-delete-thing>" #'magit-discard
   "<3>" (magit-menu-item "Discard all" #'magit-discard)
   "<2>" (magit-menu-item "Stage all"   #'magit-stage)
@@ -3128,7 +3128,7 @@ It the SECTION has a different type, then do nothing."
   :doc "Keymap for the `staged' section."
   "<remap> <magit-revert-no-commit>" #'magit-reverse
   "<remap> <magit-delete-thing>"     #'magit-discard
-  "<remap> <magit-unstage-file>"     #'magit-unstage
+  "<remap> <magit-unstage-files>"    #'magit-unstage
   "<remap> <magit-visit-thing>"      #'magit-diff-staged
   "<4>" (magit-menu-item "Reverse all" #'magit-reverse)
   "<3>" (magit-menu-item "Discard all" #'magit-discard)
diff --git a/lisp/magit-ediff.el b/lisp/magit-ediff.el
index da78e55e15..16e38b78ae 100644
--- a/lisp/magit-ediff.el
+++ b/lisp/magit-ediff.el
@@ -265,7 +265,7 @@ and alternative commands."
                          (save-excursion
                            (goto-char (point-min))
                            (unless (re-search-forward "^<<<<<<< " nil t)
-                             (magit-stage-file file))))))))
+                             (magit-stage-files (list file)))))))))
         (if fileC
             (magit-ediff-buffers
              ((magit-get-revision-buffer revA fileA)
diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index 30827a6547..21cc5e81e8 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -333,8 +333,8 @@ to `magit-dispatch'."
     ("e" "Edit line"  magit-edit-line-commit)]]
   [:if-not magit-file-relative-name
    ["File actions"
-    ("s" "Stage"    magit-stage-file)
-    ("u" "Unstage"  magit-unstage-file)
+    ("s" "Stage"    magit-stage-files)
+    ("u" "Unstage"  magit-unstage-files)
     ("x" "Untrack"  magit-file-untrack)
     ("r" "Rename"   magit-file-rename)
     ("k" "Delete"   magit-file-delete)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 2e8ca78b24..9681767b58 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -398,11 +398,11 @@ recommended value."
   ":" 'magit-git-command
   "r" 'magit-rebase
   "R" 'magit-file-rename
-  "s" 'magit-stage-file
+  "s" 'magit-stage-files
   "S" 'magit-stage-modified
   "t" 'magit-tag
   "T" 'magit-notes
-  "u" 'magit-unstage-file
+  "u" 'magit-unstage-files
   "U" 'magit-unstage-all
   "v" 'magit-revert-no-commit
   "V" 'magit-revert
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index 63f852b26d..ae39a5e381 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -727,7 +727,7 @@ remote in alphabetic order."
 (defvar-keymap magit-untracked-section-map
   :doc "Keymap for the `untracked' section."
   "<remap> <magit-delete-thing>" #'magit-discard
-  "<remap> <magit-stage-file>"   #'magit-stage
+  "<remap> <magit-stage-files>"  #'magit-stage
   "<2>" (magit-menu-item "Discard files" #'magit-discard)
   "<1>" (magit-menu-item "Stage files"   #'magit-stage))
 
diff --git a/lisp/magit-submodule.el b/lisp/magit-submodule.el
index 0095c297bc..9d2b3368b6 100644
--- a/lisp/magit-submodule.el
+++ b/lisp/magit-submodule.el
@@ -517,9 +517,9 @@ or, failing that, the abbreviated HEAD commit hash."
   :doc "Keymap for `module' sections."
   "C-j"        #'magit-submodule-visit
   "C-<return>" #'magit-submodule-visit
-  "<remap> <magit-unstage-file>" #'magit-unstage
-  "<remap> <magit-stage-file>"   #'magit-stage
-  "<remap> <magit-visit-thing>"  #'magit-submodule-visit
+  "<remap> <magit-unstage-files>" #'magit-unstage
+  "<remap> <magit-stage-files>"   #'magit-stage
+  "<remap> <magit-visit-thing>"   #'magit-submodule-visit
   "<5>" (magit-menu-item "Module commands..." #'magit-submodule)
   "<4>" '(menu-item "--")
   "<3>" (magit-menu-item "Unstage %T" #'magit-unstage

Reply via email to