From 7c4d41965c8ab9e4c46d34a21dfb2690e0ba9fd4 Mon Sep 17 00:00:00 2001 From: vindarel Date: Wed, 20 Nov 2024 13:08:47 +0100 Subject: [PATCH] legit: don't shadow cl:push, add notification on git push --- extensions/legit/legit.lisp | 4 +++- extensions/legit/porcelain-git.lisp | 4 +--- extensions/legit/porcelain.lisp | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/extensions/legit/legit.lisp b/extensions/legit/legit.lisp index 7b7fbf7a5..850515ac9 100644 --- a/extensions/legit/legit.lisp +++ b/extensions/legit/legit.lisp @@ -700,7 +700,9 @@ Currently Git-only. Concretely, this calls Git with the -w option.") (define-command legit-push () () "Push changes to the current remote." (with-current-project (vcs) - (run-function (lambda () (lem/porcelain:push vcs))))) + (run-function (lambda () + (lem/porcelain:push-default vcs)) + :message "Done"))) (define-command legit-rebase-interactive () () "Rebase interactively, from the commit the point is on. diff --git a/extensions/legit/porcelain-git.lisp b/extensions/legit/porcelain-git.lisp index 2d4e30f42..d73cc0cbf 100644 --- a/extensions/legit/porcelain-git.lisp +++ b/extensions/legit/porcelain-git.lisp @@ -2,8 +2,6 @@ (:use :cl ;; let's import all the classes and methods defined in the main porcelain: :lem/porcelain) - ;; beware, we still shadow cl:push to have a "push" method: - (:shadow :push) (:import-from :trivial-types :proper-list) (:export :git-project-p) @@ -166,7 +164,7 @@ allows to learn about the file state: modified, deleted, ignored… " ;; xxx: recurse submodules, etc. (run-git (list "pull"))) -(defmethod push ((vcs vcs-git)) +(defmethod push-default ((vcs vcs-git)) (run-git (list "push"))) (defmethod current-branch ((vcs vcs-git)) diff --git a/extensions/legit/porcelain.lisp b/extensions/legit/porcelain.lisp index 50288571d..8999691c0 100644 --- a/extensions/legit/porcelain.lisp +++ b/extensions/legit/porcelain.lisp @@ -1,8 +1,6 @@ (uiop:define-package :lem/porcelain (:use :cl) - ;; beware, we shadow cl:push to have a "push" method: - (:shadow :push) (:import-from :trivial-types :proper-list) (:export @@ -19,7 +17,7 @@ :file-diff :latest-commits :pull - :push + :push-default :rebase-abort :rebase-continue :rebase-interactively @@ -237,10 +235,10 @@ M src/ext/porcelain.lisp (:method (vcs) (porcelain-error "lem/porcelain:pull not implemented for vcs ~a" (vcs-name vcs)))) -(defgeneric push (vcs) - (:documentation "Pushes to remotes") +(defgeneric push-default (vcs) + (:documentation "Pushes to default remote.") (:method (vcs) - (porcelain-error "lem/porcelain:push not implemented for vcs ~a" (vcs-name vcs)))) + (porcelain-error "lem/porcelain:push-default not implemented for vcs ~a" (vcs-name vcs)))) ;; Interactive rebase (defgeneric rebase-interactively (vcs &key from)