Thanks Dale. > But it's not tremendously difficult to recreate a chain of commits. My concern is time to have, not difficulty to do. I would like users to have a git repo as soon as possible. In same cases creating full repo might take many hours.
It seems like it will be impossible to do, unless the hash is just an ID, but not an actual checksum - in which case I could ignore to update it - but this seems very risky. On Mon, Apr 28, 2014 at 9:16 AM, Dale R. Worley <[email protected]> wrote: > > From: George Georgiev <[email protected]> > > > > > The problem is that adding a commit to the *beginning* of the chain > > > requires a bit of work, because you have to recreate all of the later > > > commits so they reference the first commit. > > > > Are you certain about this. At first pass reading through the git > > shallow.c code I am having the feeling that I will be able to avoid > > this with creating the objects with a shallow flag. Then when I need > > to add a parent I could just attach the parent and unregistered the > > object as shallow without a need to recreate it. (exactly as it > > seems --unshallow works) > > I'm not familiar with "shallow", but as I understand it, it fetches > only the latest commits from a repository and inserts them into a new > repository. Thus, the oldest commit in the chain has a "dangling > pointer" to its parent. > > The difference between that and the situation you describe is that > adding a new commit to the beginning of the commit chain changes the > hashes of all the commits, because the information that does into the > hash function to get the commit name includes the hash of the parent > commit. "Shallow repositories" work because you already know the > proper hash for the latest commit. You even know the proper hash for > the first commit that you're fetching. > > But if you want to add a parent to the current root commit, that > changes the information in the current root commit, which changes its > hash. And in the *next* commit, you have to update the parent > pointer, which changes *its* hash, etc. > > But it's not tremendously difficult to recreate a chain of commits. > > Dale > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Git for human beings" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/git-users/SKSucOqLvts/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
