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

Re: grafts+repack+prune = history at danger

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Jan 26, 2007, 10:41 UTC
Message-ID
<45B9DAC8.C04C6D3F@eudaptics.com>
In-Reply-To
<7vmz46ytyy.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 19 quoted lines
> 
> Johannes Sixt <J.Sixt@eudaptics.com> writes:
> 
> > Sure, if I connect my linux repo with a graft to the historical BK tree,
> > then toss the ref that pointed to the historical tree, then git prune:
> > - then currently it won't prune the historical tree
> > - but under my proposal it would. Silly me. Why did I remove that ref?
> 
> [...]
> 
> Thankfully, the real git does not behave that way.  That is why
> fsck/prune _must_ honor grafts.  That makes the locally altered
> view consistent.  To the altered world view, what are stored in
> the object database do not change, but your view of how they are
> connected does.  And if your altered view thinks commit
> v2.6.12-rc2 has one of the commits in the bkcvs history as its
> parent, you do not want to lose that history merely because you
> lost a ref to it -- as long as the commit tagged as v2.6.12-rc2
> is reachable, its (imaginary) parent should be as well.
>From your argument I deduce that grafts are a very important thing (once

they exist in a repo). But the current implementation does not honor this:

- the grafts file is not part of the objects database
- it is manipulated manually instead of by tools the check for errors
- it is not transferred across clones/pulls/pushes (it's even possible
to create an inconsistent clone)

The way out that I see is to make grafts much, much less important. Namely that they are obeyed _only_ by tools that _present_ the database contents. All manipulators must disregard grafts.

Consequently, if I install grafts, I must make sure that I don't prune away objects that the grafted history needs (i.e. avoid the silliness mentioned above). If I happen to make the grafted history inconsistent, I can make it consistent again by removing the grafts file (it was a local thingy anyway) - no harm done - just the _presentation_ was altered.

-- Hannes
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 15 in “grafts+repack+prune = history at danger”
  1. Johannes SixtJan 25, 2007
  2. Junio C HamanoJan 25, 2007
  3. Johannes SixtJan 26, 2007
  4. Junio C HamanoJan 26, 2007
  5. Johannes SixtJan 26, 2007
  6. Junio C HamanoJan 26, 2007
  7. Johannes SixtJan 26, 2007
  8. Junio C HamanoJan 26, 2007
  9. Johannes SixtJan 26, 2007
  10. Junio C HamanoJan 26, 2007
  11. Jakub NarebskiJan 26, 2007
  12. Linus TorvaldsJan 26, 2007
  13. Junio C HamanoJan 26, 2007
  14. Linus TorvaldsJan 27, 2007
  15. Mark WoodingJan 26, 2007

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.