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

Re: [ITCH] Specify refspec without remote

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Apr 10, 2013, 20:41 UTC
Message-ID
<CALkWK0nfJezWbd3+VfA+DMqUNbekSJJJ539AmhQT37kkap_qeg@mail.gmail.com>
In-Reply-To
<20130410202105.GE24177@sigill.intra.peff.net>
Jeff King wrote:
Show 28 quoted lines
> On Thu, Apr 11, 2013 at 01:35:34AM +0530, Ramkumar Ramachandra wrote:
>
>> Jeff King wrote:
>> > Maybe. But no more so than the current:
>> >
>> >   git push
>> >
>> > which may also push master and next to the same remote.
>>
>> I would argue that this was not really a problem in practice, until I
>> introduced branch.<name>.pushremote.
>>
>> Let us imagine that I was working on artagnon/git.git (remote: ram), a
>> fork of git/git.git (remote: origin) earlier.  My fork contains the
>> link and implicit-push branches in addition to the master, next and pu
>> branches, which are present on both.  When I push from my
>> implicit-push branch with push.default = matching, I'm updating all
>> the matching refs on the remote ram (since branch.implicit-push.remote
>> is set to ram), which is fine.  Now, I git push while on branch
>> master.  My push is simply rejected, as I don't have write access to
>> the remote origin.
>>
>> This is designed exactly for the read-only upstream, read-write fork
>> scenario.  If I had write access to upstream (where we're essentially
>> regression to a centralized model), we'd have some major confusion.
>
> I don't see how pushremote changes that. It was already a problem with
> branch.*.remote, no?

Technically, it changes nothing. pushremote is only an enabler for more complex scenarios where git push; breaking user expectations is magnified.

According to me, what branch.<name>.pushremote suddenly starts supporting (apart from the use I intended for it) is each branch having different read/ write access. So, we're back to git.git where Junio has graciously given me write support to pu, but not next or master. So I set up branch.master.pushremote and branch.next.pushremote to ram and run git push; from pu. Disaster: the pu ref went through fine, but master and next failed to get pushed despite me specifying a proper pushremote for them.

Show 6 quoted lines
> I have a similar remote setup in my git.git repository. But all of my
> branch.*.remote variables point to origin, because my branches are based
> off of Junio's master. A matching push goes to the wrong place (and I
> have screwed it up many times; it is nice that I do not have write
> access to Junio's repository). The is broken without having pushremote
> at all (and the proper fix is your remote.pushdefault).
Yeah, I can't believe I lived without remote.pushdefault for this long.
Show 6 quoted lines
> If we are not going to break the existing behavior, I think it can be
> argued that consistency and simplicity of the rules is important, so the
> user can predict what will happen. But the more we discuss, the more I
> think we should simply change the current behavior (to stop respecting
> branch.* config with "matching"), which just seems wrong to me. Then we
> can be simple and consistent, and do what the user probably intended.

So there are some push.default options that respect branch.* config (ie. "current"), and others that don't (ie. "matching"). I would argue that push.default is badly designed to begin with, so the solution makes sense to me even if the patch is a bit of hack; we never guaranteed that the various push.default options respect the same configuration variables.

Previous: Jeff KingNext: Ramkumar Ramachandra
Message 32 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.