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

Re: [ITCH] Specify refspec without remote

From
Jeff King <peff@peff.net>
Date
Apr 10, 2013, 20:05 UTC
Message-ID
<20130410200548.GC24177@sigill.intra.peff.net>
In-Reply-To
<CALkWK0k44+VnrGTXESdap2nRomdYH8xwz_T2JdhYtSrPR+89sw@mail.gmail.com>
On Thu, Apr 11, 2013 at 01:23:57AM +0530, Ramkumar Ramachandra wrote:
Show 10 quoted lines
> Ramkumar Ramachandra wrote:
> > 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, as Junio pointed out in a different email: a push.default
> set to anything except "current" is already nonsensical.  Why should
> "matching" branches be pushed to the remote that my current branch
> specifies?  That might well have their own branch.<name>.pushremote
> configured, which should be respected.

I'm not sure that it should be respected. "master" is short for "refs/heads/master:refs/heads/master", and does not mean "push master to where I have it configured to go" at all. That may be what the user means, but changing how "git push" works is going to create inconsistency with other cases.

Show 5 quoted lines
> We should fix this now.  I think the fault lies in the rather old
> design of push.default.  Do you have any suggestions as what would
> make sense here?  Ultimately, I think a git push; needs to pick
> remotes for each refspec separately.  The orthogonal design is
> definitely not right in my opinion.

Right, the example above might include multiple remotes if pushremote is respected. Or it might not come up with an answer at all for a tag. If you do:

  git push -- v1.2.3 master

where does v1.2.3 go? To remote.pushdefault? That seems simple and consistent, as there is no ref-specific pushremote defined. But I'd guess that the user probably _wanted_ it to go to branch.master.pushremote.

> As the author of branch.<name>.pushremote, I apologize for not having
> caught this earlier.  I've been using push.default = current for a
> long time, and don't often think about the other settings.

I don't think pushremote introduced the problem. It is much older than that, and dates back to respecting branch.*.remote at all for pushes, even though push.default=matching (and before we had push.default, it was always matching) does not have anything to do with the current branch.

-Peff
Previous: Jonathan NiederNext: Ramkumar Ramachandra
Message 40 of 68 in “[ITCH] Specify refspec without remote”
  1. Ramkumar RamachandraMar 18, 2013
  2. Jeff KingMar 18, 2013
  3. Ramkumar RamachandraMar 19, 2013
  4. Jeff KingMar 19, 2013
  5. Duy NguyenMar 19, 2013
  6. Ramkumar RamachandraMar 19, 2013
  7. Duy NguyenMar 19, 2013
  8. Holger Hellmuth (IKS)Mar 19, 2013
  9. Holger Hellmuth (IKS)Mar 19, 2013
  10. Junio C HamanoMar 19, 2013
  11. Junio C HamanoMar 19, 2013
  12. Ramkumar RamachandraApr 9, 2013
  13. Junio C HamanoApr 9, 2013
  14. Ramkumar RamachandraApr 9, 2013
  15. Junio C HamanoApr 9, 2013
  16. Ramkumar RamachandraApr 9, 2013
  17. Ramkumar RamachandraApr 9, 2013
  18. Junio C HamanoApr 9, 2013
  19. Jonathan NiederApr 9, 2013
  20. Jonathan NiederApr 9, 2013
  21. Junio C HamanoApr 10, 2013
  22. Jeff KingApr 10, 2013
  23. Junio C HamanoApr 10, 2013
  24. Jeff KingApr 10, 2013
  25. Junio C HamanoApr 10, 2013
  26. Jeff KingApr 10, 2013
  27. Ramkumar RamachandraApr 10, 2013
  28. Ramkumar RamachandraApr 10, 2013
  29. Jeff KingApr 10, 2013
  30. Ramkumar RamachandraApr 10, 2013
  31. Jeff KingApr 10, 2013
  32. Ramkumar RamachandraApr 10, 2013
  33. Ramkumar RamachandraApr 10, 2013
  34. Ramkumar RamachandraApr 10, 2013
  35. Junio C HamanoApr 10, 2013
  36. Ramkumar RamachandraApr 10, 2013
  37. Jonathan NiederApr 10, 2013
  38. Jeff KingApr 10, 2013
  39. Jonathan NiederApr 10, 2013
  40. Jeff KingApr 10, 2013
  41. Ramkumar RamachandraApr 10, 2013
  42. Jeff KingApr 10, 2013
  43. Ramkumar RamachandraApr 10, 2013
  44. Jeff KingApr 10, 2013
  45. Ramkumar RamachandraApr 10, 2013
  46. Jonathan NiederApr 10, 2013
  47. Ramkumar RamachandraApr 10, 2013
  48. Jonathan NiederApr 10, 2013
  49. Ramkumar RamachandraApr 10, 2013
  50. Jeff KingApr 10, 2013
  51. Ramkumar RamachandraApr 10, 2013
  52. Jeff KingApr 10, 2013
  53. Ramkumar RamachandraApr 10, 2013
  54. Jeff KingApr 10, 2013
  55. Ramkumar RamachandraApr 10, 2013
  56. Ramkumar RamachandraApr 11, 2013
  57. Ramkumar RamachandraApr 11, 2013
  58. Junio C HamanoApr 11, 2013
  59. Ramkumar RamachandraApr 13, 2013
  60. Junio C HamanoApr 10, 2013
  61. Ramkumar RamachandraApr 10, 2013
  62. Junio C HamanoApr 12, 2013
  63. Jeff KingApr 10, 2013
  64. Ramkumar RamachandraApr 10, 2013
  65. Jeff KingApr 10, 2013
  66. Junio C HamanoApr 10, 2013
  67. Jeff KingApr 10, 2013
  68. Ramkumar RamachandraApr 10, 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.