{"thread":{"id":"38077","subject":"Thinning a repository","startedAt":"2014-11-30T12:18:34Z","lastAt":"2014-11-30T12:35:36Z","messageCount":3,"participants":["Yuri D'Elia","Fredrik Gustafsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"252744","messageId":"m5f1uq$na7$1@ger.gmane.org","threadId":"38077","inReplyTo":null,"subject":"Thinning a repository","fromName":"Yuri D'Elia","fromEmail":"wavexx@thregr.org","sentAt":"2014-11-30T12:18:34Z","receivedAt":"2014-11-30T12:18:34Z","isPatch":false,"sender":{"key":"wavexx@thregr.org","avatar":null},"body":"Hi everyone,\n\nIs there a quick way to reproduce the effect of a shallow clone on a\nlocal repository that doesn't involve filter-branch and/or re-clone?\n\nMy motivation is to reduce the local size of repositories I'm only\nfollowing, by trimming the history without prejudice to a [N] set of\nlast commits. It feels stupid that the quickest way I'm aware of right\nnow to achieve this is to \"git clone --depth N ...\" again. filter-branch\nis ridiculously slow, as it iterates through history.\n\nI've tried using graft points, but the combination of:\n\necho [sha] > .git/info/grafts\ngit reflog expire --expire=0 --all\ngit repack -Ad\n\ndoesn't really save any space and/or reduce the object count as I would\nexpect. It means there's probably still reachable?\n\nI'd really love to have a 'git thin [depth]' subcommand to perform the\nabove however. I don't really want to have to iterate through refs just\nto check if they are still reachable within [n] commits just to delete them.\n\nThanks for any pointer.\n"},{"id":"252745","messageId":"20141130123400.GG31751@paksenarrion.iveqy.com","threadId":"38077","inReplyTo":"m5f1uq$na7$1@ger.gmane.org","subject":"Re: Thinning a repository","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2014-11-30T12:34:00Z","receivedAt":"2014-11-30T12:34:00Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Nov 30, 2014 at 01:18:34PM +0100, Yuri D'Elia wrote:\n> Is there a quick way to reproduce the effect of a shallow clone on a\n> local repository that doesn't involve filter-branch and/or re-clone?\n\nI'm curious, why is it a bad thing to do a re-clone? If you clone your\nlocal repo it would be really fast.\n\n-- \nMed vänlig hälsning\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"252746","messageId":"m5f2up$554$1@ger.gmane.org","threadId":"38077","inReplyTo":"20141130123400.GG31751@paksenarrion.iveqy.com","subject":"Re: Thinning a repository","fromName":"Yuri D'Elia","fromEmail":"wavexx@thregr.org","sentAt":"2014-11-30T12:35:36Z","receivedAt":"2014-11-30T12:35:36Z","isPatch":false,"sender":{"key":"wavexx@thregr.org","avatar":null},"body":"On 11/30/2014 01:34 PM, Fredrik Gustafsson wrote:\n> On Sun, Nov 30, 2014 at 01:18:34PM +0100, Yuri D'Elia wrote:\n>> Is there a quick way to reproduce the effect of a shallow clone on a\n>> local repository that doesn't involve filter-branch and/or re-clone?\n> \n> I'm curious, why is it a bad thing to do a re-clone? If you clone your\n> local repo it would be really fast.\n\nI see no reason to involve the workspace.\nI would also want to keep the current remote/origin as it is.\n\nI expect a 'thin' command to be faster by not touching the workspace at all.\n"}]}