diff options
author | Kyle Meyer <kyle@kyleam.com> | 2018-08-04 10:17:40 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2018-12-09 12:30:26 -0500 |
commit | f068d95816878e4335f7ce293c2e93e639d5d197 (patch) | |
tree | 79e6c1af159ba1af1f5c793a50143b577c86b105 | |
parent | 6474a25cda7585a611172320b84a137e50749cfc (diff) | |
download | emacs.d-f068d95816878e4335f7ce293c2e93e639d5d197.tar.gz |
Delete some infrequently used custom Magit commands
I used many of these heavily at some point, but due to some
combination of changes in my preferences/workflows and changes in
Magit, I rarely use any of these now.
-rw-r--r-- | init.el | 16 | ||||
-rw-r--r-- | lisp/km-magit.el | 65 |
2 files changed, 1 insertions, 80 deletions
@@ -1171,10 +1171,6 @@ (magit-define-popup-action 'magit-commit-popup ?u "Auto commit" #'km/magit-update-or-auto-commit) - (magit-define-popup-action 'magit-push-popup - ?a "Push all" #'km/magit-push-all) - (magit-define-popup-action 'magit-push-popup - ?h "Push HEAD" #'km/magit-push-head) (magit-change-popup-key 'magit-push-popup :action ?u ?U) (magit-change-popup-key 'magit-push-popup :action @@ -1198,21 +1194,11 @@ ?e "Edit message" #'km/magit-stash-edit-message) (magit-define-popup-action 'magit-branch-popup - ?K "Delete previous branch" #'km/magit-delete-previous-branch) - (magit-define-popup-action 'magit-branch-popup ?m "Checkout master" #'km/magit-checkout-master) (magit-define-popup-action 'magit-branch-popup - ?n "Checkout recent ref" #'km/magit-checkout-recent-ref) - (magit-define-popup-action 'magit-branch-popup - ?N "Track recent ref" #'km/magit-checkout-track-recent-ref) - (magit-define-popup-action 'magit-branch-popup - ?l "Checkout previous" #'km/magit-checkout-previous-branch) - (magit-define-popup-action 'magit-branch-popup ?r "Rename branch" #'km/magit-branch-rename) (magit-define-popup-action 'magit-branch-popup - ?s "Backup current branch" #'km/magit-branch-backup-current) - (magit-define-popup-action 'magit-branch-popup - ?t "Local tracking" #'km/magit-checkout-local-tracking)) + ?s "Backup current branch" #'km/magit-branch-backup-current)) (use-package magit-annex :load-path "~/src/emacs/magit-annex/" diff --git a/lisp/km-magit.el b/lisp/km-magit.el index 663fcde..69f5f2b 100644 --- a/lisp/km-magit.el +++ b/lisp/km-magit.el @@ -146,30 +146,6 @@ namespace." ((magit-remote-branch-p rev) (format "Merge pull request #%s from %s" pr rev))))) -(defun km/magit-push-all () - "Push all branches." - (interactive) - (magit-run-git-async "push" "-v" - (magit-read-remote "Remote") - "--all")) - -(defun km/magit-push-head (remote &optional args) - "Push the current branch to same name on REMOTE. -\n(git push [ARGS] REMOTE HEAD)" - (interactive (list (magit-read-remote "Remote") (magit-push-arguments))) - (magit-run-git-async "push" "-v" args remote "HEAD")) - -(defun km/magit-checkout-local-tracking (remote-branch) - "Create and check out a local tracking branch for REMOTE-BRANCH. -\n(git checkout -t REMOTE-BRANCH\)" - (interactive - (list (let ((branches (magit-list-remote-branch-names))) - (magit-completing-read - "Remote branch" branches nil t nil nil - (car (member (magit-branch-or-commit-at-point) - branches)))))) - (magit-run-git "checkout" "-t" remote-branch)) - (defun km/magit-branch-rename (old new &optional force) "Like `magit-branch-rename', but use old branch as initial prompt." (interactive @@ -181,47 +157,6 @@ namespace." (unless (string= old new) (magit-run-git "branch" (if force "-M" "-m") old new))) -(defun km/magit-delete-previous-branch (&optional force) - "Delete the previous branch. -\n(git branch -d @{-1})" - (interactive "P") - (magit-run-git "branch" (if force "-D" "-d") "@{-1}")) - -(defun km/magit-checkout-previous-branch () - "Check out the previous branch. -\n(git checkout -)" - (interactive) - (magit-run-git "checkout" "-")) - -(defun km/magit-list-recent-refs (n &optional remote) - "List the N-most recent refs. -If REMOTE is non-nil, limit the results to remote refs." - (magit-git-lines - "for-each-ref" "--sort=-committerdate" "--format=%(refname:short)" - (format "--count=%s" n) - (if remote "refs/remotes" "refs/heads"))) - -(defun km/magit-checkout-recent-ref (n) - "Check out branch from N-most recent refs. -Refs are sorted by committer date." - (interactive (list (or (and current-prefix-arg - (prefix-numeric-value current-prefix-arg)) - 5))) - (magit-run-git "checkout" - (magit-completing-read - "Ref" (km/magit-list-recent-refs n)))) - -(defun km/magit-checkout-track-recent-ref (n) - "Create and check out a local tracking branch. -Listed refs are limited to th eN-most recent, sorted by committer -date." - (interactive (list (or (and current-prefix-arg - (prefix-numeric-value current-prefix-arg)) - 5))) - (magit-run-git "checkout" "-t" - (magit-completing-read - "Ref" (km/magit-list-recent-refs n 'remote)))) - (defun km/magit-checkout-master () "Check out master branch. \n(git checkout master)" |