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

Re: grafts+repack+prune = history at danger

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 27, 2007, 00:56 UTC
Message-ID
<Pine.LNX.4.64.0701261652440.25027@woody.linux-foundation.org>
In-Reply-To
<7vtzydtkqu.fsf@assigned-by-dhcp.cox.net>
On Fri, 26 Jan 2007, Junio C Hamano wrote:
Show 10 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
> >
> >  - "git prune" would *also* explicitly set it to zero, but would also 
> >    manually look at the grafts file, and mark anything that is set in the 
> >    grafts file as being reachable (the same way it does for index entries 
> >    etc).
> 
> I am not sure why your "git prune" one does that, but will think
> about it for some time first before I ask you to waste your time
> explaining it me.
Simple: the grafts may actually _hide_ history too - not just add it.

Sure, commonly, a graft is used to graft two complete trees together (eg, you'd graft the old Linux history into the new Linux history tree).

However, they _can_ also be used to "fix" history - say that you had one tree that has a rough history (with all the releases, but not the full history between them), and another "fine-grained" historical tree. You could use a graft to replace the rough history version with the fine-grained one, so the graft may actually hide stuff that is there in the rough history.

So in this case, we wouldn't necessarily want to prune stuff that "exists", but is hidden by a graft. So in my suggestion, pruning would basically only use the grafts file to *add* refs, never to hide them.

		Linus
Previous: Junio C HamanoNext: Mark Wooding
Message 14 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.