{"thread":{"id":"16321","subject":"[RFC PATCH] repack: make repack -a equivalent to repack -A and drop previous -a behavior","startedAt":"2008-11-13T23:20:59Z","lastAt":"2008-11-13T23:20:59Z","messageCount":1,"participants":["Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"95740","messageId":"ovvL4JafR2God4TM6Qy0TKZ40xPemeYIPepBW8CggUHFP9JMODfGHmkQH3maiogNAHvCY7E-2U0@cipher.nrlssc.navy.mil","threadId":"16321","inReplyTo":null,"subject":"[RFC PATCH] repack: make repack -a equivalent to repack -A and drop previous -a behavior","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-11-13T23:20:59Z","receivedAt":"2008-11-13T23:20:59Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Once upon a time, repack had only a single option which began with the first\nletter of the alphabet.  Then, a second was created which would repack\nunreachable objects into the newly created pack so that git-gc --auto could\nbe invented.  But, the -a option was still necessary so that it could be\ncalled every now and then to discard the unreachable objects that were being\nrepacked over and over and over into newly generated packs. Later, -A was\nchanged so that instead of repacking the unreachable objects, it ejected\nthem from the pack so that they resided in the object store in loose form,\nto be garbage collected by prune-packed according to normal expiry rules.\n\nAnd so, -a lost its raison d'etre.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nThis is on top of bc/maint-keep-pack\n\n-brandon\n\n\n Documentation/git-repack.txt |   25 ++++++++++++-------------\n git-repack.sh                |    8 ++++----\n 2 files changed, 16 insertions(+), 17 deletions(-)\n\ndiff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt\nindex aaa8852..d04d5c2 100644\n--- a/Documentation/git-repack.txt\n+++ b/Documentation/git-repack.txt\n@@ -32,21 +32,20 @@ OPTIONS\n \tpack everything referenced into a single pack.\n \tEspecially useful when packing a repository that is used\n \tfor private development and there is no need to worry\n-\tabout people fetching via dumb protocols from it.  Use\n-\twith '-d'.  This will clean up the objects that `git prune`\n-\tleaves behind, but `git fsck --full` shows as\n-\tdangling.\n+\tabout people fetching via dumb protocols from it.  If used\n+\twith '-d' , then any unreachable objects in a previous pack will\n+\tbecome loose, unpacked objects, instead of being left in the\n+\told pack.  Unreachable objects are never intentionally added to\n+\ta pack, even when repacking.  This option prevents unreachable\n+\tobjects from being immediately deleted by way of being left in\n+\tthe old pack and then removed.  Instead, the loose unreachable\n+\tobjects will be pruned according to normal expiry rules\n+\twith the next 'git-gc' invocation. See linkgit:git-gc[1].\n \n -A::\n-\tSame as `-a`, unless '-d' is used.  Then any unreachable\n-\tobjects in a previous pack become loose, unpacked objects,\n-\tinstead of being left in the old pack.  Unreachable objects\n-\tare never intentionally added to a pack, even when repacking.\n-\tThis option prevents unreachable objects from being immediately\n-\tdeleted by way of being left in the old pack and then\n-\tremoved.  Instead, the loose unreachable objects\n-\twill be pruned according to normal expiry rules\n-\twith the next 'git-gc' invocation. See linkgit:git-gc[1].\n+\tSame as `-a`. Historical note: the -a and -A options used to differ\n+\tin that -a did not leave unreachable objects unpacked.  Instead,\n+\tthey were removed along with the redundant pack (when -d was used).\n \n -d::\n \tAfter packing, if the newly created packs make some\ndiff --git a/git-repack.sh b/git-repack.sh\nindex 458a497..f1e21b9 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -7,8 +7,9 @@ OPTIONS_KEEPDASHDASH=\n OPTIONS_SPEC=\"\\\n git repack [options]\n --\n-a               pack everything in a single pack\n-A               same as -a, and turn unreachable objects loose\n+a               pack everything in a single pack, and turn unreachable objects\n+                loose\n+A               same as -a\n d               remove redundant packs, and run git-prune-packed\n f               pass --no-reuse-object to git-pack-objects\n n               do not run git-update-server-info\n@@ -29,8 +30,7 @@ while test $# != 0\n do\n \tcase \"$1\" in\n \t-n)\tno_update_info=t ;;\n-\t-a)\tall_into_one=t ;;\n-\t-A)\tall_into_one=t\n+\t-a|-A)\tall_into_one=t\n \t\tunpack_unreachable=--unpack-unreachable ;;\n \t-d)\tremove_redundant=t ;;\n \t-q)\tquiet=-q ;;\n-- \n1.6.0.3.552.g12334\n"}]}