Subject: Re: Storing state in $GIT_DIR

From: Martin Langhoff <[email-masked]>
Date: Fri, 26 Aug 2005 18:43:26 +1200

On 8/26/05, Junio C Hamano <[email-masked]> wrote:
> > Hmmm. That repo is in sync, but there are no guarantees that they will
> > travel together to a different repo. In fact, the push/pull
> > infrastructure wants to push/pull one head at a time.
> 
> Wrong as of last week ;-), and definitely wrong since this morning.

Haven't had time to learn what the new conventions are for push/pull
scenarios. Will try and read up...

> > And if they are not in sync, I have no way of knowing. Hmpf. I lie:
> > the arch metadata could keep track of what it expects the last head
> > commits to be, and complain bitterly if something smells rotten.
> 
> What Linus suggests is doable by using an object that can hold
> a pointer to at least one commit---you used that to record the
> head commit of the corresponding git branch that the arch
> metainfo represents.

Yes. If I have my "arch-metadata" head, I can have several files
there, one of them containing a list of head "names" and the sha we
expect them to correspond to. If the thing doesn't match, we crash and
burn because we are out of sync.

Now, during import I'll have to be extra careful at commit-time, and
update and commit the arch-metadata head immediately after I commit
the head I'm importing, with strong error-handling. This should
minimize the out-of-sync situation.

If we _are_ out-of-sync, I could have a recovery mode that rewinds the
heads to the 'last known good' position and replays things forward. If
my script is stable, the results should be stable too...

> You only pull arch metainfo branch; the objects associated with
> the corresponding git branch head will be pulled together when
> you pull it.  You do not have to tell git to pull git-part of
> the commit chain.  There is no need to worry about version skew
> when you use git this way.

>>From here onwards, you lost me, mate ;)

cheers,

martin