{"thread":{"id":"18414","subject":"Adding History","startedAt":"2009-03-19T17:38:33Z","lastAt":"2009-03-20T05:25:25Z","messageCount":3,"participants":["Roger Garvin","Shawn O. Pearce","John Tapsell"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"108554","messageId":"loom.20090319T173541-173@post.gmane.org","threadId":"18414","inReplyTo":null,"subject":"Adding History","fromName":"Roger Garvin","fromEmail":"yoyodyn@gmail.com","sentAt":"2009-03-19T17:38:33Z","receivedAt":"2009-03-19T17:38:33Z","isPatch":false,"sender":{"key":"yoyodyn@gmail.com","avatar":null},"body":"Is there a way to add history to a repository?\nWe have just started using git, where before we had nothing but backup\ndirectories all over the place.  We created the git repository using our\nexisting source directory.  Is there a way to now go and add some of the backup\nsource directories to the history?  Or would this break all the SHA1 of the\ncurrent objects?  I am not sure it would be worth it at this point.  But we are\nstill pretty early in our use of git so now would be the easiest time.  \n\nRoger\n"},{"id":"108556","messageId":"20090319174732.GS23521@spearce.org","threadId":"18414","inReplyTo":"loom.20090319T173541-173@post.gmane.org","subject":"Re: Adding History","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-03-19T17:47:32Z","receivedAt":"2009-03-19T17:47:32Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Roger Garvin <yoyodyn@gmail.com> wrote:\n> Is there a way to add history to a repository?\n> We have just started using git, where before we had nothing but backup\n> directories all over the place.  We created the git repository using our\n> existing source directory.  Is there a way to now go and add some of the backup\n> source directories to the history?  Or would this break all the SHA1 of the\n> current objects?\n\nRight, you need to change the SHA-1 of all of the commits in order\nto insert history in the past.\n\n> I am not sure it would be worth it at this point.  But we are\n> still pretty early in our use of git so now would be the easiest time.  \n\nYou have two options:\n\n- Use git-filter-branch now to rewrite your commits with the\nhistory added.  Its a one-time pain that you need to go through to\ndiscard all of your current objects, and move to the new ones that\nhave the history.\n\n- Keep the current objects, but if you need the history, add it\nto the local repository by editing the grafts file.  This is how\nthe Linux kernel team can insert history that predates Git, if\nthey absolutely must have it.\n\nIt depends on how often you need to look at that history.  If its\n\"almost never\", I would probably go with the graft.  If its \"often\",\nI would consider the filter-branch now.\n\n-- \nShawn.\n"},{"id":"108651","messageId":"43d8ce650903192225wdd2c46ai7954afbb0034ba53@mail.gmail.com","threadId":"18414","inReplyTo":"20090319174732.GS23521@spearce.org","subject":"Re: Adding History","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-20T05:25:25Z","receivedAt":"2009-03-20T05:25:25Z","isPatch":false,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/19 Shawn O. Pearce <spearce@spearce.org>:\n> Roger Garvin <yoyodyn@gmail.com> wrote:\n>> Is there a way to add history to a repository?\n>> We have just started using git, where before we had nothing but backup\n>> directories all over the place.  We created the git repository using our\n>> existing source directory.  Is there a way to now go and add some of the backup\n>> source directories to the history?  Or would this break all the SHA1 of the\n>> current objects?\n>\n> Right, you need to change the SHA-1 of all of the commits in order\n> to insert history in the past.\n>\n>> I am not sure it would be worth it at this point.  But we are\n>> still pretty early in our use of git so now would be the easiest time.\n>\n> You have two options:\n\nCouldn't you just create import the whole tree and then rebase on top of it?\n"}]}