Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Additional proposed infix arguments and suffix commands
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.
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
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.
(magit-define-popup-switch 'magit-log-popup ?m "Omit merge commits" "--no-merges")
Proposed in https://github.com/magit/magit/issues/2137.
(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.
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.
(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-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-define-popup-action 'magit-dispatch-popup ?x "Reset" 'magit-reset ?!)
Proposed in https://github.com/magit/magit/issues/2141.
(magit-define-popup-switch 'magit-patch-popup ?w "Ignore all whitespace" "--ignore-all-space")
Proposed in https://github.com/magit/magit/issues/3304
(magit-define-popup-action 'magit-branch-popup ?o "Checkout new orphan branch" 'magit-branch-orphan)
Proposed in https://github.com/magit/magit/pull/2030.
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-define-popup-option 'magit-rebase-popup ?S "Sign using gpg" "--gpg-sign=" #'magit-read-gpg-secret-key)
Note: this is available by default in
--gpg-sign can also be added to merge, pull, am, and cherry-pick.
Proposed in https://github.com/magit/magit/pull/3509.
A few commands that operate on a single file exists, that are not
bound anywhere. You might want to add them to
(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)