Skip to content

Commit 7a3fe35

Browse files
author
Lluís Vilanova
committed
magit-stgit-read-patches: Add argument to control result match
1 parent b1452ca commit 7a3fe35

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

magit-stgit.el

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Any list in ARGS is flattened."
183183
original)
184184
sorted))
185185

186-
(defun magit-stgit-read-patches (use-region use-marks use-point prompt)
186+
(defun magit-stgit-read-patches (use-region use-marks use-point require-match prompt)
187187
"Return list of selected patches.
188188
If USE-REGION and there is an active region, return marked
189189
patches in it (if USE-MARKS), or all patches in the region if
@@ -201,7 +201,7 @@ PROMPT."
201201
(and use-marks
202202
(magit-stgit-patches-sorted magit-stgit-marked-patches))
203203
(list (or (and use-point (magit-section-when stgit-patch))
204-
(and prompt (magit-stgit-read-patch prompt t)))))))
204+
(and prompt (magit-stgit-read-patch prompt require-match)))))))
205205

206206
;;; Marking
207207

@@ -215,7 +215,7 @@ PROMPT."
215215
(defun magit-stgit-mark-add (patches)
216216
"Set mark of patches.
217217
See `magit-stgit-mark-toggle' for the meaning of PATCHES."
218-
(interactive (list (magit-stgit-read-patches t nil t "Patch name")))
218+
(interactive (list (magit-stgit-read-patches t nil t t "Patch name")))
219219
(mapc (lambda (patch)
220220
(add-to-list 'magit-stgit-marked-patches patch))
221221
patches)
@@ -226,7 +226,7 @@ See `magit-stgit-mark-toggle' for the meaning of PATCHES."
226226
(defun magit-stgit-mark-remove (patches)
227227
"Unset mark of patches.
228228
See `magit-stgit-mark-toggle' for the meaning of PATCHES."
229-
(interactive (list (magit-stgit-read-patches t nil t "Patch name")))
229+
(interactive (list (magit-stgit-read-patches t nil t t "Patch name")))
230230
(mapc (lambda (patch)
231231
(setq magit-stgit-marked-patches (delete patch magit-stgit-marked-patches)))
232232
patches)
@@ -240,7 +240,7 @@ If given, PATCHES specifies the patch names.
240240
Else, if there is an active region, toggles these.
241241
Else, if point is in an StGit section, toggles the patch at point.
242242
Else, asks the user for a patch name."
243-
(interactive (list (magit-stgit-read-patches t nil t "Patch name")))
243+
(interactive (list (magit-stgit-read-patches t nil t t "Patch name")))
244244
(mapc (lambda (patch)
245245
(if (magit-stgit-mark-contains patch)
246246
(magit-stgit-mark-remove (list patch))
@@ -317,7 +317,7 @@ Use ARGS to pass additional arguments."
317317
(defun magit-stgit-float (patches &rest args)
318318
"Float StGit PATCHES to the top.
319319
Use ARGS to pass additional arguments."
320-
(interactive (list (magit-stgit-read-patches t t t "Float patch")
320+
(interactive (list (magit-stgit-read-patches t t t t "Float patch")
321321
(magit-stgit-float-arguments)))
322322
(magit-run-stgit-and-mark-remove patches "float" args "--" patches))
323323

@@ -343,7 +343,7 @@ Use ARGS to pass additional arguments."
343343
(defun magit-stgit-sink (patches &rest args)
344344
"Sink StGit PATCHES deeper down the stack.
345345
Use ARGS to pass additional arguments."
346-
(interactive (list (magit-stgit-read-patches t t t "Sink patch")
346+
(interactive (list (magit-stgit-read-patches t t t t "Sink patch")
347347
(magit-stgit-sink-arguments)))
348348
(when (and (called-interactively-p 'any)
349349
(not magit-current-popup))
@@ -364,7 +364,7 @@ Use ARGS to pass additional arguments."
364364
;;;###autoload
365365
(defun magit-stgit-commit (patches &rest args)
366366
"Permanently store patches into the stack base."
367-
(interactive (list (magit-stgit-read-patches t t t nil)
367+
(interactive (list (magit-stgit-read-patches t t t t nil)
368368
(magit-stgit-commit-arguments)))
369369
(magit-run-stgit-and-mark-remove patches "commit" args "--" patches))
370370

@@ -436,7 +436,7 @@ into the series."
436436
"Delete StGit patches.
437437
Argument PATCHES is a list of patchnames.
438438
Use ARGS to pass additional arguments."
439-
(interactive (list (magit-stgit-read-patches t t t "Delete patch")
439+
(interactive (list (magit-stgit-read-patches t t t t "Delete patch")
440440
(magit-stgit-delete-arguments)))
441441
(when (and (called-interactively-p 'any)
442442
(not magit-current-popup)
@@ -464,14 +464,14 @@ Use ARGS to pass additional arguments."
464464
(defun magit-stgit-goto (patch &rest args)
465465
"Set PATCH as target of StGit push and pop operations.
466466
Use ARGS to pass additional arguments."
467-
(interactive (list (magit-stgit-read-patches nil nil t "Goto patch")
467+
(interactive (list (magit-stgit-read-patches nil nil t t "Goto patch")
468468
(magit-stgit-goto-arguments)))
469469
(magit-run-stgit "goto" patch args))
470470

471471
;;;###autoload
472472
(defun magit-stgit-show (patch)
473473
"Show diff of a StGit patch."
474-
(interactive (magit-stgit-read-patches nil nil t "Show patch"))
474+
(interactive (magit-stgit-read-patches nil nil t t "Show patch"))
475475
(magit-show-commit (magit-stgit-lines "id" patch)))
476476

477477
(magit-define-popup magit-stgit-undo-popup

0 commit comments

Comments
 (0)