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

Re: Storing state in $GIT_DIR

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 26, 2005, 03:54 UTC
Message-ID
<Pine.LNX.4.58.0508252051400.3317@g5.osdl.org>
In-Reply-To
<46a038f905082518306e9d7d2a@mail.gmail.com>
On Fri, 26 Aug 2005, Martin Langhoff wrote:
Show 5 quoted lines
> 
> OTOH, storing the metadata in a branch will allow us to run the import
> in alternating repositories. But as Junio points out, unless I can
> guarantee that the metadata and the tree are in sync, I cannot
> trivially resume the import cycle from a new repo.
But you can.
Remember: the metadata is the pointers to the original git conversion, and 
objects are immutable.

In other words, if you just have a "last commit" pointer in your meta-data, then git is _by_definition_ in sync. There's never anything to get out of sync, because objects aren't going to change.

So you can think of your meta-data as a strange kind of head ref. Or rather, a _collection_ of these strange refs.

And it doesn't matter if somebody ends up committing on top of an arch import. The metadata by definition doesn't know about it, so the "import" head doesn't move anywhere (if you do git and arch work in parallell, you can then merge the two heads with git, of course).

			Linus
Previous: Martin LanghoffNext: Martin Langhoff
Message 4 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.