{"thread":{"id":"29174","subject":"git help prune accuracy?","startedAt":"2011-12-15T21:32:09Z","lastAt":"2011-12-16T00:04:02Z","messageCount":5,"participants":["Martin Fick","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"181261","messageId":"201112151432.09252.mfick@codeaurora.org","threadId":"29174","inReplyTo":null,"subject":"git help prune accuracy?","fromName":"Martin Fick","fromEmail":"mfick@codeaurora.org","sentAt":"2011-12-15T21:32:09Z","receivedAt":"2011-12-15T21:32:09Z","isPatch":false,"sender":{"key":"mfick@codeaurora.org","avatar":null},"body":"I admit that I am guessing here, but I was wondering if this \nparagraph from git help prune was a incorrect, it says:\n\n  This runs git fsck --unreachable using all the refs \n  available in refs/, optionally with additional set of \n  objects specified on the command line, and prunes all \n  unpacked objects unreachable from any of these head  \n  objects from the object database. In addition, it prunes\n  the unpacked objects that are also found in packs by\n  running git prune-packed.\n\nThe last sentence seems like it should maybe have the \nfollowing fix:\n\ns/it prunes the unpacked/it prunes the unreferenced/\n\n-Martin\n\n-- \nEmployee of Qualcomm Innovation Center, Inc. which is a \nmember of Code Aurora Forum\n"},{"id":"181262","messageId":"201112151453.52157.mfick@codeaurora.org","threadId":"29174","inReplyTo":"201112151432.09252.mfick@codeaurora.org","subject":"Re: git help prune accuracy?","fromName":"Martin Fick","fromEmail":"mfick@codeaurora.org","sentAt":"2011-12-15T21:53:52Z","receivedAt":"2011-12-15T21:53:52Z","isPatch":false,"sender":{"key":"mfick@codeaurora.org","avatar":null},"body":"On Thursday, December 15, 2011 02:32:09 pm Martin Fick \nwrote:\n> I admit that I am guessing here, but I was wondering if\n> this paragraph from git help prune was a incorrect, it\n> says:\n> \n>   This runs git fsck --unreachable using all the refs\n>   available in refs/, optionally with additional set of\n>   objects specified on the command line, and prunes all\n>   unpacked objects unreachable from any of these head\n>   objects from the object database. In addition, it\n> prunes the unpacked objects that are also found in packs\n> by running git prune-packed.\n> \n> The last sentence seems like it should maybe have the\n> following fix:\n> \n> s/it prunes the unpacked/it prunes the unreferenced/\n\nAck, I meant:\n\ns/it prunes the unpacked/it prunes the unreachable/\n\n-Martin\n\n-- \nEmployee of Qualcomm Innovation Center, Inc. which is a \nmember of Code Aurora Forum\n"},{"id":"181266","messageId":"7v1us5mqc4.fsf@alter.siamese.dyndns.org","threadId":"29174","inReplyTo":"201112151453.52157.mfick@codeaurora.org","subject":"Re: git help prune accuracy?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-15T22:18:19Z","receivedAt":"2011-12-15T22:18:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Fick <mfick@codeaurora.org> writes:\n\n>>   objects from the object database. In addition, it\n>> prunes the unpacked objects that are also found in packs\n>> by running git prune-packed.\n>> \n>> The last sentence seems like it should maybe have the\n>> following fix:\n>> \n>> s/it prunes the unpacked/it prunes the unreferenced/\n>\n> Ack, I meant:\n>\n> s/it prunes the unpacked/it prunes the unreachable/\n\n\"In addition\" part is about objects that exist in loose format that are\nalso found in packs and has nothing to do with reachability.\n\nRunning \"git pack-objects\" to collect loose objects into a new pack will\nnot remove these loose objects that are copied into that new pack. Because\nwe try to access objects from an already open packfile before trying a\nloose object file, removing these now-redundant loose ones after they are\npacked makes sense. And that is what \"git prune-packed\" does.\n"},{"id":"181271","messageId":"201112151601.52968.mfick@codeaurora.org","threadId":"29174","inReplyTo":"7v1us5mqc4.fsf@alter.siamese.dyndns.org","subject":"Re: git help prune accuracy?","fromName":"Martin Fick","fromEmail":"mfick@codeaurora.org","sentAt":"2011-12-15T23:01:52Z","receivedAt":"2011-12-15T23:01:52Z","isPatch":false,"sender":{"key":"mfick@codeaurora.org","avatar":null},"body":"On Thursday, December 15, 2011 03:18:19 pm Junio C Hamano \nwrote:\n> Martin Fick <mfick@codeaurora.org> writes:\n> >>   objects from the object database. In addition, it\n> >> \n> >> prunes the unpacked objects that are also found in\n> >> packs by running git prune-packed.\n> >> \n> >> The last sentence seems like it should maybe have the\n> >> following fix:\n> >> \n> >> s/it prunes the unpacked/it prunes the unreferenced/\n> > \n> > Ack, I meant:\n> > \n> > s/it prunes the unpacked/it prunes the unreachable/\n> \n> \"In addition\" part is about objects that exist in loose\n> format that are also found in packs and has nothing to\n> do with reachability.\n> \n> Running \"git pack-objects\" to collect loose objects into\n> a new pack will not remove these loose objects that are\n> copied into that new pack. Because we try to access\n> objects from an already open packfile before trying a\n> loose object file, removing these now-redundant loose\n> ones after they are packed makes sense. And that is what\n> \"git prune-packed\" does.\n\nThanks Junio, that makes a lot of sense.  I don't know why I \nwas not getting that from the description even though that \nwas exactly what I was looking for.  Maybe it was because of \nthe intro/summary line?  Now that I think I understand what \nit is doing, it seems like this command is more about \n\"pruning loose objects\" (whether unreachable or already \npacked) than it is about \"pruning unreachable objects\" \n(which could be loose or packed)?  The summary line reads:\n\n  git-prune - Prune all unreachable objects from the object \ndatabase\n\nMaybe I am not familiar enough with git terminology, but \ndoes \"object database\" imply loose objects only?  Because \nthe word \"all\" in that summary makes it sound like it will \nprune all unreachable objects (loose and packed).\n\nI don't quite have an alternative suggestion for a better \nsummary, the best I could do (but don't like) is:\n\n  git-prune - Prune loose objects (unreachable or packed)\n\n\n-Martin\n\n\n-- \nEmployee of Qualcomm Innovation Center, Inc. which is a \nmember of Code Aurora Forum\n"},{"id":"181275","messageId":"7vliqdl6vh.fsf@alter.siamese.dyndns.org","threadId":"29174","inReplyTo":"201112151601.52968.mfick@codeaurora.org","subject":"Re: git help prune accuracy?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-16T00:04:02Z","receivedAt":"2011-12-16T00:04:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Fick <mfick@codeaurora.org> writes:\n\n> ...  The summary line reads:\n>\n>   git-prune - Prune all unreachable objects from the object \n> database\n\nYea, prune itself has always been primarily about getting rid of\nunreachable objects. I suspect (I didn't check) that we did not even have\na call to prune-packed in its original implementation and it was later\nadded as \"we are doing the pruning anyway, why not do this as well while\nat it\".\n\nYeah, I just checked.  Before 51890a6 (Call prune-packed from \"git prune\"\nas well., 2005-08-19), we didn't.  And 2396ec8 (Add \"git-prune-packed\"\nthat removes objects that exist in a pack., 2005-07-03) explains it rather\nnicely:\n\n    Add \"git-prune-packed\" that removes objects that exist in a pack.\n    \n    This, together with \"git repack\" can be used to clean up unpacked\n    git archives.\n\n> I don't quite have an alternative suggestion for a better \n> summary, the best I could do (but don't like) is:\n>\n>   git-prune - Prune loose objects (unreachable or packed)\n\nFor a one-liner description, \"Remove unnecessary or redundant loose\nobjects\" without parentheses may be better. Explaining \"git prune\" as\n\"this prunes\" does not add as much information as restating it using a\ndifferent and more common verb.\n\nThe body text can clarify what we mean by \"unnecessary\" and \"redundant\".\nA loose object that is old may be unreachable from any of the refs,\ni.e. unused, and hence unnecessary. Or the same object as a loose one may\nbe found in a pack, which would make the loose one redundant.\n"}]}