Additional proposed infix arguments and suffix commands

Jonas Bernoulli edited this page Nov 13, 2018 · 33 revisions

Sometimes a user suggests that some infix argument or suffix command be added to a popup and the maintainer decides otherwise, usually because he feels that would not serve all users well. In other case he might just want some time to consider the proposal, or would like to delay adding the argument or command, until some preparations are done. But fear not, you can usually just add it yourself.

How that is done is described in the Magit-Popup manual in the node Customizing existing popups.

I have been made aware that this text is not worded strongly enough. So let my cut the pleasantries and boldly state that nearly all "please add --foo" requests will be rejected. If after reading this, you still feel that informing me about --foo is necessary, then state in your post that you have read this (otherwise I will assume you didn't) and why --foo is more important than the arguments suggested and rejected earlier.

Magit is going to switch to magit-popup's successor transient very soon. Until that has happened all argument suggestions will be rejected.

When a suggestion is rejected, then the user is usually encouraged to add an entry here. These entries serve as examples and you might even discover a suggested binding that you like but didn't think of yourself.

Eventually this should become easier, see #2957 and #2993.

magit-log-popup

add argument --no-merges

(magit-define-popup-switch 'magit-log-popup
  ?m "Omit merge commits" "--no-merges")

Proposed in https://github.com/magit/magit/issues/2137.

add argument --date-order

(magit-define-popup-switch
  'magit-log-popup
  ?s "Always sort by date" "--date-order")

;; (add-to-list 'magit-log-arguments "--date-order")

The commented line would add the flag to the list of default arguments; you can use the switch to turn it off then.

Proposed only here.

add arguments --since and --until

This prompts for dates to filter the log using org-read-date calendar support.

(autoload 'org-read-date "org")

(defun magit-org-read-date (prompt &optional _default)
  (org-read-date 'with-time nil nil prompt))

(magit-define-popup-option 'magit-log-popup
  ?s "Since date" "--since=" #'magit-org-read-date)

(magit-define-popup-option 'magit-log-popup
  ?u "Until date" "--until=" #'magit-org-read-date)

Proposed only here.

add argument --first-parent

(magit-define-popup-switch
  'magit-log-popup
  ?1 "First parent" "--first-parent")

Proposed in https://github.com/magit/magit/pull/2538.

add an action to view the wip log

(magit-define-popup-action 'magit-log-popup
  ?w "Wip" 'magit-wip-log-current)

This displays a log of wip saves created with one of the Magit wip modes. Note that none of these modes is currently active by default, you must enable them explicitly in your config.

Proposed in https://github.com/magit/magit/issues/2151.

magit-commit-popup

add argument --date=

(magit-define-popup-option 'magit-commit-popup
  ?D "Override the author date" "--date=" #'read-from-minibuffer)

Proposed in https://github.com/magit/magit/issues/2307.

magit-dispatch-popup

add command magit-reset

(magit-define-popup-action 'magit-dispatch-popup
  ?x "Reset" 'magit-reset ?!)

Proposed in https://github.com/magit/magit/issues/2141.

magit-patch-popup

add argument --ignore-all-space

(magit-define-popup-switch 'magit-patch-popup ?w
  "Ignore all whitespace" "--ignore-all-space")

Proposed in https://github.com/magit/magit/issues/3304

magit-branch-popup

add command magit-branch-orphan

(magit-define-popup-action 'magit-branch-popup
  ?o "Checkout new orphan branch" 'magit-branch-orphan)

Proposed in https://github.com/magit/magit/pull/2030.

magit-push-popup

add argument --follow-tags

(magit-define-popup-switch 'magit-push-popup
  ?t "Follow tags" "--follow-tags")

Proposed in https://github.com/magit/magit/pull/2919.

magit-rebase-popup

add argument --gpg-sign=

(magit-define-popup-option 'magit-rebase-popup
  ?S "Sign using gpg" "--gpg-sign=" #'magit-read-gpg-secret-key)

Note: this is available by default in magit-commit-popup. --gpg-sign can also be added to merge, pull, am, and cherry-pick.

Proposed in https://github.com/magit/magit/pull/3509.

magit-file-popup

A few commands that operate on a single file exists, that are not bound anywhere. You might want to add them to magit-file-popup.

(magit-define-popup-action 'magit-file-popup
  ?R "Rename file" 'magit-file-rename)
(magit-define-popup-action 'magit-file-popup
  ?K "Delete file" 'magit-file-delete)
(magit-define-popup-action 'magit-file-popup
  ?U "Untrack file" 'magit-file-untrack)
(magit-define-popup-action 'magit-file-popup
  ?C "Checkout file" 'magit-file-checkout)
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.