Thread (1 message) 1 message, 1 author, 2016-06-15

Re: git help prune accuracy?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:39

Martin Fick [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help