git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Storing state in $GIT_DIR

From
Martin Langhoff <martin.langhoff@gmail.com>
Date
Aug 26, 2005, 06:43 UTC
Message-ID
<46a038f905082523431c3b577f@mail.gmail.com>
In-Reply-To
<7v3boxl3o1.fsf@assigned-by-dhcp.cox.net>
On 8/26/05, Junio C Hamano <junkio@cox.net> wrote:
Show 5 quoted lines
> > 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...

Show 8 quoted lines
> > 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...

Show 5 quoted lines
> 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
Previous: Junio C HamanoNext: Eric W. Biederman
Message 12 of 17 in “Storing state in $GIT_DIR”
  1. Martin LanghoffAug 25, 2005
  2. Linus TorvaldsAug 25, 2005
  3. Martin LanghoffAug 26, 2005
  4. Linus TorvaldsAug 26, 2005
  5. Martin LanghoffAug 26, 2005
  6. Junio C HamanoAug 26, 2005
  7. Daniel BarkalowAug 26, 2005
  8. Linus TorvaldsAug 26, 2005
  9. Junio C HamanoAug 26, 2005
  10. Linus TorvaldsAug 27, 2005
  11. Junio C HamanoAug 26, 2005
  12. Martin LanghoffAug 26, 2005
  13. Eric W. BiedermanAug 26, 2005
  14. Martin LanghoffAug 26, 2005
  15. Eric W. BiedermanAug 26, 2005
  16. Accept -m and friends for initial commits and merge commits.Junio C Hamano, Aug 26, 2005
  17. Martin LanghoffAug 26, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.