[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/magit 3dcff7ece5 14/17: magit-file-untrack: Move definitio
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/magit 3dcff7ece5 14/17: magit-file-untrack: Move definition |
Date: |
Tue, 1 Apr 2025 09:38:06 -0400 (EDT) |
branch: elpa/magit
commit 3dcff7ece5f3e3fe9bb1fe59d54b9c12991234b9
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-file-untrack: Move definition
Order definitions the same as these commands are ordered in the menu.
---
lisp/magit-files.el | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index f361254aeb..2519d302df 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -419,6 +419,21 @@ the same location in the respective file in the working
tree."
;;; File Commands
+;;;###autoload
+(defun magit-file-untrack (files &optional force)
+ "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."
+ (interactive (list (or (if-let ((files (magit-region-values 'file t)))
+ (if (magit-file-tracked-p (car files))
+ (magit-confirm-files 'untrack files "Untrack")
+ (user-error "Already untracked"))
+ (list (magit-read-tracked-file "Untrack file"))))
+ current-prefix-arg))
+ (magit-with-toplevel
+ (magit-run-git "rm" "--cached" (and force "--force") "--" files)))
+
;;;###autoload
(defun magit-file-rename (file newname)
"Rename or move FILE to NEWNAME.
@@ -456,21 +471,6 @@ Git, fallback to using `rename-file'."
(vc-find-file-hook))))))
(magit-refresh))
-;;;###autoload
-(defun magit-file-untrack (files &optional force)
- "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."
- (interactive (list (or (if-let ((files (magit-region-values 'file t)))
- (if (magit-file-tracked-p (car files))
- (magit-confirm-files 'untrack files "Untrack")
- (user-error "Already untracked"))
- (list (magit-read-tracked-file "Untrack file"))))
- current-prefix-arg))
- (magit-with-toplevel
- (magit-run-git "rm" "--cached" (and force "--force") "--" files)))
-
;;;###autoload
(defun magit-file-delete (files &optional force)
"Delete the selected FILES or one file read in the minibuffer.
- [nongnu] elpa/magit 88464b5363 09/17: magit-git-debug: Add docstring, (continued)
- [nongnu] elpa/magit 88464b5363 09/17: magit-git-debug: Add docstring, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 64e69ea809 11/17: magit--git-insert: Do not return empty string as error message, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 0a74fb0a60 15/17: magit-{stage, unstage}-buffer-file: Move definitions, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 65437016c2 06/17: magit-git-executable: Change name of output buffer, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit ce9f1a5427 07/17: magit-toggle-git-debug: Fix key binding in docstring, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 895e4feced 13/17: magit-file-{rename, untrack, delete}: Autoload, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 4fed8d67a5 12/17: magit-rebase-autosquash: With a prefix allow selecting beginning, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit c7147bb800 04/17: magit-git-insert: Fix docstring typo, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit e4ea6f97be 03/17: readme: Add super badge, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit bf920b7ff7 16/17: magit-{stage, unstage}-buffer-file: Rename to magit-file-{stage, unstage}, Jonas Bernoulli, 2025/04/01
- [nongnu] elpa/magit 3dcff7ece5 14/17: magit-file-untrack: Move definition,
Jonas Bernoulli <=
- [nongnu] elpa/magit 993cdf0aa4 17/17: magit-{stage, unstage}-file: Rename to magit-{stage, unstage}-files, Jonas Bernoulli, 2025/04/01