git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] push: introduce implicit push

From
John Keeping <john@keeping.me.uk>
Date
Apr 15, 2013, 08:35 UTC
Message-ID
<20130415083558.GB2278@serenity.lan>
In-Reply-To
<7vzjx01cqn.fsf@alter.siamese.dyndns.org>
On Mon, Apr 15, 2013 at 12:20:32AM -0700, Junio C Hamano wrote:
Show 18 quoted lines
> Johannes Sixt <j.sixt@viscovery.net> writes:
> 
> > User says:
> >
> >    git push -- master docs release
> >
> > Then git pushes the three branches to three different upstreams. You find
> > that confusing. Do I understanding correctly so far?
> 
> It is far more subtle than that.  User says that while on 'next'
> branch.
> 
> The user has been trained to think "branch.master.remote" takes
> effect while he has "master" branch checked out.
> 
> That is where the possible confusion comes from. As I said number of
> times, you may be able to declare that the confusion is unfounded
> once you think it through.

I may be an atypical user, but my expectation currently is that branch.<name>.remote is what is used when I run "git push" with no additional arguments.

This is probably because whenever I add additional arguments (currently) I have to specify where I am pushing to.

So I think breaking user expectations is a red herring here because the current behaviour means that users cannot have any expectation of what will happen in this case. Either you don't say anything and "git push" DTRT for your current branch or you must specify precisely what you want to happen (or at least the remote to use if you have push.default = matching or remote.<name>.mirror set).

Personally I'd vote for "git push -- master" pushing to remote.pushdefault, but I really don't know how you handle "git push --" with the naïve implementation of that - is it the same as "git push" or "git push $(git config remote.pushdefault)"?

On the other hand, I'm really not sure how often I'd use this feature. Normally I just use "git push" and if I'm giving any more arguments than that then it's for something that I don't do often enough for it to be worth setting up configuration.

Previous: Junio C HamanoNext: Ramkumar Ramachandra
Message 10 of 21 in “push: introduce implicit push”
  1. push: introduce implicit pushRamkumar Ramachandra, Apr 12, 2013
  2. Junio C HamanoApr 12, 2013
  3. Ramkumar RamachandraApr 13, 2013
  4. Junio C HamanoApr 14, 2013
  5. Jakub NarębskiApr 14, 2013
  6. Ramkumar RamachandraApr 14, 2013
  7. Junio C HamanoApr 15, 2013
  8. Johannes SixtApr 15, 2013
  9. Junio C HamanoApr 15, 2013
  10. John KeepingApr 15, 2013
  11. Ramkumar RamachandraApr 15, 2013
  12. John KeepingApr 15, 2013
  13. Junio C HamanoApr 15, 2013
  14. Ramkumar RamachandraApr 15, 2013
  15. John KeepingApr 15, 2013
  16. Felipe ContrerasApr 15, 2013
  17. John KeepingApr 15, 2013
  18. Felipe ContrerasApr 15, 2013
  19. Ramkumar RamachandraApr 15, 2013
  20. Jonathan NiederApr 16, 2013
  21. Jonathan NiederApr 16, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.