{"thread":{"id":"9074","subject":"'git gc' & number of unpacked objects ?","startedAt":"2007-07-17T16:14:19Z","lastAt":"2007-07-17T20:57:47Z","messageCount":2,"participants":["Yakov Lerner","Sam Vilain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47641","messageId":"f36b08ee0707170914g7ece7124qf5d8d6a1307cc07e@mail.gmail.com","threadId":"9074","inReplyTo":null,"subject":"'git gc' & number of unpacked objects ?","fromName":"Yakov Lerner","fromEmail":"iler.ml@gmail.com","sentAt":"2007-07-17T16:14:19Z","receivedAt":"2007-07-17T16:14:19Z","isPatch":false,"sender":{"key":"iler.ml@gmail.com","avatar":null},"body":"By the analogy with the maxtime and maxmount in the ext3 when it\nreminds you to fsck, when number of mounts since last fsck, or time since\nlast fsck is above some limits. I think this makes practical sense. I think\nthe similar thing makes sense wrt to 'git gc'.\n\nIs it possible that git repo had a parameter N, and when the counter of\nunpacked object hit this number,  then git operations start to print\nsemi-annoying warnings\n      \"Time to optimize your repo using 'git gc' command ... \"\n?\n\nI am naive user. I forget things. Really. I rely on git to remember things.\nIs this a reasonable parameter  ?\n\nThanks\nYakov\n"},{"id":"47673","messageId":"469D2D4B.8090900@vilain.net","threadId":"9074","inReplyTo":"f36b08ee0707170914g7ece7124qf5d8d6a1307cc07e@mail.gmail.com","subject":"Re: 'git gc' & number of unpacked objects ?","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2007-07-17T20:57:47Z","receivedAt":"2007-07-17T20:57:47Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Yakov Lerner wrote:\n> By the analogy with the maxtime and maxmount in the ext3 when it\n> reminds you to fsck, when number of mounts since last fsck, or time since\n> last fsck is above some limits. I think this makes practical sense. I\n> think\n> the similar thing makes sense wrt to 'git gc'.\n>\n> Is it possible that git repo had a parameter N, and when the counter of\n> unpacked object hit this number,  then git operations start to print\n> semi-annoying warnings\n>      \"Time to optimize your repo using 'git gc' command ... \"\n> ?\n\nI also wrote a commit hook that counts loose objects and just runs\nrepack with differing parameters.  Check for threads with terms\n\"generational repack\" in them.\n\nTo make it a really fast check, Linus suggested estimating the number of\nloose objects with a sample, eg if the threshold is 256 loose objects\nand you find 3 or more objects in directories 01, 02, and 03 then it's\ntime to repack.\n\nI've been using the script I posted on my own repositories for a while\nand was never really annoyed by the 2-3s aside it took every few dozen\ncommits to repack.  But then I'm probably biased and usually playing on\nrelatively zippy machines.\n\nSam.\n"}]}