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

Re: [PATCH 0/7] limit the usage of the default remote "origin" to the minimum

From
Jeff King <peff@peff.net>
Date
Apr 29, 2008, 19:35 UTC
Message-ID
<20080429193536.GA19340@sigill.intra.peff.net>
In-Reply-To
<cover.1209391614.git.bonzini@gnu.org>
On Mon, Apr 28, 2008 at 05:23:53PM +0200, Paolo Bonzini wrote:
Show 7 quoted lines
> Patches 1 to 4 deal with "git push".  The problem here is that the
> "magic" default operation ("git push sends to origin all refs that
> are already present there"), as of new, cannot be explained in the
> configuration, and this is fixed by patches 1 and 2.  Patch 1 adds a
> special push refspec meaning "consider all refs already on the remote",
> and patch 2 makes git-clone add one such line when it creates the
> origin remote.

I like patches 1 and 2. The principle of "remove defaults from code, and put them into the automatically generated config file" makes sense to me. It gives users an easy place to look to understand and change such behavior. So even without the rest of the patches, I think this is an improvement.

> Patch 3 could also be split out of this series.  It adds to "git-remote
> add" a new --push option, that sets up a push refspec for the newly
> created remote.

This feels a little wrong, since we treat push and fetch lines differently. That is, I can add just a fetch ("git remote add"), or both ("git remote add --push"), but not just a push. It seems like the concepts should be orthogonal to "git remote" (as they are in the config file).

Show 12 quoted lines
> Patch 4 is a reworking of my previous patch.  Instead of having "git
> push" push to "all mirrors plus the magic origin branch", it will
> push to "all remotes having a push refspec".  In the future, this
> will always include the origin branch because of patch 2, while
> right now the origin branch is still used if no remote has a
> push refspec (for backwards compatibility -- more discussion in the
> patch log message).
>
> This patch may cause incompatibilities to be warned about in
> the release notes.  Luckily, these incompatibilities only affect
> users that already know their way in .git/config, because no porcelain
> command creates push refspecs.

I think you understand the compatibility issues, but I think it needs to be not "warned in the release notes" but "warned in the release notes, followed by a period of adjustment, and then the change". And maybe it would even make sense to wait for a larger-number version change (like 1.6.0).

Show 6 quoted lines
> Patches 5 and 6 affect "git pull".  Pulling uses the magic origin branch
> less often, because branch.*.remote already establishes a saner default.
> Therefore, here we can actually warn and deprecate the misfeature for
> real (patch 6).  Patch 5 however is still needed, so that "git pull"
> itself decides when to use the magic "origin" branch instead of making
> the decision in "git fetch".
I agree that patch 5 is a reasonable cleanup, regardless.

I'm not sure about patch 6. What are the cases that can trigger this? I assume people still with ancient .git/remotes files? Are those actually deprecated?

Show 6 quoted lines
> Finally, patch 7 affects "git fetch".  As hinted earlier, I chose to
> duplicate the functionality already present in "git remote update"
> (for the case where remotes are not grouped), but the code is much
> simpler so there is no incentive (at least for now) in borrowing code
> from "git remote update" into "git fetch"---actually, as a cleanup
> it is maybe possible to borrow code in the other direction.

Again, I like this behavior just fine, but it probably needs a warning period and a major version bump.

> "BTW, I find myself decreasingly using "git fetch" in favor of "git
>  remote update" which handles fetching from multiple remotes."
> 	The series remove the need to switch from "git fetch" to
> 	"git remote update" as one learns the power of DVCS.
This was from me, and I do like this behavior better.
-Peff
Previous: Paolo BonziniNext: Alex Riesen
Message 68 of 74 in “make "git push" update origin and mirrors, "git push --mirror" update mirrors”
  1. make "git push" update origin and mirrors, "git push --mirror" update mirrorsPaolo Bonzini, Apr 26, 2008
  2. Shawn O. PearceApr 26, 2008
  3. Junio C HamanoApr 26, 2008
  4. Shawn O. PearceApr 27, 2008
  5. Shawn O. PearceApr 27, 2008
  6. Junio C HamanoApr 27, 2008
  7. Shawn O. PearceApr 27, 2008
  8. Junio C HamanoApr 27, 2008
  9. Paolo BonziniApr 27, 2008
  10. Jeff KingApr 28, 2008
  11. Paolo BonziniApr 28, 2008
  12. Jeff KingApr 28, 2008
  13. Jeff KingApr 28, 2008
  14. Paolo BonziniApr 28, 2008
  15. Johannes SchindelinApr 28, 2008
  16. Paolo BonziniApr 28, 2008
  17. Johannes SchindelinApr 28, 2008
  18. Shawn O. PearceApr 28, 2008
  19. Paolo BonziniApr 28, 2008
  20. Stephen R. van den BergApr 28, 2008
  21. Jeff KingApr 28, 2008
  22. Paolo BonziniApr 27, 2008
  23. Paolo BonziniApr 27, 2008
  24. 0/7 limit the usage of the default remote "origin" to the minimumPaolo Bonzini, Apr 28, 2008
  25. 1/7 add special "matching refs" refspecPaolo Bonzini, Apr 28, 2008
  26. 2/7 add push line in git-clonePaolo Bonzini, Apr 28, 2008
  27. 3/7 Add a --push option to "git-remote add"Paolo Bonzini, Apr 28, 2008
  28. 4/7 make "git push" update all push repositories.Paolo Bonzini, Apr 28, 2008
  29. 5/7 don't rely on zero-argument "git fetch" from within git pullPaolo Bonzini, Apr 28, 2008
  30. 6/7 warn on "git pull" without a given branch.<name>.remote valuePaolo Bonzini, Apr 28, 2008
  31. 7/7 make "git fetch" update all fetch repositoriesPaolo Bonzini, Apr 28, 2008
  32. Alex RiesenApr 28, 2008
  33. Paolo BonziniApr 28, 2008
  34. Alex RiesenApr 28, 2008
  35. Paolo BonziniApr 29, 2008
  36. Alex RiesenApr 29, 2008
  37. Andreas EricssonApr 29, 2008
  38. Paolo BonziniApr 29, 2008
  39. Johannes SchindelinApr 29, 2008
  40. Paolo BonziniApr 29, 2008
  41. Alex RiesenApr 29, 2008
  42. Paolo BonziniApr 29, 2008
  43. Andreas EricssonApr 29, 2008
  44. Paolo BonziniApr 29, 2008
  45. Andreas EricssonApr 29, 2008
  46. Paolo BonziniApr 29, 2008
  47. しらいしななこApr 29, 2008
  48. Alex RiesenApr 29, 2008
  49. Paolo BonziniApr 29, 2008
  50. Alex RiesenApr 29, 2008
  51. Paolo BonziniApr 29, 2008
  52. Alex RiesenApr 29, 2008
  53. Johannes SchindelinApr 29, 2008
  54. Jeff KingApr 29, 2008
  55. Junio C HamanoApr 29, 2008
  56. Paolo BonziniApr 30, 2008
  57. Johannes SchindelinApr 29, 2008
  58. Alex RiesenApr 29, 2008
  59. Junio C HamanoMay 1, 2008
  60. Paolo BonziniMay 6, 2008
  61. Paolo BonziniMay 14, 2008
  62. Junio C HamanoMay 14, 2008
  63. Paolo BonziniMay 14, 2008
  64. Junio C HamanoMay 14, 2008
  65. Paolo BonziniMay 14, 2008
  66. Junio C HamanoApr 30, 2008
  67. Paolo BonziniApr 30, 2008
  68. Jeff KingApr 29, 2008
  69. Alex RiesenApr 29, 2008
  70. Junio C HamanoApr 29, 2008
  71. Jeff KingApr 29, 2008
  72. Paolo BonziniApr 30, 2008
  73. Paolo BonziniApr 29, 2008
  74. Johannes SchindelinApr 29, 2008

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.