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

Re: git push (mis ?)behavior

From
Wincent Colaiuta <win@wincent.com>
Date
Oct 3, 2007, 10:25 UTC
Message-ID
<83C5420A-528A-43F0-AF8C-699B85B7AD95@wincent.com>
In-Reply-To
<buobqbgmv6z.fsf@dhapc248.dev.necel.com>
El 3/10/2007, a las 10:57, Miles Bader escribió:
Show 7 quoted lines
> To the extent that a command _is_ "dangerous", there's always a  
> tradeoff
> between convenience and "danger".  Some systems (e.g. those aimed at
> newbies) might have as a goal to do the absolute minimum with every
> command and always, always, err on the side of safety.  I don't  
> think git
> is that system.

While much of this debate can be shortcircuited simply by making the behaviour configurable, I would like to take you up on the point that you raise here.

If we're going to talk about what kind of system Git is then consider this:

- it's inherently distributed and this design actively encourages  
users to treat their local repositories as sandboxes where things are  
tried out, perfected, and then pushed out into the public via one  
means or another
- it's built from the ground up to be good at branching and merging;  
this, combined with my previous point, means that users are likely to  
have multiple heads and often some of them will be "works in  
progress" that aren't yet ready for publication

So it's in that light I see accidentally pushing more than you thought you would as "dangerous"; when you make this mistake you're basically making stuff available that's not yet ready for consumption, and by its nature this mistake is basically irreversible: you can't really "unpush" what you pushed, you can only push out additional amendments which correct it.

So, in this light, when you say:
> What's "dangerous" for newbies, often ends up being what doesn't
> correspond with their mental model.

I don't know how much it has to do with mental models. I think in this case it's a bit simpler than that where you make the mistake once or twice and very quickly learn that "git push" means "push what's in my repo", not "push only what's on my current branch". It's a *very* easy lesson to learn if you get burnt and hardly requires any adjustments to ones "mental model".

I personally would be in favour of changing the default because I tend to work on a particular branch at a time and then want to push *that* out -- generally I'm thinking about one general area or one task at a time, and that means one branch at a time; I almost never think along the lines of getting all my branches into shape at once and then pushing them out in a batch. I think this is more likely to be a common pattern, although obviously that remains speculation at this point.

Changing the default would be great for people like me; by not having to pass additional parameters to git-push I save some keystrokes. If I ever want to push everything an "--all" switch would do the job. But if people prefer to keep the old default then there'll be .gitconfig for people like me. In any case I think more people need to speak up on the topic so that we can find out what most people really think about changing the default.

Cheers, Wincent

Previous: Pierre HabouzitNext: Karl Hasselström
Message 24 of 40 in “git push (mis ?)behavior”
  1. Pierre HabouzitSep 27, 2007
  2. Wincent ColaiutaSep 27, 2007
  3. Benoit SIGOURESep 27, 2007
  4. Junio C HamanoSep 27, 2007
  5. Pierre HabouzitSep 27, 2007
  6. Steffen ProhaskaSep 28, 2007
  7. Pierre HabouzitSep 28, 2007
  8. Steffen ProhaskaSep 28, 2007
  9. Junio C HamanoSep 28, 2007
  10. Steffen ProhaskaSep 28, 2007
  11. Junio C HamanoSep 28, 2007
  12. Steffen ProhaskaSep 28, 2007
  13. Johannes SchindelinSep 28, 2007
  14. Jan HudecOct 9, 2007
  15. Steffen ProhaskaOct 9, 2007
  16. Wincent ColaiutaSep 28, 2007
  17. Miles BaderOct 3, 2007
  18. Junio C HamanoOct 3, 2007
  19. Wincent ColaiutaOct 3, 2007
  20. Miles BaderOct 3, 2007
  21. Pierre HabouzitOct 3, 2007
  22. Miles BaderOct 3, 2007
  23. Pierre HabouzitOct 3, 2007
  24. Wincent ColaiutaOct 3, 2007
  25. Karl HasselströmOct 3, 2007
  26. Junio C HamanoOct 3, 2007
  27. Wincent ColaiutaOct 3, 2007
  28. Karl HasselströmOct 3, 2007
  29. Johannes SchindelinOct 3, 2007
  30. Karl HasselströmOct 3, 2007
  31. Johannes SchindelinOct 3, 2007
  32. Pierre HabouzitOct 3, 2007
  33. Johannes SchindelinOct 3, 2007
  34. Karl HasselströmOct 3, 2007
  35. Steffen ProhaskaOct 4, 2007
  36. Wincent ColaiutaOct 4, 2007
  37. Steffen ProhaskaOct 4, 2007
  38. Wincent ColaiutaOct 4, 2007
  39. Wincent ColaiutaOct 3, 2007
  40. Benoit SIGOUREOct 3, 2007

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.