Thread (33 messages) flat view 33 messages, 4 authors, 2016-06-15

Re: [ITCH] Specify refspec without remote

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:56:46

Ramkumar Ramachandra wrote:
Ramkumar Ramachandra wrote:
quoted
git push -- master next; pushes to my current branch's
branch.<name>.pushremote?  Isn't that a disaster?
Actually, branch.<name>.pushremote already breaks the current design
in a way
I don't see a big problem here, actually.  What's so wrong with
branch.<name>.remote affecting what "git push" does?  If
branch.crazy-feature.remote is my-personal-remote and I run

	git push

and "[push] default = upstream", then it is obvious what the user
wanted to happen.  But what about when "[push] default = matching"?
Which of the following behaviors is correct?

 a) Error: you didn't tell me which remote to push to.
 b) Just behave like "git push my-personal-remote :".
 c) Ignore which branch is the current branch and behave like
    "git push origin :".

How about when "[push] default = current"?

Except that people might have scripts or habits tied to the current
behavior, any of (a), (b), and (c) sounds fine to me.  (b) is the
obvious choice for historical reasons.

Now if I rely on the proposed DWIM and run

	git push master

then the corresponding choices are:

 a) Error: you didn't tell me which remote to push to.
 b) Just behave like "git push my-personal-remote master".
 c) Behave like "git push origin master".
 
(b) is not a good choice there, but (a) and (c) look equally fine.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help