{"thread":{"id":"16356","subject":"publish since current state?","startedAt":"2008-11-16T20:42:26Z","lastAt":"2008-11-17T11:44:14Z","messageCount":4,"participants":["Gennady Kushnir","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"95968","messageId":"96ed5eac0811161242o4c800e37u7c96872a9a4351ef@mail.gmail.com","threadId":"16356","inReplyTo":null,"subject":"publish since current state?","fromName":"Gennady Kushnir","fromEmail":"genkush@rujel.net","sentAt":"2008-11-16T20:42:26Z","receivedAt":"2008-11-16T20:42:26Z","isPatch":false,"sender":{"key":"genkush@rujel.net","avatar":null},"body":"Hello list.\nI'm going to publish my work into online public repository.\nI have several months of previous history in my local git repo. And I\ndon't want to make it all public.\nIs it possible to publish just a shallow copy of my repository storing\nmy current tree?\nI'd also like to keep my local history private but push new commits\nfrom it into that online repo.\n\nGennady\n\nP.S. please reply to my email directly as I'm not signed up to mail list yet.\n"},{"id":"96009","messageId":"49211B78.50204@op5.se","threadId":"16356","inReplyTo":"96ed5eac0811161242o4c800e37u7c96872a9a4351ef@mail.gmail.com","subject":"Re: publish since current state?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-11-17T07:21:28Z","receivedAt":"2008-11-17T07:21:28Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Gennady Kushnir wrote:\n> Hello list.\n> I'm going to publish my work into online public repository.\n> I have several months of previous history in my local git repo. And I\n> don't want to make it all public.\n> Is it possible to publish just a shallow copy of my repository storing\n> my current tree?\n\nYes. Look for 'grafts' in the documentation. You'll have to create a\nnew repository containing only the most recent code first, and then\ncreate the grafts-file in that repository and copy the object database\nfrom the old repository into the new one.\n\n> I'd also like to keep my local history private but push new commits\n> from it into that online repo.\n> \n\nThe grafts solution will work like that, assuming you don't publish\nyour grafts-file.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"96028","messageId":"23ae57c00811170252uba2cd22kb99a23134f026fc6@mail.gmail.com","threadId":"16356","inReplyTo":"49211B78.50204@op5.se","subject":"Re: publish since current state?","fromName":"Gennady Kushnir","fromEmail":"genkush@gmail.com","sentAt":"2008-11-17T10:52:25Z","receivedAt":"2008-11-17T10:52:25Z","isPatch":false,"sender":{"key":"genkush@gmail.com","avatar":null},"body":"Thank your for your reply.\nBut I could not find documentation for grafts... it is only mentioned\nin glossary.\nThe only thing I found with google is 1-year-old a mail list post\nhttp://marc.info/?l=git&m=119636089519572&w=2\ncould you point out some direct link to grafts documentation?\n\nAnd also - what you mean by \"copy the object database\nfrom the old repository into the new one\" ?\nI'm not aware of such operation. What command does it?\nAnd will not that copied database go online as dangling objects?\n\nGennady Kushnir\n\n2008/11/17 Andreas Ericsson <ae@op5.se>:\n> Gennady Kushnir wrote:\n>>\n>> Hello list.\n>> I'm going to publish my work into online public repository.\n>> I have several months of previous history in my local git repo. And I\n>> don't want to make it all public.\n>> Is it possible to publish just a shallow copy of my repository storing\n>> my current tree?\n>\n> Yes. Look for 'grafts' in the documentation. You'll have to create a\n> new repository containing only the most recent code first, and then\n> create the grafts-file in that repository and copy the object database\n> from the old repository into the new one.\n>\n>> I'd also like to keep my local history private but push new commits\n>> from it into that online repo.\n>>\n>\n> The grafts solution will work like that, assuming you don't publish\n> your grafts-file.\n>\n> --\n> Andreas Ericsson                   andreas.ericsson@op5.se\n> OP5 AB                             www.op5.se\n> Tel: +46 8-230225                  Fax: +46 8-230231\n>\n"},{"id":"96036","messageId":"4921590E.6000709@op5.se","threadId":"16356","inReplyTo":"23ae57c00811170252uba2cd22kb99a23134f026fc6@mail.gmail.com","subject":"Re: publish since current state?","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-11-17T11:44:14Z","receivedAt":"2008-11-17T11:44:14Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Gennady Kushnir wrote:\n> Thank your for your reply.\n> But I could not find documentation for grafts... it is only mentioned\n> in glossary.\n> The only thing I found with google is 1-year-old a mail list post\n> http://marc.info/?l=git&m=119636089519572&w=2\n> could you point out some direct link to grafts documentation?\n> \n\n\n>From that link can be gleaned the important stuff, actually.\n--8<--8<--\nGraft points are configured via the .git/info/grafts file.  It has one\nrecord per line describing a commit and its fake parents by listing\nobject names separated by a space and terminated by a newline.\n\n<commit sha1> <parent sha1> [<parent sha1>]*\n--8<--8<--\n\n> And also - what you mean by \"copy the object database\n> from the old repository into the new one\" ?\n\nI mean something like this:\ncd old_repo && git repack -a -d && \\\n  cp .git/objects/pack/* ../new_repo/.git/objects/pack\n\ncd ../new_repo && \\\n  echo \"$first_sha1_of_new_repo $last_sha1_of_old_repo\" \\\n  > .git/info/grafts\n\nand you're done.\n\n> I'm not aware of such operation. What command does it?\n> And will not that copied database go online as dangling objects?\n> \n\nNo. The grafts file will connect the two histories so they\nlook like one. The public repo where people clone from should\nnot have the grafts-file, and you should run \"git repack -a -d\"\nin that repository to prevent dumb commit walkers from getting\naccess to all your ancient history through a mega-pack.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"}]}