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

Re: [RFC PATCH] git push: Push nothing if no refspecs are given or configured

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 6, 2009, 17:17 UTC
Message-ID
<7vr61ash8o.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<m3r61aisdo.fsf@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> writes:
Show 14 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> ...
>> Speaking of which, Steffen (who cannot reply right now, since he is AFK 
>> for a while) had a patch to install "remote.<branch>.push = HEAD" with 
>> clone and remote.  Would that be better?
>
> Errr... I thought that "remote.<remotename>.push = HEAD" works?
>
> But note that "remote.<name>.push = HEAD" (push current branch only)
> and "remote.<name>.push = :" (push matching branches, i.e. curent
> behavior) works only if you have remote configured... "git push <URL>"
> won't be affected, and people (probably) would want to either have
> 'nothing' as default, or/and be able to configure it to nothing,
> current, or matching (at least).

When you and Dscho contradict with each other, I seem to end up agreeing with Dscho most of the time, but for this particular one, I completely agree with you.

I personally think Finn's suggested list is overengineered, and we should start with only three: "nothing", "current" (aka HEAD), and "matching". It is Ok to have a separate discussion to figure out what other default behaviours are desireable, but I think that should come after the dust settled from the transition, and more importantly, I think the other kinds of fine-tuned behaviour needs to be per-remote, and is not something the repository (or user) wide default push.default can cover.

In addition to your counterargument, clone to set up remote.*.push is introducing an inconsistency between existing and new repositories until the default is changed for everybody, and the recent trend is to avoid that kind of inconsistency. Steffen's patch _could_ use push.default to infer what kind of remote.*.push to set up when adding a remote (or when cloning, if you take push.default from $HOME/.gitconfig), but at that point it becomes a redundant information.

Previous: Jakub NarebskiNext: Johannes Schindelin
Message 13 of 23 in “git push: Push nothing if no refspecs are given or configured”
  1. git push: Push nothing if no refspecs are given or configuredFinn Arne Gangstad, Mar 5, 2009
  2. Sverre RabbelierMar 5, 2009
  3. Markus HeidelbergMar 5, 2009
  4. Markus HeidelbergMar 5, 2009
  5. Sverre RabbelierMar 5, 2009
  6. Johannes SchindelinMar 6, 2009
  7. Junio C HamanoMar 6, 2009
  8. Sverre RabbelierMar 6, 2009
  9. Finn Arne GangstadMar 6, 2009
  10. Johannes SchindelinMar 6, 2009
  11. Finn Arne GangstadMar 6, 2009
  12. Jakub NarebskiMar 6, 2009
  13. Junio C HamanoMar 6, 2009
  14. Johannes SchindelinMar 7, 2009
  15. Johannes SchindelinMar 6, 2009
  16. John TapsellMar 6, 2009
  17. Jakub NarebskiMar 6, 2009
  18. Junio C HamanoMar 5, 2009
  19. Johannes SchindelinMar 6, 2009
  20. Markus HeidelbergMar 9, 2009
  21. Johannes SchindelinMar 9, 2009
  22. Markus HeidelbergMar 9, 2009
  23. Jeff KingMar 9, 2009

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.