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

Re: irc usage..

From
Linus Torvalds <torvalds@osdl.org>
Date
May 22, 2006, 18:03 UTC
Message-ID
<Pine.LNX.4.64.0605221055270.3697@g5.osdl.org>
In-Reply-To
<e4stna$o1g$1@sea.gmane.org>
On Mon, 22 May 2006, Jakub Narebski wrote:
Show 13 quoted lines
>
> Linus Torvalds wrote:
> 
> >                       git repack -a
> >                       #
> >                       # Stupid sleep to make sure that nobody is still
> >                       # using any unpacked objects after the pack got
> >                       # generated
> >                       #
> >                       sleep 10
> >                       git prune-packed
> 
> Is it really necessary (on Linux at least)? Git boast it's atomicity...
I don't think it's necessary in practice.

But people _should_ realize that removing objects is very very special. Whether it's done by "git prune-packed" or "git prune", that's a very dangerous operations. "git prune" a lot more so than "git prune-packed", of course (in fact, you should _never_ run "git prune" on a repository that is active - you _will_ corrupt it)-

Doing "git prune-packed" _should_ be mostly safe on UNIX, since the objects all exist in packs, and anybody who already opened an object will keep the fd open, and not even notice that the name is gone. However, there is at least one race:

	object lookup			"git repack -a -d"
	=============			==================
 - a process does its object
   database setup. No new pack-file
   yet.
					 - mv tmp-packfile active-packfile
					 - git prune-packed
 - the process looks up the object,
   and doesn't look in the pack-file
   because it didn't see the pack-file.
   So it tries to look up an object,
   fails, and errors out.
   It's not a fatal error (just re-try)
   but it could break something like a
   cvsimport

Now, in PRACTICE, I doubt you'd ever hit this. But the fact is, pruning your repository (whether prune-packed or a full prune) is _the_ special operation. It's something that removes a filesystem representation of an object that is otherwise immutable.

		Linus
Previous: Jakub NarebskiNext: Matthias Lederhofer
Message 19 of 82 in “irc usage..”
  1. Linus TorvaldsMay 20, 2006
  2. Junio C HamanoMay 20, 2006
  3. Jakub NarebskiMay 20, 2006
  4. Yann DirsonMay 20, 2006
  5. Donnie BerkholzMay 20, 2006
  6. Linus TorvaldsMay 20, 2006
  7. Donnie BerkholzMay 20, 2006
  8. Linus TorvaldsMay 21, 2006
  9. Linus TorvaldsMay 22, 2006
  10. Donnie BerkholzMay 22, 2006
  11. Linus TorvaldsMay 22, 2006
  12. Martin LanghoffMay 22, 2006
  13. Donnie BerkholzMay 22, 2006
  14. Martin LanghoffMay 22, 2006
  15. Linus TorvaldsMay 22, 2006
  16. Martin LanghoffMay 22, 2006
  17. Linus TorvaldsMay 22, 2006
  18. Jakub NarebskiMay 22, 2006
  19. Linus TorvaldsMay 22, 2006
  20. Matthias LederhoferMay 22, 2006
  21. Junio C HamanoMay 22, 2006
  22. Jakub NarebskiMay 23, 2006
  23. Martin LanghoffMay 22, 2006
  24. Donnie BerkholzMay 22, 2006
  25. Linus TorvaldsMay 22, 2006
  26. Donnie BerkholzMay 22, 2006
  27. Linus TorvaldsMay 22, 2006
  28. Donnie BerkholzMay 22, 2006
  29. Donnie BerkholzMay 29, 2006
  30. Martin LanghoffMay 29, 2006
  31. Donnie BerkholzMay 29, 2006
  32. Martin LanghoffMay 30, 2006
  33. Donnie BerkholzMay 30, 2006
  34. Martin LanghoffMay 30, 2006
  35. Linus TorvaldsMay 30, 2006
  36. Martin LanghoffMay 30, 2006
  37. Linus TorvaldsMay 30, 2006
  38. Martin LanghoffMay 31, 2006
  39. Donnie BerkholzMay 31, 2006
  40. Martin LanghoffMay 31, 2006
  41. Alec WarnerMay 31, 2006
  42. Martin LanghoffMay 31, 2006
  43. Alec WarnerJun 1, 2006
  44. Martin LanghoffJun 1, 2006
  45. Alec WarnerJun 5, 2006
  46. Martin LanghoffJun 5, 2006
  47. Alec WarnerJun 5, 2006
  48. Martin LanghoffJun 5, 2006
  49. SeanJun 5, 2006
  50. Martin LanghoffMay 22, 2006
  51. Linus TorvaldsMay 22, 2006
  52. Linus TorvaldsMay 22, 2006
  53. Matthias UrlichsMay 22, 2006
  54. Linus TorvaldsMay 22, 2006
  55. Martin LanghoffMay 22, 2006
  56. Martin LanghoffMay 22, 2006
  57. Linus TorvaldsMay 22, 2006
  58. Junio C HamanoMay 22, 2006
  59. Martin LanghoffMay 22, 2006
  60. Jeff KingMay 23, 2006
  61. Jeff KingMay 23, 2006
  62. 1/2 cvsimport: use git-update-index --index-infoJeff King, May 23, 2006
  63. 2/2 cvsimport: cleanup commit functionJeff King, May 23, 2006
  64. 1/2 cvsimport: use git-update-index --index-infoJeff King, May 23, 2006
  65. Martin LanghoffMay 23, 2006
  66. Junio C HamanoMay 23, 2006
  67. Martin LanghoffMay 23, 2006
  68. Linus TorvaldsMay 23, 2006
  69. Linus TorvaldsMay 23, 2006
  70. Junio C HamanoMay 23, 2006
  71. Martin LanghoffMay 23, 2006
  72. Jeff KingMay 23, 2006
  73. Martin LanghoffMay 23, 2006
  74. Morten WelinderMay 23, 2006
  75. Jeff KingMay 23, 2006
  76. Junio C HamanoMay 23, 2006
  77. Jeff KingMay 24, 2006
  78. Donnie BerkholzMay 22, 2006
  79. Thomas GlanzmannMay 21, 2006
  80. Donnie BerkholzMay 21, 2006
  81. Linus TorvaldsMay 22, 2006
  82. Jeff KingMay 23, 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.