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

Re: git help prune accuracy?

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 16, 2011, 00:04 UTC
Message-ID
<7vliqdl6vh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201112151601.52968.mfick@codeaurora.org>
Martin Fick <mfick@codeaurora.org> writes:
> ...  The summary line reads:
>
>   git-prune - Prune all unreachable objects from the object 
> database

Yea, prune itself has always been primarily about getting rid of unreachable objects. I suspect (I didn't check) that we did not even have a call to prune-packed in its original implementation and it was later added as "we are doing the pruning anyway, why not do this as well while at it".

Yeah, I just checked. Before 51890a6 (Call prune-packed from "git prune" as well., 2005-08-19), we didn't. And 2396ec8 (Add "git-prune-packed" that removes objects that exist in a pack., 2005-07-03) explains it rather nicely:

    Add "git-prune-packed" that removes objects that exist in a pack.
    
    This, together with "git repack" can be used to clean up unpacked
    git archives.
> I don't quite have an alternative suggestion for a better 
> summary, the best I could do (but don't like) is:
>
>   git-prune - Prune loose objects (unreachable or packed)

For a one-liner description, "Remove unnecessary or redundant loose objects" without parentheses may be better. Explaining "git prune" as "this prunes" does not add as much information as restating it using a different and more common verb.

The body text can clarify what we mean by "unnecessary" and "redundant". A loose object that is old may be unreachable from any of the refs, i.e. unused, and hence unnecessary. Or the same object as a loose one may be found in a pack, which would make the loose one redundant.

Previous: Martin Fick
Message 5 of 5 in “git help prune accuracy?”
  1. Martin FickDec 15, 2011
  2. Martin FickDec 15, 2011
  3. Junio C HamanoDec 15, 2011
  4. Martin FickDec 15, 2011
  5. Junio C HamanoDec 16, 2011

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.