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

Re: git pull for update of netdev fails.

From
Shawn Pearce <spearce@spearce.org>
Date
Sep 20, 2006, 16:59 UTC
Message-ID
<20060920165931.GE23260@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0609200902190.4388@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
Show 7 quoted lines
> The thing is, if you don't understand how rebasing etc destroys history, 
> you may do things like do a "git pull" or a "git merge" of a branch that 
> the other side WILL THROW AWAY! That will later result in major pain, 
> because when you then try to merge it later, you will get all kinds of 
> nasty behaviour, because the history you merged earlier no longer matches 
> the history you're now trying to merge again, and the work you merged 
> earlier is simply not there any more.

Yet people (typically those new to Git) will still pull or merge the wrong branch in, work on top of that merge, publish it, others will build on that... and wham; that topic branch head which you wanted to rebase prior to merging is now wedged 50 commits deep in your history.

Just yesterday I found such a case in a shared repository. Now I have a branch wedged in our shared mainline that I can't get out and shouldn't have been there in the first place.

If only the shared repository had a way of advising clients that commits stored in ref 'BAAAD' may not survive and thus shouldn't be merged. So that git-merge wouldn't let you merge them in. Unfortunately there isn't a way to do this that's sane so I'm not even going to try.

Probably what I should have done (now that I think about it) was to put a check into our update hook on the shared repository to look for a rebaseable branch (which are listed in some info file) being pushed into a non-rebaseable one. If that happens then abort the update.

Unfortunately our current Git client (1.4.2)/Git server version(1.3.1) combinations means we get no output from our update hook when it fails, so I can't tell the newbie what they did wrong.

-- 
Shawn.
Previous: Linus TorvaldsNext: Linus Torvalds
Message 37 of 43 in “git pull for update of netdev fails.”
  1. Stephen HemmingerSep 20, 2006
  2. Linus TorvaldsSep 20, 2006
  3. Petr BaudisSep 20, 2006
  4. Johannes SchindelinSep 20, 2006
  5. Petr BaudisSep 20, 2006
  6. Linus TorvaldsSep 20, 2006
  7. Linus TorvaldsSep 20, 2006
  8. Shawn PearceSep 20, 2006
  9. Linus TorvaldsSep 20, 2006
  10. Shawn PearceSep 20, 2006
  11. Johannes SchindelinSep 20, 2006
  12. Shawn PearceSep 20, 2006
  13. Johannes SchindelinSep 20, 2006
  14. Junio C HamanoSep 20, 2006
  15. Johannes SchindelinSep 20, 2006
  16. Shawn PearceSep 20, 2006
  17. Shawn PearceSep 20, 2006
  18. Shawn PearceSep 20, 2006
  19. Linus TorvaldsSep 20, 2006
  20. Johannes SchindelinSep 20, 2006
  21. Shawn PearceSep 20, 2006
  22. Johannes SchindelinSep 20, 2006
  23. Shawn PearceSep 20, 2006
  24. Jakub NarebskiSep 20, 2006
  25. Petr BaudisSep 23, 2006
  26. Shawn PearceSep 23, 2006
  27. Petr BaudisSep 23, 2006
  28. Catalin MarinasSep 23, 2006
  29. Catalin MarinasSep 23, 2006
  30. Petr BaudisSep 24, 2006
  31. Catalin MarinasSep 25, 2006
  32. Junio C HamanoSep 20, 2006
  33. Petr BaudisSep 20, 2006
  34. Linus TorvaldsSep 20, 2006
  35. Jakub NarebskiSep 20, 2006
  36. Linus TorvaldsSep 20, 2006
  37. Shawn PearceSep 20, 2006
  38. Linus TorvaldsSep 20, 2006
  39. Krzysztof HalasaSep 20, 2006
  40. Petr BaudisSep 23, 2006
  41. Jakub NarebskiSep 20, 2006
  42. Johannes SchindelinSep 21, 2006
  43. Jeff GarzikSep 20, 2006

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.