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:28 UTC
Message-ID
<20060920162810.GB23260@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0609200915550.4388@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
Show 12 quoted lines
> On Wed, 20 Sep 2006, Petr Baudis wrote:
> > 
> >   I personally don't think "throwing away" history is an issue. You can
> > print the old sha1 and it is still in the database so you can recover
> > it.
> 
> No it isn't. Once you've lost the reference, you can't really depend on it 
> any more in the long run.
> 
> A lot of people do things like "git repack -a -d" by hand, and we've tried 
> to encourage people to do so in cron-jobs etc. We've even had patches 
> floating around that do it automatically after a pull.
Ouch.  That's really bad.
I knew it but didn't realize it until just now.
	git repack -a -d
	git branch -D foo
	git repack -a -d

and *poof* no foo. Even if you somehow have its SHA1 and haven't used `git prune` you still have just pruned the thing away and can't look it up anymore.

git branch -D is just the obvious way of doing it. git rebase is slightly less obvious for some people (perhaps more so for others). git fetch with a '+' in a Pull: line is even less obvious, especially if you have reflog enabled for exactly that reason.

So we've managed to encourage people to run prune without actually running prune. Should we just integrate prune and repack -a -d with the 'rm -rf /' command? Perhaps a kernel module at the VFS layer would do the trick? I hear we have some kernel folks nearby. :-)

-- 
Shawn.
Previous: Shawn PearceNext: Linus Torvalds
Message 18 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.