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

Re: Minor annoyance with git push

From
Jeff King <peff@peff.net>
Date
Feb 10, 2008, 23:29 UTC
Message-ID
<20080210232911.GA15313@sigill.intra.peff.net>
In-Reply-To
<7vzlu8cta1.fsf@gitster.siamese.dyndns.org>
On Sun, Feb 10, 2008 at 02:59:18PM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> > ... Are there any
> > other git commands which use non-HEAD branches that have not been
> > explicitly mentioned by the user?  I can think only of query-type
> > commands (like show-branch, or describe) that are non-state-changing.
> 
> That's an irrelevant comparison.  push and fetch have always
> been multi-branch operations by default from day one.  The issue
> is not HEAD vs non-HEAD.

I think "irrelevant" here is in the eye of the beholder. If you are coming from the perspective of "historical behavior" then the current behavior makes sense. If you are coming from the perspective of a user who does not typically do a lot of branching, then the behavior can be surprising. And I think there is anecdotal evidence that some users _do_ find this surprising. I have personally seen it, and I think even an experienced user like Martin is finding the behavior non-intuitive.

> You can argue that historically established practices do not
> matter at all (at least to new people), and I'd grant that it
> may be a valid argument.  But a change that breaks existing
> practices needs to be sold much more carefully.  I still do not
Agreed.
> understand what the opposition is to keep the current behaviour
> as the default and have a shorthand for the single head push
> accessible with a short and sweet "git push $there HEAD" (and
> default $there to 'origin' when missing).

I think the problem is that you are asking people with particular workflows to always remember to type something extra, and if they forget, you punish them by doing a potentially destructive operation (although admittedly, it is destructive only if you happen to be using "-f").

Show 7 quoted lines
> If you are introducing a new behaviour, there is no way the new
> behaviour can start out by replacing the longtime default.  It
> should start out as an option, and if it is a commonly useful
> option then make it an _easily accessible_ option.  And accept
> such an _enhancement_ sooner to help people who want such a
> behaviour sooner.  That would not hurt anybody but help
> (hopefully) many people, without downside.

I think we already have that option (as you mentioned): "git push $there HEAD". We can make it more easily accessible (as you have proposed): "git push HEAD" (though I still have some reservations about that). But none of that changes the fact that for some people's workflows, they will _always_ have to remember to add extra magic to the command line.

What I have proposed is adding a config option to make that option even more easily accessible. The only argument I have seen against that is "some users can't use other users' git setup". While this is a downside, I think this uncommon situation is outweighed by the very common situation of users using their _own_ git setups.

IOW, such an option makes a tradeoff. Users helping other users must explicitly say what they mean: "git push --matching" or "git push $there HEAD". But users using their own setups can use the shorthand "git push" to do what is most useful for their workflow. And I think we should optimize for the latter case, as it is much more common.

-Peff
Previous: Junio C Hamano
Message 71 of 71 in “Minor annoyance with git push”
  1. Martin LanghoffFeb 8, 2008
  2. Martin LanghoffFeb 8, 2008
  3. Junio C HamanoFeb 8, 2008
  4. Steffen ProhaskaFeb 9, 2008
  5. Junio C HamanoFeb 10, 2008
  6. Johannes SchindelinFeb 10, 2008
  7. Johannes SchindelinFeb 8, 2008
  8. Martin LanghoffFeb 8, 2008
  9. Mike HommeyFeb 8, 2008
  10. SeanFeb 8, 2008
  11. Steffen ProhaskaFeb 8, 2008
  12. Johannes SchindelinFeb 8, 2008
  13. Martin LanghoffFeb 8, 2008
  14. Johannes SchindelinFeb 8, 2008
  15. Jeff KingFeb 9, 2008
  16. Jeff KingFeb 9, 2008
  17. Johannes SchindelinFeb 9, 2008
  18. Jeff KingFeb 9, 2008
  19. Steffen ProhaskaFeb 9, 2008
  20. Jeff KingFeb 9, 2008
  21. Junio C HamanoFeb 9, 2008
  22. Jeff KingFeb 9, 2008
  23. Martin LanghoffFeb 9, 2008
  24. Johannes SchindelinFeb 9, 2008
  25. Junio C HamanoFeb 10, 2008
  26. Jeff KingFeb 10, 2008
  27. Johannes SchindelinFeb 10, 2008
  28. [RFC] checkout to notice forks (Re: Minor annoyance with git push)Junio C Hamano, Feb 17, 2008
  29. Daniel BarkalowFeb 17, 2008
  30. Junio C HamanoFeb 17, 2008
  31. Daniel BarkalowFeb 17, 2008
  32. Junio C HamanoFeb 17, 2008
  33. Daniel BarkalowFeb 17, 2008
  34. Jeff KingFeb 17, 2008
  35. Santi BéjarFeb 20, 2008
  36. Martin LanghoffFeb 19, 2008
  37. checkout: tone down the "forked status" diagnostic messagesJunio C Hamano, Feb 20, 2008
  38. Jeff KingFeb 21, 2008
  39. checkout: updates to tracking reportJunio C Hamano, Feb 21, 2008
  40. Jay SoffianFeb 21, 2008
  41. Daniel BarkalowFeb 21, 2008
  42. Jay SoffianFeb 21, 2008
  43. Steffen ProhaskaFeb 9, 2008
  44. Johannes SchindelinFeb 9, 2008
  45. Junio C HamanoFeb 10, 2008
  46. Johannes SchindelinFeb 10, 2008
  47. Jeff KingFeb 10, 2008
  48. Johannes SchindelinFeb 10, 2008
  49. Jeff KingFeb 10, 2008
  50. Johannes SchindelinFeb 10, 2008
  51. Jeff KingFeb 10, 2008
  52. Junio C HamanoFeb 20, 2008
  53. Johannes SchindelinFeb 20, 2008
  54. Jay SoffianFeb 20, 2008
  55. Johannes SchindelinFeb 20, 2008
  56. Steven WalterFeb 21, 2008
  57. Johannes SchindelinFeb 22, 2008
  58. Jeff KingFeb 20, 2008
  59. Junio C HamanoFeb 20, 2008
  60. Jeff KingFeb 20, 2008
  61. Jeff KingFeb 20, 2008
  62. Junio C HamanoFeb 20, 2008
  63. Jeff KingFeb 20, 2008
  64. Wincent ColaiutaFeb 10, 2008
  65. Steven WalterFeb 10, 2008
  66. Johannes SchindelinFeb 10, 2008
  67. Johannes SchindelinFeb 10, 2008
  68. Wincent ColaiutaFeb 10, 2008
  69. Jeff KingFeb 10, 2008
  70. Junio C HamanoFeb 10, 2008
  71. Jeff KingFeb 10, 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.