{"thread":{"id":"13109","subject":"[PATCH] git-gc --prune is deprecated","startedAt":"2008-04-14T12:17:31Z","lastAt":"2008-04-14T12:17:31Z","messageCount":1,"participants":["Dmitry Potapov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"74349","messageId":"1208175451-30669-1-git-send-email-dpotapov@gmail.com","threadId":"13109","inReplyTo":null,"subject":"[PATCH] git-gc --prune is deprecated","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2008-04-14T12:17:31Z","receivedAt":"2008-04-14T12:17:31Z","isPatch":true,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"25ee9731c137d0a24b0f4879eb0b0cce9b77d5b0 made the '--prune' option\ndeprecated and removed its description from the git-gc man page. This\npatch removes all references to this option from the rest of the Git\ndocumentation.\n---\n\nReferences to a non-existing option in the user manual and especially\nin Every Day Git, which is intended for beginners, is very confusing.\n\nSo, I believe it should be treated as a bug fix and included in maint.\n\nI'll appreciate if someone with better knowledge of git-gc review my\ncorrection.\n\nThanks,\nDmitry\n\n Documentation/everyday.txt    |    6 ++----\n Documentation/git-clone.txt   |   10 ++++++----\n Documentation/user-manual.txt |   17 +----------------\n 3 files changed, 9 insertions(+), 24 deletions(-)\n\ndiff --git a/Documentation/everyday.txt b/Documentation/everyday.txt\nindex fdbd15a..e598cdd 100644\n--- a/Documentation/everyday.txt\n+++ b/Documentation/everyday.txt\n@@ -48,14 +48,12 @@ $ git gc <3>\n repository health reasonably well.\n <2> check how many loose objects there are and how much\n disk space is wasted by not repacking.\n-<3> repacks the local repository and performs other housekeeping tasks. Running\n-without `--prune` is a safe operation even while other ones are in progress.\n+<3> repacks the local repository and performs other housekeeping tasks.\n \n Repack a small project into single pack.::\n +\n ------------\n $ git gc <1>\n-$ git gc --prune\n ------------\n +\n <1> pack all the objects reachable from the refs into one pack,\n@@ -182,7 +180,7 @@ $ git pull <3>\n $ git log -p ORIG_HEAD.. arch/i386 include/asm-i386 <4>\n $ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL <5>\n $ git reset --hard ORIG_HEAD <6>\n-$ git gc --prune <7>\n+$ git gc <7>\n $ git fetch --tags <8>\n ------------\n +\ndiff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt\nindex 9758243..c1bf814 100644\n--- a/Documentation/git-clone.txt\n+++ b/Documentation/git-clone.txt\n@@ -65,10 +65,12 @@ OPTIONS\n +\n *NOTE*: this is a possibly dangerous operation; do *not* use\n it unless you understand what it does. If you clone your\n-repository using this option, then delete branches in the\n-source repository and then run linkgit:git-gc[1] using the\n-'--prune' option in the source repository, it may remove\n-objects which are referenced by the cloned repository.\n+repository using this option and then delete a branch or use\n+any other git command that makes any previous existing commit\n+unreachable, then after some time linkgit:git-gc[1] may remove\n+unreachable objects, and this will break the cloned repository.\n+Because some git commands may run git-gc, it may happen at any\n+time after gc.pruneExpire time since commits became unreachable.\n \n \n \ndiff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt\nindex 565aeb9..86b91a5 100644\n--- a/Documentation/user-manual.txt\n+++ b/Documentation/user-manual.txt\n@@ -1548,22 +1548,7 @@ dangling tree b24c2473f1fd3d91352a624795be026d64c8841f\n \n Dangling objects are not a problem.  At worst they may take up a little\n extra disk space.  They can sometimes provide a last-resort method for\n-recovering lost work--see <<dangling-objects>> for details.  However, if\n-you wish, you can remove them with linkgit:git-prune[1] or the `--prune`\n-option to linkgit:git-gc[1]:\n-\n--------------------------------------------------\n-$ git gc --prune\n--------------------------------------------------\n-\n-This may be time-consuming.  Unlike most other git operations (including\n-git-gc when run without any options), it is not safe to prune while\n-other git operations are in progress in the same repository.\n-\n-If linkgit:git-fsck[1] complains about sha1 mismatches or missing\n-objects, you may have a much more serious problem; your best option is\n-probably restoring from backups.  See\n-<<recovering-from-repository-corruption>> for a detailed discussion.\n+recovering lost work--see <<dangling-objects>> for details.\n \n [[recovering-lost-changes]]\n Recovering lost changes\n-- \n1.5.5.21.g03e5\n"}]}