update packages and add valign
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
;;; magit-push.el --- Update remote objects and refs -*- lexical-binding:t -*-
|
||||
|
||||
;; Copyright (C) 2008-2025 The Magit Project Contributors
|
||||
;; Copyright (C) 2008-2026 The Magit Project Contributors
|
||||
|
||||
;; Author: Jonas Bernoulli <emacs.magit@jonas.bernoulli.dev>
|
||||
;; Maintainer: Jonas Bernoulli <emacs.magit@jonas.bernoulli.dev>
|
||||
@@ -100,14 +100,14 @@ argument the push-remote can be changed before pushed to it."
|
||||
(remote (magit-get-push-remote branch))
|
||||
(v (magit--push-remote-variable branch t)))
|
||||
(cond
|
||||
(target)
|
||||
((member remote (magit-list-remotes))
|
||||
(format "%s, creating it"
|
||||
(magit--propertize-face (concat remote "/" branch)
|
||||
'magit-branch-remote)))
|
||||
(remote
|
||||
(format "%s, replacing invalid" v))
|
||||
((format "%s, setting that" v)))))
|
||||
(target)
|
||||
((member remote (magit-list-remotes))
|
||||
(format "%s, creating it"
|
||||
(magit--propertize-face (concat remote "/" branch)
|
||||
'magit-branch-remote)))
|
||||
(remote
|
||||
(format "%s, replacing invalid" v))
|
||||
((format "%s, setting that" v)))))
|
||||
|
||||
;;;###autoload(autoload 'magit-push-current-to-upstream "magit-push" nil t)
|
||||
(transient-define-suffix magit-push-current-to-upstream (args)
|
||||
@@ -160,27 +160,27 @@ the upstream."
|
||||
(merge (magit-get "branch" branch "merge"))
|
||||
(u (magit--propertize-face "@{upstream}" 'bold)))
|
||||
(cond
|
||||
((magit--unnamed-upstream-p remote merge)
|
||||
(format "%s as %s"
|
||||
(magit--propertize-face remote 'bold)
|
||||
(magit--propertize-face merge 'magit-branch-remote)))
|
||||
((magit--valid-upstream-p remote merge)
|
||||
(format "%s creating %s"
|
||||
(magit--propertize-face remote 'magit-branch-remote)
|
||||
(magit--propertize-face merge 'magit-branch-remote)))
|
||||
((or remote merge)
|
||||
(concat u ", creating it and replacing invalid"))
|
||||
((concat u ", creating it")))))))
|
||||
((magit--unnamed-upstream-p remote merge)
|
||||
(format "%s as %s"
|
||||
(magit--propertize-face remote 'bold)
|
||||
(magit--propertize-face merge 'magit-branch-remote)))
|
||||
((magit--valid-upstream-p remote merge)
|
||||
(format "%s creating %s"
|
||||
(magit--propertize-face remote 'magit-branch-remote)
|
||||
(magit--propertize-face merge 'magit-branch-remote)))
|
||||
((or remote merge)
|
||||
(concat u ", creating it and replacing invalid"))
|
||||
((concat u ", creating it")))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-push-current (target args)
|
||||
"Push the current branch to a branch read in the minibuffer."
|
||||
(interactive
|
||||
(if-let ((current (magit-get-current-branch)))
|
||||
(list (magit-read-remote-branch (format "Push %s to" current)
|
||||
nil nil current 'confirm)
|
||||
(magit-push-arguments))
|
||||
(user-error "No branch is checked out")))
|
||||
(if-let ((current (magit-get-current-branch)))
|
||||
(list (magit-read-remote-branch (format "Push %s to" current)
|
||||
nil nil current 'confirm)
|
||||
(magit-push-arguments))
|
||||
(user-error "No branch is checked out")))
|
||||
(magit-git-push (magit-get-current-branch) target args))
|
||||
|
||||
;;;###autoload
|
||||
@@ -188,18 +188,18 @@ the upstream."
|
||||
"Push an arbitrary branch or commit somewhere.
|
||||
Both the source and the target are read in the minibuffer."
|
||||
(interactive
|
||||
(let ((source (magit-read-local-branch-or-commit "Push")))
|
||||
(list source
|
||||
(magit-read-remote-branch
|
||||
(format "Push %s to" source) nil
|
||||
(cond ((magit-local-branch-p source)
|
||||
(or (magit-get-push-branch source)
|
||||
(magit-get-upstream-branch source)))
|
||||
((magit-rev-ancestor-p source "HEAD")
|
||||
(or (magit-get-push-branch)
|
||||
(magit-get-upstream-branch))))
|
||||
source 'confirm)
|
||||
(magit-push-arguments))))
|
||||
(let ((source (magit-read-local-branch-or-commit "Push")))
|
||||
(list source
|
||||
(magit-read-remote-branch
|
||||
(format "Push %s to" source) nil
|
||||
(cond ((magit-local-branch-p source)
|
||||
(or (magit-get-push-branch source)
|
||||
(magit-get-upstream-branch source)))
|
||||
((magit-rev-ancestor-p source "HEAD")
|
||||
(or (magit-get-push-branch)
|
||||
(magit-get-upstream-branch))))
|
||||
source 'confirm)
|
||||
(magit-push-arguments))))
|
||||
(magit-git-push source target args))
|
||||
|
||||
(defvar magit-push-refspecs-history nil)
|
||||
@@ -212,12 +212,12 @@ use multiple REFSPECS, separate them with commas. Completion is
|
||||
only available for the part before the colon, or when no colon
|
||||
is used."
|
||||
(interactive
|
||||
(list (magit-read-remote "Push to remote")
|
||||
(magit-completing-read-multiple
|
||||
"Push refspec,s: "
|
||||
(cons "HEAD" (magit-list-local-branch-names))
|
||||
nil 'any nil 'magit-push-refspecs-history)
|
||||
(magit-push-arguments)))
|
||||
(list (magit-read-remote "Push to remote")
|
||||
(magit-completing-read-multiple
|
||||
"Push refspec,s: "
|
||||
(cons "HEAD" (magit-list-local-branch-names))
|
||||
nil 'any nil 'magit-push-refspecs-history)
|
||||
(magit-push-arguments)))
|
||||
(run-hooks 'magit-credential-hook)
|
||||
(magit-run-git-async "push" "-v" args remote refspecs))
|
||||
|
||||
@@ -246,9 +246,9 @@ branch as default."
|
||||
(defun magit-push-tag (tag remote &optional args)
|
||||
"Push a tag to another repository."
|
||||
(interactive
|
||||
(let ((tag (magit-read-tag "Push tag")))
|
||||
(list tag (magit-read-remote (format "Push %s to remote" tag) nil t)
|
||||
(magit-push-arguments))))
|
||||
(let ((tag (magit-read-tag "Push tag")))
|
||||
(list tag (magit-read-remote (format "Push %s to remote" tag) nil t)
|
||||
(magit-push-arguments))))
|
||||
(run-hooks 'magit-credential-hook)
|
||||
(magit-run-git-async "push" remote tag args))
|
||||
|
||||
@@ -256,10 +256,10 @@ branch as default."
|
||||
(defun magit-push-notes-ref (ref remote &optional args)
|
||||
"Push a notes ref to another repository."
|
||||
(interactive
|
||||
(let ((note (magit-notes-read-ref "Push notes")))
|
||||
(list note
|
||||
(magit-read-remote (format "Push %s to remote" note) nil t)
|
||||
(magit-push-arguments))))
|
||||
(let ((note (magit-notes-read-ref "Push notes")))
|
||||
(list note
|
||||
(magit-read-remote (format "Push %s to remote" note) nil t)
|
||||
(magit-push-arguments))))
|
||||
(run-hooks 'magit-credential-hook)
|
||||
(magit-run-git-async "push" remote ref args))
|
||||
|
||||
@@ -300,12 +300,12 @@ what this command will do. To add it use something like:
|
||||
;; Note: Avoid `magit-get-remote' because it
|
||||
;; filters out the local repo case (".").
|
||||
(magit-get "branch" branch "remote")
|
||||
(cond-let
|
||||
[[remotes (magit-list-remotes)]]
|
||||
((and (magit-git-version>= "2.27")
|
||||
(length= remotes 1))
|
||||
(car remotes))
|
||||
((car (member "origin" remotes)))))))
|
||||
(cond-let
|
||||
[[remotes (magit-list-remotes)]]
|
||||
((and (magit-git-version>= "2.27")
|
||||
(length= remotes 1))
|
||||
(car remotes))
|
||||
((car (member "origin" remotes)))))))
|
||||
(if (null remote)
|
||||
"nothing (no remote)"
|
||||
(let ((refspec (magit-get "remote" remote "push")))
|
||||
@@ -326,17 +326,17 @@ what this command will do. To add it use something like:
|
||||
(format "%s to %s"
|
||||
(magit--propertize-face branch 'magit-branch-current)
|
||||
(cond
|
||||
((string-prefix-p "refs/heads/" ref)
|
||||
(magit--propertize-face
|
||||
(format "%s/%s" remote
|
||||
(substring ref (length "refs/heads/")))
|
||||
'magit-branch-remote))
|
||||
((not (string-match "/" ref))
|
||||
(magit--propertize-face (format "%s/%s" remote ref)
|
||||
'magit-branch-remote))
|
||||
((format "%s as %s"
|
||||
(magit--propertize-face remote 'bold)
|
||||
(magit--propertize-face ref 'bold)))))
|
||||
((string-prefix-p "refs/heads/" ref)
|
||||
(magit--propertize-face
|
||||
(format "%s/%s" remote
|
||||
(substring ref (length "refs/heads/")))
|
||||
'magit-branch-remote))
|
||||
((not (string-match "/" ref))
|
||||
(magit--propertize-face (format "%s/%s" remote ref)
|
||||
'magit-branch-remote))
|
||||
((format "%s as %s"
|
||||
(magit--propertize-face remote 'bold)
|
||||
(magit--propertize-face ref 'bold)))))
|
||||
"nothing (no upstream)")))
|
||||
("matching" (format "all matching to %s"
|
||||
(magit--propertize-face remote 'bold)))))))))
|
||||
@@ -374,6 +374,7 @@ You can add this command as a suffix using something like:
|
||||
;; ("and>" . "cond-let--and>")
|
||||
;; ("and-let" . "cond-let--and-let")
|
||||
;; ("if-let" . "cond-let--if-let")
|
||||
;; ("when$" . "cond-let--when$")
|
||||
;; ("when-let" . "cond-let--when-let")
|
||||
;; ("while-let" . "cond-let--while-let")
|
||||
;; ("match-string" . "match-string")
|
||||
|
||||
Reference in New Issue
Block a user