Hey,

alright, I've debugged this some more. 'magit-push' always calls 'git
push' with with an explicit branch name. However, magit-push also only
works with the current branch due to

  (let* ((branch (or (magit-get-current-branch)
                     (error "Don't push a detached head. That's gross.")))
   ...))

That got me thinking that removing 'branch' from the call to
'magit-run-git-async' might do exactly what I want: it tells git to push
the current branch to a specific remote (that part is left unchanged)
with default options. This causes git to parse
'remote.<remotename>.push' so that magit doesn't have to do that
itself.

The downside might be that pushing to a remote that hasn't been
configured yet might not work anymore because the 'git push' man page
seems to suggest that you have to provide both the 'remote' and
'refspec' parameters or none of them. I haven't tested this; perhaps
someone else knows more about git in this regard?

However, in the case that I'm pushing to a remote that I haven't
configured before magit might add 'branch' to 'magit-run-git-async'
again; but I'm really not that good of an elisp programmer to do that
myself. Sorry :(

Regards,
Mosu

-- 
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds

Reply via email to