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

Re: [ITCH] Specify refspec without remote

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 11, 2013, 21:40 UTC
Message-ID
<7vppy0hhk7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CALkWK0nvTisYCFjxwuGaBbWawwBahzeBHZ84rFkUYL8sjJuxvw@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 11 quoted lines
> Let us imagine that origin points to git/git.git (upstream), ram
> points to artagnon/git.git and peff points to peff/git.git.  I fork
> off from upstream and have various local branches that only have
> corresponding refs in ram (say implicit-push).  Then, you fork off
> from me, and have various local branches that only have corresponding
> refs in peff (say implicit-push-next).  I have peff as a configured
> remote, because I routinely review the changes you make to my fork.
> In this case, I must have:
>
> - push.default set to anything but matching, because matching makes no
> sense in the multiple-remote scenario*.

The "matching" style makes sense only when pushing to your default publishing repository, _and_ your work style is to finish working on all branches that matter before pushing things out. Instead of keeping a configuration file on your local end that says "here are the branches I want to publish", you let the remote side remember them for you.

When pushing into other kinds of repositories (e.g. you can update some but not all of the branches, or you want to touch only some of them and not others even if you have enough privilege to update any of them) or when you do not "batch" and push out one branch as work on it is done, while other branches that you would eventually publish are still not ready, "matching" is not for you.

> - remote.default set to origin, because this is where I get new code
> from for all branches.
OK.
> - remote.pushdefault set to ram, because this is where I publish all
> my refs to (whether branches or tags).  I might have local branches
> that I will never publish, but that's a separate issue.  The point is
> that all my tags will always be published here.
Makes sense.  The variable is to name such a publishing location.
> - branch.implicit-push.remote set to ram, because this is the correct
> upstream for the implicit-push branch.

If "implicit-push" branch at "ram" is updated by other people and you may have to pull back from, you would need this for "git pull" (without arguments) while on that branch, I guess. But I got the impression from your scenario that "ram" won't be updated by anybody but you.

So I am guessing that this may not be needed.
> - branch.implicit-push-next.remote set to peff, because this is the
> correct upstream for the implicit-push-next branch.
Makes sense.  You are building on top of his work.
> - branch.implicit-push-next.pushremote set to null**, because I will
> never want to push this branch.

This becomes necessary only if you use push.default set to "current" (or "upstream"). If you mistakenly say "git push" (no other arguments), without this configuration you will end up pushing the branch out.

With "matching", because "ram" would not have this branch (you decided not to publish it), "git push" on this branch won't push it out.

It may be that adding push.default=current-but-do-not-create-anew could help. It is a cross between 'matching' and 'current', to say "consider pushing out the current one, but only when the other side already has one", and may help people who do not "batch".

> (Note that branch.implicit-push.pushremote is unnecessary because
> remote.pushdefault takes care of that)
True.
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 58 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.