aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-01-01 17:39:35 +0100
committerJonas Bernoulli <jonas@bernoul.li>2026-01-01 17:39:35 +0100
commitbf1a7dc26396d27e0836762f96919ac314919f32 (patch)
tree42aaf8512c8e9bb2dc451bd67a25eaa4e94d0906 /lisp
parented67642a25e8aa6fc5c5438fb1ddb6d7c7e94ddf (diff)
Improve indentation of interactive
Emacs 31.1 adds variable `lisp-indent-local-overrides'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/git-commit.el12
-rw-r--r--lisp/magit-apply.el34
-rw-r--r--lisp/magit-branch.el124
-rw-r--r--lisp/magit-bundle.el38
-rw-r--r--lisp/magit-commit.el24
-rw-r--r--lisp/magit-diff.el34
-rw-r--r--lisp/magit-ediff.el32
-rw-r--r--lisp/magit-extras.el54
-rw-r--r--lisp/magit-fetch.el16
-rw-r--r--lisp/magit-files.el34
-rw-r--r--lisp/magit-gitignore.el36
-rw-r--r--lisp/magit-log.el76
-rw-r--r--lisp/magit-merge.el30
-rw-r--r--lisp/magit-patch.el46
-rw-r--r--lisp/magit-push.el60
-rw-r--r--lisp/magit-remote.el42
-rw-r--r--lisp/magit-sequence.el40
-rw-r--r--lisp/magit-sparse-checkout.el32
-rw-r--r--lisp/magit-stash.el14
-rw-r--r--lisp/magit-status.el36
-rw-r--r--lisp/magit-submodule.el46
-rw-r--r--lisp/magit-subtree.el32
-rw-r--r--lisp/magit-tag.el132
-rw-r--r--lisp/magit-wip.el26
-rw-r--r--lisp/magit-worktree.el52
25 files changed, 551 insertions, 551 deletions
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index c2133c0..8f2444d 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -722,9 +722,9 @@ With a numeric prefix ARG, go forward ARG messages."
"Search backward through message history for a match for STRING.
Save current message first."
(interactive
- (list (read-string (format-prompt "Comment substring"
- log-edit-last-comment-match)
- nil nil log-edit-last-comment-match)))
+ (list (read-string (format-prompt "Comment substring"
+ log-edit-last-comment-match)
+ nil nil log-edit-last-comment-match)))
(cl-letf (((symbol-function #'log-edit-previous-comment)
(symbol-function #'git-commit-prev-message)))
(log-edit-comment-search-backward string)))
@@ -733,9 +733,9 @@ Save current message first."
"Search forward through message history for a match for STRING.
Save current message first."
(interactive
- (list (read-string (format-prompt "Comment substring"
- log-edit-last-comment-match)
- nil nil log-edit-last-comment-match)))
+ (list (read-string (format-prompt "Comment substring"
+ log-edit-last-comment-match)
+ nil nil log-edit-last-comment-match)))
(cl-letf (((symbol-function #'log-edit-previous-comment)
(symbol-function #'git-commit-prev-message)))
(log-edit-comment-search-forward string)))
diff --git a/lisp/magit-apply.el b/lisp/magit-apply.el
index f6f0fe6..4a7b14f 100644
--- a/lisp/magit-apply.el
+++ b/lisp/magit-apply.el
@@ -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)))
diff --git a/lisp/magit-branch.el b/lisp/magit-branch.el
index 3dac76f..14ebe90 100644
--- a/lisp/magit-branch.el
+++ b/lisp/magit-branch.el
@@ -314,10 +314,10 @@ branch. This is similar to what `magit-branch-and-checkout'
does."
(declare (interactive-only magit-call-git))
(interactive
- (let ((arg (magit-read-other-branch-or-commit "Checkout")))
- (list arg
- (and (not (magit-commit-p arg))
- (magit-read-starting-point "Create and checkout branch" arg)))))
+ (let ((arg (magit-read-other-branch-or-commit "Checkout")))
+ (list arg
+ (and (not (magit-commit-p arg))
+ (magit-read-starting-point "Create and checkout branch" arg)))))
(when (string-match "\\`heads/\\(.+\\)" arg)
(setq arg (match-str 1 arg)))
(if start-point
@@ -352,29 +352,29 @@ value of `magit-branch-adjust-remote-upstream-alist', just like
when using `magit-branch-and-checkout'."
(declare (interactive-only magit-call-git))
(interactive
- (let* ((current (magit-get-current-branch))
- (local (magit-list-local-branch-names))
- (remote (seq-filter (##and (string-match "[^/]+/" %)
- (not (member (substring % (match-end 0))
- (cons "HEAD" local))))
- (magit-list-remote-branch-names)))
- (choices (nconc (delete current local) remote))
- (atpoint (magit-branch-at-point))
- (choice (magit-completing-read
- "Checkout branch" choices
- nil nil nil 'magit-revision-history
- (or (car (member atpoint choices))
- (and atpoint
- (car (member (and (string-match "[^/]+/" atpoint)
- (substring atpoint (match-end 0)))
- choices)))))))
- (cond ((member choice remote)
- (list (and (string-match "[^/]+/" choice)
- (substring choice (match-end 0)))
- choice))
- ((member choice local)
- (list choice))
- ((list choice (magit-read-starting-point "Create" choice))))))
+ (let* ((current (magit-get-current-branch))
+ (local (magit-list-local-branch-names))
+ (remote (seq-filter (##and (string-match "[^/]+/" %)
+ (not (member (substring % (match-end 0))
+ (cons "HEAD" local))))
+ (magit-list-remote-branch-names)))
+ (choices (nconc (delete current local) remote))
+ (atpoint (magit-branch-at-point))
+ (choice (magit-completing-read
+ "Checkout branch" choices
+ nil nil nil 'magit-revision-history
+ (or (car (member atpoint choices))
+ (and atpoint
+ (car (member (and (string-match "[^/]+/" atpoint)
+ (substring atpoint (match-end 0)))
+ choices)))))))
+ (cond ((member choice remote)
+ (list (and (string-match "[^/]+/" choice)
+ (substring choice (match-end 0)))
+ choice))
+ ((member choice local)
+ (list choice))
+ ((list choice (magit-read-starting-point "Create" choice))))))
(cond
((not start-point)
(magit--checkout branch (magit-branch-arguments))
@@ -544,13 +544,13 @@ When resetting to another branch and a prefix argument is used,
then also set the target branch as the upstream of the branch
that is being reset."
(interactive
- (let ((branch (magit-read-local-branch "Reset branch"
- (magit-local-branch-at-point))))
- (list branch
- (magit-read-branch-or-commit (format "Reset %s to" branch)
- (magit-get-upstream-branch branch)
- branch)
- current-prefix-arg)))
+ (let ((branch (magit-read-local-branch "Reset branch"
+ (magit-local-branch-at-point))))
+ (list branch
+ (magit-read-branch-or-commit (format "Reset %s to" branch)
+ (magit-get-upstream-branch branch)
+ branch)
+ current-prefix-arg)))
(let ((magit-inhibit-refresh t))
(if (equal branch (magit-get-current-branch))
(if (and (magit-anything-modified-p)
@@ -588,24 +588,24 @@ prompt is confusing."
;; `magit-branch-rename'; but it turns out everyone wants to squeeze
;; a bit of extra functionality into this one, including myself.
(interactive
- (let ((branches (magit-region-values 'branch t))
- (force current-prefix-arg))
- (if (length> branches 1)
- (magit-confirm t nil "Delete %d branches" nil branches)
- (setq branches
- (list (magit-read-branch-prefer-other
- (if force "Force delete branch" "Delete branch")))))
- (cond-let
- (force)
- [[unmerged (seq-remove #'magit-branch-merged-p branches)]]
- ((magit-confirm 'delete-unmerged-branch
- "Delete unmerged branch %s"
- "Delete %d unmerged branches"
- 'noabort unmerged)
- (setq force branches))
- ((setq branches (cl-set-difference branches unmerged :test #'equal)))
- ((user-error "Abort")))
- (list branches force)))
+ (let ((branches (magit-region-values 'branch t))
+ (force current-prefix-arg))
+ (if (length> branches 1)
+ (magit-confirm t nil "Delete %d branches" nil branches)
+ (setq branches
+ (list (magit-read-branch-prefer-other
+ (if force "Force delete branch" "Delete branch")))))
+ (cond-let
+ (force)
+ [[unmerged (seq-remove #'magit-branch-merged-p branches)]]
+ ((magit-confirm 'delete-unmerged-branch
+ "Delete unmerged branch %s"
+ "Delete %d unmerged branches"
+ 'noabort unmerged)
+ (setq force branches))
+ ((setq branches (cl-set-difference branches unmerged :test #'equal)))
+ ((user-error "Abort")))
+ (list branches force)))
(let ((refs (mapcar #'magit-ref-fullname branches)))
;; If a member of refs is nil, that means that
;; the respective branch name is ambiguous.
@@ -758,11 +758,11 @@ the value of `magit-branch-rename-push-target' (which see) maybe
set `branch.NEW.pushRemote' and maybe rename the push-target on
the remote."
(interactive
- (let ((branch (magit-read-local-branch "Rename branch")))
- (list branch
- (magit-read-string-ns (format "Rename branch '%s' to" branch)
- nil 'magit-revision-history)
- current-prefix-arg)))
+ (let ((branch (magit-read-local-branch "Rename branch")))
+ (list branch
+ (magit-read-string-ns (format "Rename branch '%s' to" branch)
+ nil 'magit-revision-history)
+ current-prefix-arg)))
(when (string-match "\\`heads/\\(.+\\)" old)
(setq old (match-str 1 old)))
(when (equal old new)
@@ -868,11 +868,11 @@ Also rename the respective reflog file."
("a m" magit-branch.autoSetupMerge)
("a r" magit-branch.autoSetupRebase)]
(interactive
- (list (or (and (not current-prefix-arg)
- (not (and magit-branch-direct-configure
- (eq transient-current-command 'magit-branch)))
- (magit-get-current-branch))
- (magit--read-branch-scope))))
+ (list (or (and (not current-prefix-arg)
+ (not (and magit-branch-direct-configure
+ (eq transient-current-command 'magit-branch)))
+ (magit-get-current-branch))
+ (magit--read-branch-scope))))
(transient-setup 'magit-branch-configure nil nil :scope branch))
(defun magit--read-branch-scope (&optional obj)
diff --git a/lisp/magit-bundle.el b/lisp/magit-bundle.el
index a1f66a0..068320f 100644
--- a/lisp/magit-bundle.el
+++ b/lisp/magit-bundle.el
@@ -61,14 +61,14 @@
("t" "create tracked bundle" magit-bundle-create-tracked)
("u" "update tracked bundle" magit-bundle-update-tracked)]
(interactive
- (and (eq transient-current-command 'magit-bundle-create)
- (list (read-file-name "Create bundle: " nil nil nil
- (concat (file-name-nondirectory
- (directory-file-name (magit-toplevel)))
- ".bundle"))
- (magit-completing-read-multiple "Refnames (zero or more): "
- (magit-list-refnames))
- (transient-args 'magit-bundle-create))))
+ (and (eq transient-current-command 'magit-bundle-create)
+ (list (read-file-name "Create bundle: " nil nil nil
+ (concat (file-name-nondirectory
+ (directory-file-name (magit-toplevel)))
+ ".bundle"))
+ (magit-completing-read-multiple "Refnames (zero or more): "
+ (magit-list-refnames))
+ (transient-args 'magit-bundle-create))))
(if file
(magit-git-bundle "create" file refs args)
(transient-setup 'magit-bundle-create)))
@@ -77,17 +77,17 @@
(defun magit-bundle-create-tracked (file tag branch refs args)
"Create and track a new bundle."
(interactive
- (let ((tag (magit-read-tag "Track bundle using tag"))
- (branch (magit-read-branch "Bundle branch"))
- (refs (magit-completing-read-multiple
- "Additional refnames (zero or more): "
- (magit-list-refnames))))
- (list (read-file-name "File: " nil nil nil (concat tag ".bundle"))
- tag branch
- (if (equal branch (magit-get-current-branch))
- (cons "HEAD" refs)
- refs)
- (transient-args 'magit-bundle-create))))
+ (let ((tag (magit-read-tag "Track bundle using tag"))
+ (branch (magit-read-branch "Bundle branch"))
+ (refs (magit-completing-read-multiple
+ "Additional refnames (zero or more): "
+ (magit-list-refnames))))
+ (list (read-file-name "File: " nil nil nil (concat tag ".bundle"))
+ tag branch
+ (if (equal branch (magit-get-current-branch))
+ (cons "HEAD" refs)
+ refs)
+ (transient-args 'magit-bundle-create))))
(magit-git-bundle "create" file (cons branch refs) args)
(magit-git "tag" "--force" tag branch
"-m" (concat ";; git-bundle tracking\n"
diff --git a/lisp/magit-commit.el b/lisp/magit-commit.el
index ef79071..398b2b1 100644
--- a/lisp/magit-commit.el
+++ b/lisp/magit-commit.el
@@ -520,18 +520,18 @@ is updated:
- The command was invoked with a prefix argument.
- Non-interactively if UPDATE-AUTHOR is nil."
(interactive
- (let ((update-author (and (magit-rev-author-p "HEAD")
- (not current-prefix-arg))))
- (push (magit-rev-format (if update-author "%ad" "%cd") "HEAD"
- (concat "--date=format:%F %T %z"))
- magit--reshelve-history)
- (list (read-string (if update-author
- "Change author and committer dates to: "
- "Change committer date to: ")
- (cons (format-time-string "%F %T %z") 17)
- 'magit--reshelve-history)
- update-author
- (magit-commit-arguments))))
+ (let ((update-author (and (magit-rev-author-p "HEAD")
+ (not current-prefix-arg))))
+ (push (magit-rev-format (if update-author "%ad" "%cd") "HEAD"
+ (concat "--date=format:%F %T %z"))
+ magit--reshelve-history)
+ (list (read-string (if update-author
+ "Change author and committer dates to: "
+ "Change committer date to: ")
+ (cons (format-time-string "%F %T %z") 17)
+ 'magit--reshelve-history)
+ update-author
+ (magit-commit-arguments))))
(with-environment-variables (("GIT_COMMITTER_DATE" date))
(magit-run-git "commit" "--amend" "--no-edit"
(and update-author (concat "--date=" date))
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index ecc06d6..56d1a2d 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -1309,9 +1309,9 @@ revisions (i.e., use a \"...\" range)."
With a prefix argument show changes between the working tree and
a commit read from the minibuffer."
(interactive
- (cons (and current-prefix-arg
- (magit-read-branch-or-commit "Diff working tree and commit"))
- (magit-diff-arguments)))
+ (cons (and current-prefix-arg
+ (magit-read-branch-or-commit "Diff working tree and commit"))
+ (magit-diff-arguments)))
(magit-diff-setup-buffer (or rev "HEAD") nil args files 'committed))
;;;###autoload
@@ -1320,9 +1320,9 @@ a commit read from the minibuffer."
With a prefix argument show changes between the index and
a commit read from the minibuffer."
(interactive
- (cons (and current-prefix-arg
- (magit-read-branch-or-commit "Diff index and commit"))
- (magit-diff-arguments)))
+ (cons (and current-prefix-arg
+ (magit-read-branch-or-commit "Diff index and commit"))
+ (magit-diff-arguments)))
(magit-diff-setup-buffer rev "--cached" args files 'staged))
;;;###autoload
@@ -1405,17 +1405,17 @@ the file or blob."
If there is no revision at point or with a prefix argument prompt
for a revision."
(interactive
- (pcase-let* ((mcommit (magit-section-value-if 'module-commit))
- (atpoint (or mcommit
- (magit-thing-at-point 'git-revision t)
- (magit-branch-or-commit-at-point)))
- (`(,args ,files) (magit-show-commit--arguments)))
- (list (or (and (not current-prefix-arg) atpoint)
- (magit-read-branch-or-commit "Show commit" atpoint))
- args
- files
- (and mcommit
- (magit-section-parent-value (magit-current-section))))))
+ (pcase-let* ((mcommit (magit-section-value-if 'module-commit))
+ (atpoint (or mcommit
+ (magit-thing-at-point 'git-revision t)
+ (magit-branch-or-commit-at-point)))
+ (`(,args ,files) (magit-show-commit--arguments)))
+ (list (or (and (not current-prefix-arg) atpoint)
+ (magit-read-branch-or-commit "Show commit" atpoint))
+ args
+ files
+ (and mcommit
+ (magit-section-parent-value (magit-current-section))))))
(require 'magit)
(let* ((file (magit-file-relative-name))
(line (and file (line-number-at-pos))))
diff --git a/lisp/magit-ediff.el b/lisp/magit-ediff.el
index 9db7f8e..1da3c45 100644
--- a/lisp/magit-ediff.el
+++ b/lisp/magit-ediff.el
@@ -319,9 +319,9 @@ and alternative commands."
"Stage and unstage changes to FILE using Ediff.
FILE has to be relative to the top directory of the repository."
(interactive
- (let ((files (magit-tracked-files)))
- (list (magit-completing-read "Selectively stage file" files nil t nil nil
- (car (member (magit-current-file) files))))))
+ (let ((files (magit-tracked-files)))
+ (list (magit-completing-read "Selectively stage file" files nil t nil nil
+ (car (member (magit-current-file) files))))))
(magit-with-toplevel
(let* ((bufA (magit-get-revision-buffer "HEAD" file))
(bufB (magit-get-revision-buffer "{index}" file))
@@ -367,10 +367,10 @@ the revisions, choose a revision to view changes along, starting
at the common ancestor of both revisions (i.e., use a \"...\"
range)."
(interactive
- (pcase-let ((`(,revA ,revB) (magit-ediff-compare--read-revisions
- nil current-prefix-arg)))
- (nconc (list revA revB)
- (magit-ediff-read-files revA revB))))
+ (pcase-let ((`(,revA ,revB) (magit-ediff-compare--read-revisions
+ nil current-prefix-arg)))
+ (nconc (list revA revB)
+ (magit-ediff-read-files revA revB))))
(magit-ediff-buffers
((if revA (magit-get-revision-buffer revA fileA) (get-file-buffer fileA))
(if revA (magit-find-file-noselect revA fileA) (find-file-noselect fileA)))
@@ -499,9 +499,9 @@ and discard changes using Ediff, use `magit-ediff-stage'.
FILE must be relative to the top directory of the repository."
(interactive
- (list (magit-read-file-choice "Show staged changes for file"
- (magit-staged-files)
- "No staged files")))
+ (list (magit-read-file-choice "Show staged changes for file"
+ (magit-staged-files)
+ "No staged files")))
(magit-ediff-buffers ((magit-get-revision-buffer "HEAD" file)
(magit-find-file-noselect "HEAD" file))
((get-buffer (concat file ".~{index}~"))
@@ -516,9 +516,9 @@ and discard changes using Ediff, use `magit-ediff-stage'.
FILE must be relative to the top directory of the repository."
(interactive
- (list (magit-read-file-choice "Show unstaged changes for file"
- (magit-unstaged-files)
- "No unstaged files")))
+ (list (magit-read-file-choice "Show unstaged changes for file"
+ (magit-unstaged-files)
+ "No unstaged files")))
(magit-ediff-buffers ((get-buffer (concat file ".~{index}~"))
(magit-find-file-index-noselect file t))
((get-file-buffer file)
@@ -529,9 +529,9 @@ FILE must be relative to the top directory of the repository."
"Show changes between `HEAD' and working tree using Ediff.
FILE must be relative to the top directory of the repository."
(interactive
- (list (magit-read-file-choice "Show changes in file"
- (magit-changed-files "HEAD")
- "No changed files")))
+ (list (magit-read-file-choice "Show changes in file"
+ (magit-changed-files "HEAD")
+ "No changed files")))
(magit-ediff-buffers ((magit-get-revision-buffer "HEAD" file)
(magit-find-file-noselect "HEAD" file))
((get-file-buffer file)
diff --git a/lisp/magit-extras.el b/lisp/magit-extras.el
index 2b51546..8649a50 100644
--- a/lisp/magit-extras.el
+++ b/lisp/magit-extras.el
@@ -60,11 +60,11 @@ alternative commands."
["Actions"
(" m" "Invoke mergetool" magit-git-mergetool)]
(interactive
- (if (and (not (eq transient-current-command 'magit-git-mergetool))
- current-prefix-arg)
- (list nil nil t)
- (list (magit-read-unmerged-file "Resolve")
- (transient-args 'magit-git-mergetool))))
+ (if (and (not (eq transient-current-command 'magit-git-mergetool))
+ current-prefix-arg)
+ (list nil nil t)
+ (list (magit-read-unmerged-file "Resolve")
+ (transient-args 'magit-git-mergetool))))
(if transient
(transient-setup 'magit-git-mergetool)
(magit-run-git-async "mergetool" "--gui" args "--" file)))
@@ -131,18 +131,18 @@ prefix or when the current file cannot be determined let the user
choose. When the current buffer is visiting FILENAME instruct
blame to center around the line point is on."
(interactive
- (let (revision filename)
- (when (or current-prefix-arg
- (progn
- (setq revision "HEAD")
- (not (setq filename (magit-file-relative-name nil 'tracked)))))
- (setq revision (magit-read-branch-or-commit "Blame from revision"))
- (setq filename (magit-read-file-from-rev revision "Blame file")))
- (list revision filename
- (and (equal filename
- (ignore-errors
- (magit-file-relative-name buffer-file-name)))
- (line-number-at-pos)))))
+ (let (revision filename)
+ (when (or current-prefix-arg
+ (progn
+ (setq revision "HEAD")
+ (not (setq filename (magit-file-relative-name nil 'tracked)))))
+ (setq revision (magit-read-branch-or-commit "Blame from revision"))
+ (setq filename (magit-read-file-from-rev revision "Blame file")))
+ (list revision filename
+ (and (equal filename
+ (ignore-errors
+ (magit-file-relative-name buffer-file-name)))
+ (line-number-at-pos)))))
(magit-with-toplevel
(magit-process-git 0 "gui" "blame"
(and linenum (list (format "--line=%d" linenum)))
@@ -593,16 +593,16 @@ revision). If not called inside a repository and with an empty
stack, or with two prefix arguments, then read the repository in
the minibuffer too."
(interactive
- (if (or current-prefix-arg (not magit-revision-stack))
- (let ((default-directory
- (or (and (not (= (prefix-numeric-value current-prefix-arg) 16))
- (or (magit-toplevel)
- (cadr (car magit-revision-stack))))
- (magit-read-repository))))
- (list (magit-read-branch-or-commit "Insert revision")
- default-directory))
- (push (caar magit-revision-stack) magit-revision-history)
- (pop magit-revision-stack)))
+ (if (or current-prefix-arg (not magit-revision-stack))
+ (let ((default-directory
+ (or (and (not (= (prefix-numeric-value current-prefix-arg) 16))
+ (or (magit-toplevel)
+ (cadr (car magit-revision-stack))))
+ (magit-read-repository))))
+ (list (magit-read-branch-or-commit "Insert revision")
+ default-directory))
+ (push (caar magit-revision-stack) magit-revision-history)
+ (pop magit-revision-stack)))
(unless rev
(user-error "Revision stack is empty"))
(pcase-let ((`(,pnt-format ,eob-format ,idx-format)
diff --git a/lisp/magit-fetch.el b/lisp/magit-fetch.el
index 07205f2..4e88d2e 100644
--- a/lisp/magit-fetch.el
+++ b/lisp/magit-fetch.el
@@ -117,20 +117,20 @@ results in an error."
(defun magit-fetch-branch (remote branch args)
"Fetch a BRANCH from a REMOTE."
(interactive
- (let ((remote (magit-read-remote-or-url "Fetch from remote or url")))
- (list remote
- (magit-read-remote-branch "Fetch branch" remote)
- (magit-fetch-arguments))))
+ (let ((remote (magit-read-remote-or-url "Fetch from remote or url")))
+ (list remote
+ (magit-read-remote-branch "Fetch branch" remote)
+ (magit-fetch-arguments))))
(magit-git-fetch remote (cons branch args)))
;;;###autoload
(defun magit-fetch-refspec (remote refspec args)
"Fetch a REFSPEC from a REMOTE."
(interactive
- (let ((remote (magit-read-remote-or-url "Fetch from remote or url")))
- (list remote
- (magit-read-refspec "Fetch using refspec" remote)
- (magit-fetch-arguments))))
+ (let ((remote (magit-read-remote-or-url "Fetch from remote or url")))
+ (list remote
+ (magit-read-refspec "Fetch using refspec" remote)
+ (magit-fetch-arguments))))
(magit-git-fetch remote (cons refspec args)))
;;;###autoload
diff --git a/lisp/magit-files.el b/lisp/magit-files.el
index e64c604..b4ab5f4 100644
--- a/lisp/magit-files.el
+++ b/lisp/magit-files.el
@@ -248,9 +248,9 @@ This command is like `find-file', except that it temporarily
binds `default-directory' to the actual git directory, while
reading the FILENAME."
(interactive
- (let ((default-directory (magit-gitdir)))
- (find-file-read-args "Find file: "
- (confirm-nonexistent-file-or-buffer))))
+ (let ((default-directory (magit-gitdir)))
+ (find-file-read-args "Find file: "
+ (confirm-nonexistent-file-or-buffer))))
(find-file filename wildcards))
(defun magit-find-git-config-file-other-window (filename &optional wildcards)
@@ -264,9 +264,9 @@ This command is like `find-file-other-window', except that it
temporarily binds `default-directory' to the actual git
directory, while reading the FILENAME."
(interactive
- (let ((default-directory (magit-gitdir)))
- (find-file-read-args "Find file in other window: "
- (confirm-nonexistent-file-or-buffer))))
+ (let ((default-directory (magit-gitdir)))
+ (find-file-read-args "Find file in other window: "
+ (confirm-nonexistent-file-or-buffer))))
(find-file-other-window filename wildcards))
(defun magit-find-git-config-file-other-frame (filename &optional wildcards)
@@ -280,9 +280,9 @@ This command is like `find-file-other-frame', except that it
temporarily binds `default-directory' to the actual git
directory, while reading the FILENAME."
(interactive
- (let ((default-directory (magit-gitdir)))
- (find-file-read-args "Find file in other frame: "
- (confirm-nonexistent-file-or-buffer))))
+ (let ((default-directory (magit-gitdir)))
+ (find-file-read-args "Find file in other frame: "
+ (confirm-nonexistent-file-or-buffer))))
(find-file-other-frame filename wildcards))
;;; File Dispatch
@@ -495,11 +495,11 @@ staged as well as unstaged changes."
NEWNAME may be a file or directory name. If FILE isn't tracked in
Git, fallback to using `rename-file'."
(interactive
- (let* ((file (magit-read-file "Rename file"))
- (path (expand-file-name file (magit-toplevel))))
- (list path (expand-file-name
- (read-file-name (format "Move %s to destination: " file)
- (file-name-directory path))))))
+ (let* ((file (magit-read-file "Rename file"))
+ (path (expand-file-name file (magit-toplevel))))
+ (list path (expand-file-name
+ (read-file-name (format "Move %s to destination: " file)
+ (file-name-directory path))))))
(let ((oldbuf (get-file-buffer file))
(dstdir (file-name-directory newname))
(dstfile (if (directory-name-p newname)
@@ -548,9 +548,9 @@ Git, then fallback to using `delete-file'."
(defun magit-file-checkout (rev file)
"Checkout FILE from REV."
(interactive
- (let ((rev (magit-read-branch-or-commit
- "Checkout from revision" magit-buffer-revision)))
- (list rev (magit-read-file-from-rev rev "Checkout file" nil t))))
+ (let ((rev (magit-read-branch-or-commit
+ "Checkout from revision" magit-buffer-revision)))
+ (list rev (magit-read-file-from-rev rev "Checkout file" nil t))))
(magit-with-toplevel
(magit-run-git "checkout" rev "--" file)))
diff --git a/lisp/magit-gitignore.el b/lisp/magit-gitignore.el
index 2b0d288..f3e088d 100644
--- a/lisp/magit-gitignore.el
+++ b/lisp/magit-gitignore.el
@@ -146,12 +146,12 @@ Rules that are defined in that file affect all local repositories."
(defun magit-skip-worktree (file)
"Call \"git update-index --skip-worktree -- FILE\"."
(interactive
- (list (magit-read-file-choice "Skip worktree for"
- (magit-with-toplevel
- (cl-set-difference
- (magit-list-files)
- (magit-skip-worktree-files)
- :test #'equal)))))
+ (list (magit-read-file-choice "Skip worktree for"
+ (magit-with-toplevel
+ (cl-set-difference
+ (magit-list-files)
+ (magit-skip-worktree-files)
+ :test #'equal)))))
(magit-with-toplevel
(magit-run-git "update-index" "--skip-worktree" "--" file)))
@@ -159,9 +159,9 @@ Rules that are defined in that file affect all local repositories."
(defun magit-no-skip-worktree (file)
"Call \"git update-index --no-skip-worktree -- FILE\"."
(interactive
- (list (magit-read-file-choice "Do not skip worktree for"
- (magit-with-toplevel
- (magit-skip-worktree-files)))))
+ (list (magit-read-file-choice "Do not skip worktree for"
+ (magit-with-toplevel
+ (magit-skip-worktree-files)))))
(magit-with-toplevel
(magit-run-git "update-index" "--no-skip-worktree" "--" file)))
@@ -171,12 +171,12 @@ Rules that are defined in that file affect all local repositories."
(defun magit-assume-unchanged (file)
"Call \"git update-index --assume-unchanged -- FILE\"."
(interactive
- (list (magit-read-file-choice "Assume file to be unchanged"
- (magit-with-toplevel
- (cl-set-difference
- (magit-list-files)
- (magit-assume-unchanged-files)
- :test #'equal)))))
+ (list (magit-read-file-choice "Assume file to be unchanged"
+ (magit-with-toplevel
+ (cl-set-difference
+ (magit-list-files)
+ (magit-assume-unchanged-files)
+ :test #'equal)))))
(magit-with-toplevel
(magit-run-git "update-index" "--assume-unchanged" "--" file)))
@@ -184,9 +184,9 @@ Rules that are defined in that file affect all local repositories."
(defun magit-no-assume-unchanged (file)
"Call \"git update-index --no-assume-unchanged -- FILE\"."
(interactive
- (list (magit-read-file-choice "Do not assume file to be unchanged"
- (magit-with-toplevel
- (magit-assume-unchanged-files)))))
+ (list (magit-read-file-choice "Do not assume file to be unchanged"
+ (magit-with-toplevel
+ (magit-assume-unchanged-files)))))
(magit-with-toplevel
(magit-run-git "update-index" "--no-assume-unchanged" "--" file)))
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index a9ca97e..581f35e 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -696,26 +696,26 @@ When the upstream is a local branch, then also show its own
upstream. When `HEAD' is detached, then show log for that, the
previously checked out branch and its upstream and push-target."
(interactive
- (cons (let ((current (magit-get-current-branch))
- head rebase target upstream upup)
- (unless current
- (setq rebase (magit-rebase--get-state-lines "head-name"))
- (cond (rebase
- (setq rebase (magit-ref-abbrev rebase))
- (setq current rebase)
- (setq head "HEAD"))
- ((setq current (magit-get-previous-branch)))))
- (cond (current
- (setq current
- (magit--propertize-face current 'magit-branch-local))
- (setq target (magit-get-push-branch current t))
- (setq upstream (magit-get-upstream-branch current))
- (when upstream
- (setq upup (and (magit-local-branch-p upstream)
- (magit-get-upstream-branch upstream)))))
- ((setq head "HEAD")))
- (delq nil (list current head target upstream upup)))
- (magit-log-arguments)))
+ (cons (let ((current (magit-get-current-branch))
+ head rebase target upstream upup)
+ (unless current
+ (setq rebase (magit-rebase--get-state-lines "head-name"))
+ (cond (rebase
+ (setq rebase (magit-ref-abbrev rebase))
+ (setq current rebase)
+ (setq head "HEAD"))
+ ((setq current (magit-get-previous-branch)))))
+ (cond (current
+ (setq current
+ (magit--propertize-face current 'magit-branch-local))
+ (setq target (magit-get-push-branch current t))
+ (setq upstream (magit-get-upstream-branch current))
+ (when upstream
+ (setq upup (and (magit-local-branch-p upstream)
+ (magit-get-upstream-branch upstream)))))
+ ((setq head "HEAD")))
+ (delq nil (list current head target upstream upup)))
+ (magit-log-arguments)))
(magit-log-setup-buffer revs args files))
;;;###autoload
@@ -844,10 +844,10 @@ directly on BRANCH, then show approximately
This command requires git-when-merged, which is available from
https://github.com/mhagger/git-when-merged."
(interactive
- (append (let ((commit (magit-read-branch-or-commit "Log merge of commit")))
- (list commit
- (magit-read-other-branch "Merged into" commit)))
- (magit-log-arguments)))
+ (append (let ((commit (magit-read-branch-or-commit "Log merge of commit")))
+ (list commit
+ (magit-read-other-branch "Merged into" commit)))
+ (magit-log-arguments)))
(unless (magit-git-executable-find "git-when-merged")
(user-error "This command requires git-when-merged (%s)"
"https://github.com/mhagger/git-when-merged"))
@@ -970,13 +970,13 @@ nothing else.
If invoked outside any log buffer, then display the log buffer
of the current repository first; creating it if necessary."
(interactive
- (list (magit-completing-read
- "In log, jump to"
- (magit-list-refnames nil t)
- nil 'any nil 'magit-revision-history
- (or (and$ (magit-commit-at-point)
- (magit-rev-fixup-target $))
- (magit-get-current-branch)))))
+ (list (magit-completing-read
+ "In log, jump to"
+ (magit-list-refnames nil t)
+ nil 'any nil 'magit-revision-history
+ (or (and$ (magit-commit-at-point)
+ (magit-rev-fixup-target $))
+ (magit-get-current-branch)))))
(with-current-buffer
(cond ((derived-mode-p 'magit-log-mode)
(current-buffer))
@@ -1020,16 +1020,16 @@ of the current repository first; creating it if necessary."
(defun magit-shortlog-since (commit args)
"Show a history summary for commits since REV."
(interactive
- (list (magit-read-branch-or-commit "Shortlog since" (magit-get-current-tag))
- (transient-args 'magit-shortlog)))
+ (list (magit-read-branch-or-commit "Shortlog since" (magit-get-current-tag))
+ (transient-args 'magit-shortlog)))
(magit-git-shortlog (concat commit "..") args))
;;;###autoload
(defun magit-shortlog-range (rev-or-range args)
"Show a history summary for commit or range REV-OR-RANGE."
(interactive
- (list (magit-read-range-or-commit "Shortlog for revision or range")
- (transient-args 'magit-shortlog)))
+ (list (magit-read-range-or-commit "Shortlog for revision or range")
+ (transient-args 'magit-shortlog)))
(magit-git-shortlog rev-or-range args))
;;;; Movement Commands
@@ -1899,9 +1899,9 @@ Type \\[magit-cherry-pick] to apply the commit at point.
(defun magit-cherry (head upstream)
"Show commits in a branch that are not merged in the upstream branch."
(interactive
- (let ((head (magit-read-branch "Cherry head")))
- (list head (magit-read-other-branch "Cherry upstream" head
- (magit-get-upstream-branch head)))))
+ (let ((head (magit-read-branch "Cherry head")))
+ (list head (magit-read-other-branch "Cherry upstream" head
+ (magit-get-upstream-branch head)))))
(require 'magit)
(magit-cherry-setup-buffer head upstream))
diff --git a/lisp/magit-merge.el b/lisp/magit-merge.el
index 93bd318..e5c4503 100644
--- a/lisp/magit-merge.el
+++ b/lisp/magit-merge.el
@@ -139,12 +139,12 @@ obsolete version of the commits that are being merged. Finally
if `forge-branch-pullreq' was used to create the merged branch,
then also remove the respective remote branch."
(interactive
- (list (let ((branch (magit-get-current-branch)))
- (magit-read-other-local-branch
- (format "Merge `%s' into" (or branch (magit-rev-parse "HEAD")))
- nil
- (and branch (magit-get-local-upstream-branch branch))))
- (magit-merge-arguments)))
+ (list (let ((branch (magit-get-current-branch)))
+ (magit-read-other-local-branch
+ (format "Merge `%s' into" (or branch (magit-rev-parse "HEAD")))
+ nil
+ (and branch (magit-get-local-upstream-branch branch))))
+ (magit-merge-arguments)))
(let ((current (magit-get-current-branch))
(head (magit-rev-parse "HEAD")))
(when (zerop (magit-call-git "checkout" branch))
@@ -240,15 +240,15 @@ then also remove the respective remote branch."
(defun magit-checkout-stage (file arg)
"During a conflict checkout and stage side, or restore conflict."
(interactive
- (let ((file (magit-completing-read "Checkout file"
- (magit-tracked-files) nil 'any nil
- 'magit-read-file-hist
- (magit-current-file))))
- (cond ((member file (magit-unmerged-files))
- (list file (magit-checkout-read-stage file)))
- ((yes-or-no-p (format "Restore conflicts in %s? " file))
- (list file "--merge"))
- ((user-error "Quit")))))
+ (let ((file (magit-completing-read "Checkout file"
+ (magit-tracked-files) nil 'any nil
+ 'magit-read-file-hist
+ (magit-current-file))))
+ (cond ((member file (magit-unmerged-files))
+ (list file (magit-checkout-read-stage file)))
+ ((yes-or-no-p (format "Restore conflicts in %s? " file))
+ (list file "--merge"))
+ ((user-error "Quit")))))
(pcase (cons arg (cddr (car (magit-file-status file))))
((or `("--ours" ?D ,_)
'("--ours" ?U ?A)
diff --git a/lisp/magit-patch.el b/lisp/magit-patch.el
index 2e74c1a..a84d4be 100644
--- a/lisp/magit-patch.el
+++ b/lisp/magit-patch.el
@@ -99,18 +99,18 @@ which creates patches for all commits that are reachable from
["Actions"
("c" "Create patches" magit-patch-create)]
(interactive
- (if (not (eq transient-current-command 'magit-patch-create))
- (list nil nil nil)
- (cons (if-let ((revs (magit-region-values 'commit t)))
- (concat (car (last revs)) "^.." (car revs))
- (let ((range (magit-read-range-or-commit
- "Create patches for range or commit")))
- (if (string-search ".." range)
- range
- (format "%s~..%s" range range))))
- (let ((args (transient-args 'magit-patch-create)))
- (list (seq-filter #'stringp args)
- (cdr (assoc "--" args)))))))
+ (if (not (eq transient-current-command 'magit-patch-create))
+ (list nil nil nil)
+ (cons (if-let ((revs (magit-region-values 'commit t)))
+ (concat (car (last revs)) "^.." (car revs))
+ (let ((range (magit-read-range-or-commit
+ "Create patches for range or commit")))
+ (if (string-search ".." range)
+ range
+ (format "%s~..%s" range range))))
+ (let ((args (transient-args 'magit-patch-create)))
+ (list (seq-filter #'stringp args)
+ (cdr (assoc "--" args)))))))
(if (not range)
(transient-setup 'magit-patch-create)
(magit-run-git "format-patch" range args "--" files)
@@ -247,14 +247,14 @@ which creates patches for all commits that are reachable from
["Actions"
("a" "Apply patch" magit-patch-apply)]
(interactive
- (if (not (eq transient-current-command 'magit-patch-apply))
- (list nil)
- (list (expand-file-name
- (read-file-name "Apply patch: "
- default-directory nil nil
- (and$ (magit-file-at-point)
- (file-relative-name $))))
- (transient-args 'magit-patch-apply))))
+ (if (not (eq transient-current-command 'magit-patch-apply))
+ (list nil)
+ (list (expand-file-name
+ (read-file-name "Apply patch: "
+ default-directory nil nil
+ (and$ (magit-file-at-point)
+ (file-relative-name $))))
+ (transient-args 'magit-patch-apply))))
(if (not file)
(transient-setup 'magit-patch-apply)
(magit-run-git "apply" args "--" (magit-convert-filename-for-git file))))
@@ -313,9 +313,9 @@ START is a commit that already is in the upstream repository.
END is the last commit, usually a branch name, which upstream
is asked to pull. START has to be reachable from that commit."
(interactive
- (list (magit-get "remote" (magit-read-remote "Remote") "url")
- (magit-read-branch-or-commit "Start" (magit-get-upstream-branch))
- (magit-read-branch-or-commit "End")))
+ (list (magit-get "remote" (magit-read-remote "Remote") "url")
+ (magit-read-branch-or-commit "Start" (magit-get-upstream-branch))
+ (magit-read-branch-or-commit "End")))
(require 'message)
(let ((dir default-directory))
;; mu4e changes default-directory
diff --git a/lisp/magit-push.el b/lisp/magit-push.el
index 75aa9b0..6739895 100644
--- a/lisp/magit-push.el
+++ b/lisp/magit-push.el
@@ -176,11 +176,11 @@ the upstream."
(defun magit-push-current (target args)
"Push the current branch to a branch read in the minibuffer."
(interactive
- (if-let ((current (magit-get-current-branch)))
- (list (magit-read-remote-branch (format "Push %s to" current)
- nil nil current 'confirm)
- (magit-push-arguments))
- (user-error "No branch is checked out")))
+ (if-let ((current (magit-get-current-branch)))
+ (list (magit-read-remote-branch (format "Push %s to" current)
+ nil nil current 'confirm)
+ (magit-push-arguments))
+ (user-error "No branch is checked out")))
(magit-git-push (magit-get-current-branch) target args))
;;;###autoload
@@ -188,18 +188,18 @@ the upstream."
"Push an arbitrary branch or commit somewhere.
Both the source and the target are read in the minibuffer."
(interactive
- (let ((source (magit-read-local-branch-or-commit "Push")))
- (list source
- (magit-read-remote-branch
- (format "Push %s to" source) nil
- (cond ((magit-local-branch-p source)
- (or (magit-get-push-branch source)
- (magit-get-upstream-branch source)))
- ((magit-rev-ancestor-p source "HEAD")
- (or (magit-get-push-branch)
- (magit-get-upstream-branch))))
- source 'confirm)
- (magit-push-arguments))))
+ (let ((source (magit-read-local-branch-or-commit "Push")))
+ (list source
+ (magit-read-remote-branch
+ (format "Push %s to" source) nil
+ (cond ((magit-local-branch-p source)
+ (or (magit-get-push-branch source)
+ (magit-get-upstream-branch source)))
+ ((magit-rev-ancestor-p source "HEAD")
+ (or (magit-get-push-branch)
+ (magit-get-upstream-branch))))
+ source 'confirm)
+ (magit-push-arguments))))
(magit-git-push source target args))
(defvar magit-push-refspecs-history nil)
@@ -212,12 +212,12 @@ use multiple REFSPECS, separate them with commas. Completion is
only available for the part before the colon, or when no colon
is used."
(interactive
- (list (magit-read-remote "Push to remote")
- (magit-completing-read-multiple
- "Push refspec,s: "
- (cons "HEAD" (magit-list-local-branch-names))
- nil 'any nil 'magit-push-refspecs-history)
- (magit-push-arguments)))
+ (list (magit-read-remote "Push to remote")
+ (magit-completing-read-multiple
+ "Push refspec,s: "
+ (cons "HEAD" (magit-list-local-branch-names))
+ nil 'any nil 'magit-push-refspecs-history)
+ (magit-push-arguments)))
(run-hooks 'magit-credential-hook)
(magit-run-git-async "push" "-v" args remote refspecs))
@@ -246,9 +246,9 @@ branch as default."
(defun magit-push-tag (tag remote &optional args)
"Push a tag to another repository."
(interactive
- (let ((tag (magit-read-tag "Push tag")))
- (list tag (magit-read-remote (format "Push %s to remote" tag) nil t)
- (magit-push-arguments))))
+ (let ((tag (magit-read-tag "Push tag")))
+ (list tag (magit-read-remote (format "Push %s to remote" tag) nil t)
+ (magit-push-arguments))))
(run-hooks 'magit-credential-hook)
(magit-run-git-async "push" remote tag args))
@@ -256,10 +256,10 @@ branch as default."
(defun magit-push-notes-ref (ref remote &optional args)
"Push a notes ref to another repository."
(interactive
- (let ((note (magit-notes-read-ref "Push notes")))
- (list note
- (magit-read-remote (format "Push %s to remote" note) nil t)
- (magit-push-arguments))))
+ (let ((note (magit-notes-read-ref "Push notes")))
+ (list note
+ (magit-read-remote (format "Push %s to remote" note) nil t)
+ (magit-push-arguments))))
(run-hooks 'magit-credential-hook)
(magit-run-git-async "push" remote ref args))
diff --git a/lisp/magit-remote.el b/lisp/magit-remote.el
index 770a708..60dee8b 100644
--- a/lisp/magit-remote.el
+++ b/lisp/magit-remote.el
@@ -98,15 +98,15 @@ has to be used to view and change remote related variables."
(defun magit-remote-add (remote url &optional args)
"Add a remote named REMOTE and fetch it."
(interactive
- (let ((origin (magit-get "remote.origin.url"))
- (remote (magit-read-string-ns "Remote name")))
- (list remote
- (magit-read-url
- "Remote url"
- (and origin
- (string-match "\\([^:/]+\\)/[^/]+\\(\\.git\\)?\\'" origin)
- (replace-match remote t t origin 1)))
- (transient-args 'magit-remote))))
+ (let ((origin (magit-get "remote.origin.url"))
+ (remote (magit-read-string-ns "Remote name")))
+ (list remote
+ (magit-read-url
+ "Remote url"
+ (and origin
+ (string-match "\\([^:/]+\\)/[^/]+\\(\\.git\\)?\\'" origin)
+ (replace-match remote t t origin 1)))
+ (transient-args 'magit-remote))))
(if (pcase (list magit-remote-add-set-remote.pushDefault
(magit-get "remote.pushDefault"))
(`(,(pred stringp) ,_) t)
@@ -121,8 +121,8 @@ has to be used to view and change remote related variables."
(defun magit-remote-rename (old new)
"Rename the remote named OLD to NEW."
(interactive
- (let ((remote (magit-read-remote "Rename remote")))
- (list remote (magit-read-string-ns (format "Rename %s to" remote)))))
+ (let ((remote (magit-read-remote "Rename remote")))
+ (list remote (magit-read-string-ns (format "Rename %s to" remote)))))
(unless (string= old new)
(magit-call-git "remote" "rename" old new)
(magit-remote--cleanup-push-variables old new)
@@ -239,11 +239,11 @@ accordingly. With a prefix argument query for the branch to be
used, which allows you to select an incorrect value if you fancy
doing that."
(interactive
- (let ((remote (magit-read-remote "Set HEAD for remote")))
- (list remote
- (and current-prefix-arg
- (magit-read-remote-branch (format "Set %s/HEAD to" remote)
- remote nil nil t)))))
+ (let ((remote (magit-read-remote "Set HEAD for remote")))
+ (list remote
+ (and current-prefix-arg
+ (magit-read-remote-branch (format "Set %s/HEAD to" remote)
+ remote nil nil t)))))
(magit-run-git "remote" "set-head" remote (or branch "--auto")))
;;;###autoload
@@ -318,11 +318,11 @@ refspec."
("S" magit-remote.<remote>.push)
("O" magit-remote.<remote>.tagopt)]
(interactive
- (list (or (and (not current-prefix-arg)
- (not (and magit-remote-direct-configure
- (eq transient-current-command 'magit-remote)))
- (magit-get-current-remote))
- (magit--read-remote-scope))))
+ (list (or (and (not current-prefix-arg)
+ (not (and magit-remote-direct-configure
+ (eq transient-current-command 'magit-remote)))
+ (magit-get-current-remote))
+ (magit--read-remote-scope))))
(transient-setup 'magit-remote-configure nil nil :scope remote))
(defun magit--read-remote-scope (&optional obj)
diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el
index 3702d4b..2a655dd 100644
--- a/lisp/magit-sequence.el
+++ b/lisp/magit-sequence.el
@@ -229,18 +229,18 @@ Remove the COMMITS from BRANCH and stay on the current branch.
If a conflict occurs, then you have to fix that and finish the
process manually."
(interactive
- (magit--cherry-move-read-args "harvest" nil
- (lambda (commits)
- (list (let ((branches (magit-list-containing-branches (car commits))))
- (pcase (length branches)
- (0 nil)
- (1 (car branches))
- (_ (magit-completing-read
- (let ((len (length commits)))
- (if (= len 1)
- "Remove 1 cherry from branch"
- (format "Remove %s cherries from branch" len)))
- branches nil t))))))))
+ (magit--cherry-move-read-args "harvest" nil
+ (lambda (commits)
+ (list (let ((branches (magit-list-containing-branches (car commits))))
+ (pcase (length branches)
+ (0 nil)
+ (1 (car branches))
+ (_ (magit-completing-read
+ (let ((len (length commits)))
+ (if (= len 1)
+ "Remove 1 cherry from branch"
+ (format "Remove %s cherries from branch" len)))
+ branches nil t))))))))
(magit--cherry-move commits branch (magit-get-current-branch) args nil t))
;;;###autoload
@@ -250,14 +250,14 @@ Remove COMMITS from the current branch and stay on that branch.
If a conflict occurs, then you have to fix that and finish the
process manually. `HEAD' is allowed to be detached initially."
(interactive
- (magit--cherry-move-read-args "donate" t
- (lambda (commits)
- (list (magit-read-other-branch
- (let ((len (length commits)))
- (if (= len 1)
- "Move 1 cherry to branch"
- (format "Move %s cherries to branch" len))))))
- 'allow-detached))
+ (magit--cherry-move-read-args "donate" t
+ (lambda (commits)
+ (list (magit-read-other-branch
+ (let ((len (length commits)))
+ (if (= len 1)
+ "Move 1 cherry to branch"
+ (format "Move %s cherries to branch" len))))))
+ 'allow-detached))
(magit--cherry-move commits
(or (magit-get-current-branch)
(magit-rev-parse "HEAD"))
diff --git a/lisp/magit-sparse-checkout.el b/lisp/magit-sparse-checkout.el
index c9e4c98..8a97624 100644
--- a/lisp/magit-sparse-checkout.el
+++ b/lisp/magit-sparse-checkout.el
@@ -82,12 +82,12 @@ See the `git sparse-checkout' manpage for details about
To extend rather than override the currently configured
directories, call `magit-sparse-checkout-add' instead."
(interactive
- (list (magit-completing-read-multiple
- "Include these directories: "
- ;; Note: Given that the appeal of sparse checkouts is
- ;; dealing with very large trees, listing all subdirectories
- ;; may need to be reconsidered.
- (magit-revision-directories "HEAD"))))
+ (list (magit-completing-read-multiple
+ "Include these directories: "
+ ;; Note: Given that the appeal of sparse checkouts is
+ ;; dealing with very large trees, listing all subdirectories
+ ;; may need to be reconsidered.
+ (magit-revision-directories "HEAD"))))
(magit-sparse-checkout--auto-enable)
(magit-run-git-async "sparse-checkout" "set" directories))
@@ -97,16 +97,16 @@ directories, call `magit-sparse-checkout-add' instead."
To override rather than extend the currently configured
directories, call `magit-sparse-checkout-set' instead."
(interactive
- (list (magit-completing-read-multiple
- "Add these directories: "
- ;; Same performance note as in `magit-sparse-checkout-set',
- ;; but even more so given the additional processing.
- (seq-remove
- (let ((re (concat
- "\\`"
- (regexp-opt (magit-sparse-checkout-directories)))))
- (##string-match-p re %))
- (magit-revision-directories "HEAD")))))
+ (list (magit-completing-read-multiple
+ "Add these directories: "
+ ;; Same performance note as in `magit-sparse-checkout-set',
+ ;; but even more so given the additional processing.
+ (seq-remove
+ (let ((re (concat
+ "\\`"
+ (regexp-opt (magit-sparse-checkout-directories)))))
+ (##string-match-p re %))
+ (magit-revision-directories "HEAD")))))
(magit-sparse-checkout--auto-enable)
(magit-run-git-async "sparse-checkout" "add" directories))
diff --git a/lisp/magit-stash.el b/lisp/magit-stash.el
index afa8809..b458b90 100644
--- a/lisp/magit-stash.el
+++ b/lisp/magit-stash.el
@@ -127,13 +127,13 @@ Untracked files are included according to infix arguments.
One prefix argument is equivalent to `--include-untracked'
while two prefix arguments are equivalent to `--all'."
(interactive
- (progn (when (and (magit-merge-in-progress-p)
- (not (magit-y-or-n-p "\
+ (progn (when (and (magit-merge-in-progress-p)
+ (not (magit-y-or-n-p "\
Stashing and resetting during a merge conflict. \
Applying the resulting stash won't restore the merge state. \
Proceed anyway? ")))
- (user-error "Abort"))
- (magit-stash-read-args)))
+ (user-error "Abort"))
+ (magit-stash-read-args)))
(magit-stash-save message t t include-untracked t))
;;;###autoload
@@ -370,9 +370,9 @@ want to fall back to using \"--3way\", without being prompted."
"Remove a stash from the stash list.
When the region is active offer to drop all contained stashes."
(interactive
- (list (if-let ((values (magit-region-values 'stash)))
- (magit-confirm 'drop-stashes nil "Drop %d stashes" nil values)
- (magit-read-stash "Drop stash"))))
+ (list (if-let ((values (magit-region-values 'stash)))
+ (magit-confirm 'drop-stashes nil "Drop %d stashes" nil values)
+ (magit-read-stash "Drop stash"))))
(dolist (stash (if (listp stash)
(nreverse (prog1 stash (setq stash (car stash))))
(list stash)))
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index 766e52a..6748c91 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -259,18 +259,18 @@ has to confirm that it should be reinitialized.
Non-interactively DIRECTORY is (re-)initialized unconditionally."
(interactive
- (let ((directory (file-name-as-directory
- (expand-file-name
- (read-directory-name "Create repository in: ")))))
- (when-let ((toplevel (magit-toplevel directory)))
- (setq toplevel (expand-file-name toplevel))
- (unless (y-or-n-p (if (file-equal-p toplevel directory)
- (format "Reinitialize existing repository %s? "
- directory)
- (format "%s is a repository. Create another in %s? "
- toplevel directory)))
- (user-error "Abort")))
- (list directory)))
+ (let ((directory (file-name-as-directory
+ (expand-file-name
+ (read-directory-name "Create repository in: ")))))
+ (when-let ((toplevel (magit-toplevel directory)))
+ (setq toplevel (expand-file-name toplevel))
+ (unless (y-or-n-p (if (file-equal-p toplevel directory)
+ (format "Reinitialize existing repository %s? "
+ directory)
+ (format "%s is a repository. Create another in %s? "
+ toplevel directory)))
+ (user-error "Abort")))
+ (list directory)))
;; `git init' does not understand the meaning of "~"!
(magit-call-git "init" (magit-convert-filename-for-git
(expand-file-name directory)))
@@ -310,12 +310,12 @@ prefix arguments:
then fall back to the same behavior as with two prefix
arguments."
(interactive
- (let ((magit--refresh-cache (list (cons 0 0))))
- (list (and (or current-prefix-arg (not (magit-toplevel)))
- (progn (magit--assert-usable-git)
- (magit-read-repository
- (>= (prefix-numeric-value current-prefix-arg) 16))))
- magit--refresh-cache)))
+ (let ((magit--refresh-cache (list (cons 0 0))))
+ (list (and (or current-prefix-arg (not (magit-toplevel)))
+ (progn (magit--assert-usable-git)
+ (magit-read-repository
+ (>= (prefix-numeric-value current-prefix-arg) 16))))
+ magit--refresh-cache)))
(let ((magit--refresh-cache (or cache (list (cons 0 0)))))
(if directory
(let ((toplevel (magit-toplevel directory)))
diff --git a/lisp/magit-submodule.el b/lisp/magit-submodule.el
index 9a7da87..f8316db 100644
--- a/lisp/magit-submodule.el
+++ b/lisp/magit-submodule.el
@@ -216,13 +216,13 @@ it is nil, then PATH also becomes the name."
:class 'magit--git-submodule-suffix
:description "Add git submodule add [--force]"
(interactive
- (magit-with-toplevel
- (let* ((url (magit-read-string-ns "Add submodule (remote url)"))
- (path (magit-submodule-read-path "Add submodules at path: " url)))
- (list url
- (directory-file-name path)
- (magit-submodule-read-name-for-path path)
- (magit-submodule-arguments "--force")))))
+ (magit-with-toplevel
+ (let* ((url (magit-read-string-ns "Add submodule (remote url)"))
+ (path (magit-submodule-read-path "Add submodules at path: " url)))
+ (list url
+ (directory-file-name path)
+ (magit-submodule-read-name-for-path path)
+ (magit-submodule-arguments "--force")))))
(magit-submodule-add-1 url path name args))
(defun magit-submodule-read-path (prompt url)
@@ -277,7 +277,7 @@ single module from the user."
;; the modules.
:description "Register git submodule init"
(interactive
- (list (magit-module-confirm "Register" 'magit-module-no-worktree-p)))
+ (list (magit-module-confirm "Register" 'magit-module-no-worktree-p)))
(magit-with-toplevel
(magit-run-git-async "submodule" "init" "--" modules)))
@@ -295,8 +295,8 @@ single module from the user."
:class 'magit--git-submodule-suffix
:description "Populate git submodule update --init [--recursive]"
(interactive
- (list (magit-module-confirm "Populate" 'magit-module-no-worktree-p)
- (magit-submodule-arguments "--recursive")))
+ (list (magit-module-confirm "Populate" 'magit-module-no-worktree-p)
+ (magit-submodule-arguments "--recursive")))
(magit-with-toplevel
(magit-run-git-async "submodule" "update" "--init" args "--" modules)))
@@ -316,10 +316,10 @@ single module from the user."
:description "Update git submodule update [--force] [--no-fetch]
[--remote] [--recursive] [--checkout|--rebase|--merge]"
(interactive
- (list (magit-module-confirm "Update" 'magit-module-worktree-p)
- (magit-submodule-arguments
- "--force" "--remote" "--recursive" "--checkout" "--rebase" "--merge"
- "--no-fetch")))
+ (list (magit-module-confirm "Update" 'magit-module-worktree-p)
+ (magit-submodule-arguments
+ "--force" "--remote" "--recursive" "--checkout" "--rebase" "--merge"
+ "--no-fetch")))
(magit-with-toplevel
(magit-run-git-async "submodule" "update" args "--" modules)))
@@ -334,8 +334,8 @@ single module from the user."
:class 'magit--git-submodule-suffix
:description "Synchronize git submodule sync [--recursive]"
(interactive
- (list (magit-module-confirm "Synchronize" 'magit-module-worktree-p)
- (magit-submodule-arguments "--recursive")))
+ (list (magit-module-confirm "Synchronize" 'magit-module-worktree-p)
+ (magit-submodule-arguments "--recursive")))
(magit-with-toplevel
(magit-run-git-async "submodule" "sync" args "--" modules)))
@@ -357,8 +357,8 @@ single module from the user."
:class 'magit--git-submodule-suffix
:description "Unpopulate git submodule deinit [--force]"
(interactive
- (list (magit-module-confirm "Unpopulate")
- (magit-submodule-arguments "--force")))
+ (list (magit-module-confirm "Unpopulate")
+ (magit-submodule-arguments "--force")))
(magit-with-toplevel
(magit-run-git-async "submodule" "deinit" args "--" modules)))
@@ -377,11 +377,11 @@ Both actions are very dangerous and have to be confirmed. There
are additional safety precautions in place, so you might be able
to recover from making a mistake here, but don't count on it."
(interactive
- (list (if-let ((modules (magit-region-values 'magit-module-section t)))
- (magit-confirm 'remove-modules nil "Remove %d modules" nil modules)
- (list (magit-read-module-path "Remove module")))
- (magit-submodule-arguments "--force")
- current-prefix-arg))
+ (list (if-let ((modules (magit-region-values 'magit-module-section t)))
+ (magit-confirm 'remove-modules nil "Remove %d modules" nil modules)
+ (list (magit-read-module-path "Remove module")))
+ (magit-submodule-arguments "--force")
+ current-prefix-arg))
(when magit-submodule-remove-trash-gitdirs
(setq trash-gitdirs t))
(magit-with-toplevel
diff --git a/lisp/magit-subtree.el b/lisp/magit-subtree.el
index ee36ae7..23f37ab 100644
--- a/lisp/magit-subtree.el
+++ b/lisp/magit-subtree.el
@@ -129,40 +129,40 @@
(defun magit-subtree-add (prefix repository ref args)
"Add REF from REPOSITORY as a new subtree at PREFIX."
(interactive
- (cons (magit-subtree-prefix 'magit-subtree-import "Add subtree")
- (let ((remote (magit-read-remote-or-url "From repository")))
- (list remote
- (magit-read-refspec "Ref" remote)
- (magit-subtree-arguments 'magit-subtree-import)))))
+ (cons (magit-subtree-prefix 'magit-subtree-import "Add subtree")
+ (let ((remote (magit-read-remote-or-url "From repository")))
+ (list remote
+ (magit-read-refspec "Ref" remote)
+ (magit-subtree-arguments 'magit-subtree-import)))))
(magit-git-subtree "add" prefix args repository ref))
;;;###autoload
(defun magit-subtree-add-commit (prefix commit args)
"Add COMMIT as a new subtree at PREFIX."
(interactive
- (list (magit-subtree-prefix 'magit-subtree-import "Add subtree")
- (magit-read-string-ns "Commit")
- (magit-subtree-arguments 'magit-subtree-import)))
+ (list (magit-subtree-prefix 'magit-subtree-import "Add subtree")
+ (magit-read-string-ns "Commit")
+ (magit-subtree-arguments 'magit-subtree-import)))
(magit-git-subtree "add" prefix args commit))
;;;###autoload
(defun magit-subtree-merge (prefix commit args)
"Merge COMMIT into the PREFIX subtree."
(interactive
- (list (magit-subtree-prefix 'magit-subtree-import "Merge into subtree")
- (magit-read-string-ns "Commit")
- (magit-subtree-arguments 'magit-subtree-import)))
+ (list (magit-subtree-prefix 'magit-subtree-import "Merge into subtree")
+ (magit-read-string-ns "Commit")
+ (magit-subtree-arguments 'magit-subtree-import)))
(magit-git-subtree "merge" prefix args commit))
;;;###autoload
(defun magit-subtree-pull (prefix repository ref args)
"Pull REF from REPOSITORY into the PREFIX subtree."
(interactive
- (cons (magit-subtree-prefix 'magit-subtree-import "Pull into subtree")
- (let ((remote (magit-read-remote-or-url "From repository")))
- (list remote
- (magit-read-refspec "Ref" remote)
- (magit-subtree-arguments 'magit-subtree-import)))))
+ (cons (magit-subtree-prefix 'magit-subtree-import "Pull into subtree")
+ (let ((remote (magit-read-remote-or-url "From repository")))
+ (list remote
+ (magit-read-refspec "Ref" remote)
+ (magit-subtree-arguments 'magit-subtree-import)))))
(magit-git-subtree "pull" prefix args repository ref))
;;;###autoload
diff --git a/lisp/magit-tag.el b/lisp/magit-tag.el
index 589ccc6..cd4ead9 100644
--- a/lisp/magit-tag.el
+++ b/lisp/magit-tag.el
@@ -91,26 +91,26 @@ defaulting to the tag at point.
(defun magit-tag-prune (tags remote-tags remote)
"Offer to delete tags missing locally from REMOTE, and vice versa."
(interactive
- (let* ((remote (magit-read-remote "Prune tags using remote"))
- (tags (magit-list-tags))
- (rtags (prog2 (message "Determining remote tags...")
- (magit-remote-list-tags remote)
- (message "Determining remote tags...done")))
- (ltags (cl-set-difference tags rtags :test #'equal))
- (rtags (cl-set-difference rtags tags :test #'equal)))
- (unless (or ltags rtags)
- (message "Same tags exist locally and remotely"))
- (unless (magit-confirm t
- "Delete %s locally"
- "Delete %d tags locally"
- 'noabort ltags)
- (setq ltags nil))
- (unless (magit-confirm t
- "Delete %s from remote"
- "Delete %d tags from remote"
- 'noabort rtags)
- (setq rtags nil))
- (list ltags rtags remote)))
+ (let* ((remote (magit-read-remote "Prune tags using remote"))
+ (tags (magit-list-tags))
+ (rtags (prog2 (message "Determining remote tags...")
+ (magit-remote-list-tags remote)
+ (message "Determining remote tags...done")))
+ (ltags (cl-set-difference tags rtags :test #'equal))
+ (rtags (cl-set-difference rtags tags :test #'equal)))
+ (unless (or ltags rtags)
+ (message "Same tags exist locally and remotely"))
+ (unless (magit-confirm t
+ "Delete %s locally"
+ "Delete %d tags locally"
+ 'noabort ltags)
+ (setq ltags nil))
+ (unless (magit-confirm t
+ "Delete %s from remote"
+ "Delete %d tags from remote"
+ 'noabort rtags)
+ (setq rtags nil))
+ (list ltags rtags remote)))
(when tags
(magit-call-git "tag" "-d" tags))
(when remote-tags
@@ -161,52 +161,52 @@ of the highest existing tag, provided that contains the corresponding
version string, and substituting the new version string for that. If
that is not the case, propose a message using a reasonable format."
(interactive
- (save-match-data
- (pcase-let*
- ((args (magit-tag-arguments))
- (`(,pver ,ptag ,pmsg) (car (magit--list-releases)))
- (msg (magit-rev-format "%s"))
- (ver (and (string-match magit-release-commit-regexp msg)
- (match-str 1 msg)))
- (_ (and (not ver)
- (require (quote sisyphus) nil t)
- (string-match magit-release-commit-regexp
- (magit-rev-format "%s" ptag))
- (user-error "Use `sisyphus-create-release' first")))
- (tag (cond
- ((not ptag)
- ;; Force the user to review the message used for the
- ;; initial release tag, in case they do not like the
- ;; default format.
- (cl-pushnew "--edit" args :test #'equal)
- (read-string "Create first release tag: "
- (if (and ver (string-match-p "\\`[0-9]" ver))
- (concat "v" ver)
- ver)))
- (ver
- (concat (and (string-match magit-release-tag-regexp ptag)
- (match-str 1 ptag))
- ver))
- ((read-string (format "Create release tag (previous was %s): "
- ptag)
- ptag))))
- (ver (and (string-match magit-release-tag-regexp tag)
- (match-str 2 tag))))
- (list tag
- (and (seq-some (apply-partially
- #'string-match-p
- "\\`--\\(annotate\\|local-user\\|sign\\)")
- args)
- (cond ((and pver (string-match (regexp-quote pver) pmsg))
- (replace-match ver t t pmsg))
- ((and ptag (string-match (regexp-quote ptag) pmsg))
- (replace-match tag t t pmsg))
- ((format "%s %s"
- (capitalize
- (file-name-nondirectory
- (directory-file-name (magit-toplevel))))
- ver))))
- args))))
+ (save-match-data
+ (pcase-let*
+ ((args (magit-tag-arguments))
+ (`(,pver ,ptag ,pmsg) (car (magit--list-releases)))
+ (msg (magit-rev-format "%s"))
+ (ver (and (string-match magit-release-commit-regexp msg)
+ (match-str 1 msg)))
+ (_ (and (not ver)
+ (require (quote sisyphus) nil t)
+ (string-match magit-release-commit-regexp
+ (magit-rev-format "%s" ptag))
+ (user-error "Use `sisyphus-create-release' first")))
+ (tag (cond
+ ((not ptag)
+ ;; Force the user to review the message used for the
+ ;; initial release tag, in case they do not like the
+ ;; default format.
+ (cl-pushnew "--edit" args :test #'equal)
+ (read-string "Create first release tag: "
+ (if (and ver (string-match-p "\\`[0-9]" ver))
+ (concat "v" ver)
+ ver)))
+ (ver
+ (concat (and (string-match magit-release-tag-regexp ptag)
+ (match-str 1 ptag))
+ ver))
+ ((read-string (format "Create release tag (previous was %s): "
+ ptag)
+ ptag))))
+ (ver (and (string-match magit-release-tag-regexp tag)
+ (match-str 2 tag))))
+ (list tag
+ (and (seq-some (apply-partially
+ #'string-match-p
+ "\\`--\\(annotate\\|local-user\\|sign\\)")
+ args)
+ (cond ((and pver (string-match (regexp-quote pver) pmsg))
+ (replace-match ver t t pmsg))
+ ((and ptag (string-match (regexp-quote ptag) pmsg))
+ (replace-match tag t t pmsg))
+ ((format "%s %s"
+ (capitalize
+ (file-name-nondirectory
+ (directory-file-name (magit-toplevel))))
+ ver))))
+ args))))
(magit-run-git-with-editor "tag" args (and msg (list "-m" msg)) tag)
(set-process-sentinel
magit-this-process
diff --git a/lisp/magit-wip.el b/lisp/magit-wip.el
index da12fa1..b3fe233 100644
--- a/lisp/magit-wip.el
+++ b/lisp/magit-wip.el
@@ -307,9 +307,9 @@ With a negative prefix argument only show the worktree wip ref.
The absolute numeric value of the prefix argument controls how
many \"branches\" of each wip ref are shown."
(interactive
- (nconc (list (or (magit-get-current-branch) "HEAD"))
- (magit-log-arguments)
- (list (prefix-numeric-value current-prefix-arg))))
+ (nconc (list (or (magit-get-current-branch) "HEAD"))
+ (magit-log-arguments)
+ (list (prefix-numeric-value current-prefix-arg))))
(magit-wip-log branch args files count))
(defun magit-wip-log (branch args files count)
@@ -318,16 +318,16 @@ With a negative prefix argument only show the worktree wip ref.
The absolute numeric value of the prefix argument controls how
many \"branches\" of each wip ref are shown."
(interactive
- (nconc (list (magit-completing-read
- "Log branch and its wip refs"
- (nconc (magit-list-local-branch-names)
- (list "HEAD"))
- nil t nil 'magit-revision-history
- (or (magit-branch-at-point)
- (magit-get-current-branch)
- "HEAD")))
- (magit-log-arguments)
- (list (prefix-numeric-value current-prefix-arg))))
+ (nconc (list (magit-completing-read
+ "Log branch and its wip refs"
+ (nconc (magit-list-local-branch-names)
+ (list "HEAD"))
+ nil t nil 'magit-revision-history
+ (or (magit-branch-at-point)
+ (magit-get-current-branch)
+ "HEAD")))
+ (magit-log-arguments)
+ (list (prefix-numeric-value current-prefix-arg))))
(magit-log-setup-buffer (nconc (list branch)
(magit-wip-log-get-tips
(magit--wip-wtree-ref branch)
diff --git a/lisp/magit-worktree.el b/lisp/magit-worktree.el
index e8058f8..13007d5 100644
--- a/lisp/magit-worktree.el
+++ b/lisp/magit-worktree.el
@@ -143,11 +143,11 @@ just \"PREFIX_\". Always forward PROMPT as-is."
COMMIT may, but does not have to be, a local branch.
Interactively, use `magit-read-worktree-directory-function'."
(interactive
- (let ((commit (magit-read-branch-or-commit
- "In new worktree; checkout" nil
- (mapcar #'caddr (magit-list-worktrees)))))
- (list (magit--read-worktree-directory commit (magit-local-branch-p commit))
- commit)))
+ (let ((commit (magit-read-branch-or-commit
+ "In new worktree; checkout" nil
+ (mapcar #'caddr (magit-list-worktrees)))))
+ (list (magit--read-worktree-directory commit (magit-local-branch-p commit))
+ commit)))
(when (zerop (magit-run-git "worktree" "add"
(magit--expand-worktree directory) commit))
(magit-diff-visit-directory directory)))
@@ -157,11 +157,11 @@ Interactively, use `magit-read-worktree-directory-function'."
"Create a new BRANCH and check it out in a new worktree at DIRECTORY.
Interactively, use `magit-read-worktree-directory-function'."
(interactive
- (pcase-let
- ((`(,branch ,start-point)
- (magit-branch-read-args "In new worktree; checkout new branch")))
- (list (magit--read-worktree-directory branch t)
- branch start-point)))
+ (pcase-let
+ ((`(,branch ,start-point)
+ (magit-branch-read-args "In new worktree; checkout new branch")))
+ (list (magit--read-worktree-directory branch t)
+ branch start-point)))
(when (zerop (magit-run-git "worktree" "add" "-b" branch
(magit--expand-worktree directory) start-point))
(magit-diff-visit-directory directory)))
@@ -170,11 +170,11 @@ Interactively, use `magit-read-worktree-directory-function'."
(defun magit-worktree-move (worktree directory)
"Move existing WORKTREE directory to DIRECTORY."
(interactive
- (list (magit-completing-read "Move worktree"
- (cdr (magit-list-worktrees))
- nil t nil nil
- (magit-section-value-if 'worktree))
- (read-directory-name "Move worktree to: ")))
+ (list (magit-completing-read "Move worktree"
+ (cdr (magit-list-worktrees))
+ nil t nil nil
+ (magit-section-value-if 'worktree))
+ (read-directory-name "Move worktree to: ")))
(if (file-directory-p (expand-file-name ".git" worktree))
(user-error "You may not move the main working tree")
(let ((preexisting-directory (file-directory-p directory)))
@@ -194,10 +194,10 @@ Interactively, use `magit-read-worktree-directory-function'."
"Delete a worktree, defaulting to the worktree at point.
The primary worktree cannot be deleted."
(interactive
- (list (magit-completing-read "Delete worktree"
- (mapcar #'car (cdr (magit-list-worktrees)))
- nil t nil nil
- (magit-section-value-if 'worktree))))
+ (list (magit-completing-read "Delete worktree"
+ (mapcar #'car (cdr (magit-list-worktrees)))
+ nil t nil nil
+ (magit-section-value-if 'worktree))))
(if (file-directory-p (expand-file-name ".git" worktree))
(user-error "Deleting %s would delete the shared .git directory" worktree)
(let ((primary (file-name-as-directory (caar (magit-list-worktrees)))))
@@ -221,13 +221,13 @@ minibuffer. If the worktree at point is the one whose
status is already being displayed in the current buffer,
then show it in Dired instead."
(interactive
- (list (or (magit-section-value-if 'worktree)
- (magit-completing-read
- "Show status for worktree"
- (cl-delete (directory-file-name (magit-toplevel))
- (magit-list-worktrees)
- :test #'equal :key #'car)
- nil t))))
+ (list (or (magit-section-value-if 'worktree)
+ (magit-completing-read
+ "Show status for worktree"
+ (cl-delete (directory-file-name (magit-toplevel))
+ (magit-list-worktrees)
+ :test #'equal :key #'car)
+ nil t))))
(magit-diff-visit-directory worktree))
(defun magit--expand-worktree (directory)