On Tue, Dec 3, 2013 at 7:44 AM, Junio C Hamano <gits...@pobox.com> wrote: >> * Scenario 4: >> >> Starts with Setup 1. Add some loose objects to the repo >> via a local fast forward ref update (I am assuming this is >> possible without adding any new unreferenced objects?) >> >> >> In all 4 scenarios, I believe we should be able to skip >> history traversal and simply grab all objects and repack >> them into a new file? > > If nothing else has happened in the repository, perhaps, but I > suspect that the real problem is how you would prove it. For > example, I am guessing that your Scenario 4 could be something like: > > : setup #1 > $ git repack -a -d -f > $ git prune > > : scenario #4 > $ git commit --allow-empty -m 'new commit' > > which would add a single loose object to the repository, advancing > the current branch ref by one commit, fast-forwarding relative to > the state you were in after setup #1. > > But how would you efficiently prove that it was the only thing that > happened?
Shawn mentioned elsewhere that we could generate bundle header in and keep it in pack-XXX.bh file at pack creation time. With that information we could verify if a ref has been reset, just fast forwarded or even deleted. > Also with Scenario #2, how would you prove that the new pack does > not contain any cruft that is not reachable? When receiving a pack > and updating our refs, we only prove that we have all the objects > needed to complete updated refs---we do not reject packs with crufts > that are not necessary. We trust the pack producer to do it correctly, I guess. If a pack producer guarantees not to store any cruft, it could mark the pack somehow. -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html