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

Re: Bug: segfault during git-prune

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 28, 2007, 16:09 UTC
Message-ID
<alpine.LFD.0.98.0706280901580.8675@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.0.98.0706280844460.8675@woody.linux-foundation.org>
On Thu, 28 Jun 2007, Linus Torvalds wrote:
Show 8 quoted lines
> 
> Yeah, git-fsck knows about subprojects. I bet git-prune just doesn't. 
> 
> And indeed.. Here's a patch for it, but the fact is, you really should 
> *not* prune that repository, because you'll prune away all the subproject 
> data, which you seem to have in the same repo!
> 
> (General rule: never *ever* prune a shared object repository!)

Btw, we could make the "reachable" code say that *if* you have the commit of a subproject in your current object directory, it will follow that commit recursively, and thus sharing an object store at the superproject level is "ok" as far as "git prune" is concerned.

We don't currently even have that kind of function, though. Calling "parse_commit()" will complain very loudly if the commit doesn't exist, but it's actually perfectly fine to not exist if it's in a separate subproject.

So if you actually want to use subprojects *and* prune them, *and* you want to keep all the subproject objects in the same big object database, you'd have to add some commit object "parse-if-you-can-find-it" thing, and use that.

It shouldn't be fundamentally hard, but it's _not_ what my patch did. My patch just says: "subprojects are separate projects, and we don't do reachability from superproject to subproject".

		Linus
Previous: Linus TorvaldsNext: Andy Parkins
Message 4 of 11 in “Bug: segfault during git-prune”
  1. Andy ParkinsJun 28, 2007
  2. Andy ParkinsJun 28, 2007
  3. Linus TorvaldsJun 28, 2007
  4. Linus TorvaldsJun 28, 2007
  5. Andy ParkinsJun 28, 2007
  6. Linus TorvaldsJun 28, 2007
  7. Andy ParkinsJun 29, 2007
  8. Andy ParkinsJul 2, 2007
  9. Linus TorvaldsJul 2, 2007
  10. Andy ParkinsJul 2, 2007
  11. Linus TorvaldsJul 2, 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.