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

[RFC PATCH] repack: make repack -a equivalent to repack -A and drop previous -a behavior

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Nov 13, 2008, 23:20 UTC
Message-ID
<ovvL4JafR2God4TM6Qy0TKZ40xPemeYIPepBW8CggUHFP9JMODfGHmkQH3maiogNAHvCY7E-2U0@cipher.nrlssc.navy.mil>

Once upon a time, repack had only a single option which began with the first letter of the alphabet. Then, a second was created which would repack unreachable objects into the newly created pack so that git-gc --auto could be invented. But, the -a option was still necessary so that it could be called every now and then to discard the unreachable objects that were being repacked over and over and over into newly generated packs. Later, -A was changed so that instead of repacking the unreachable objects, it ejected them from the pack so that they resided in the object store in loose form, to be garbage collected by prune-packed according to normal expiry rules.

And so, -a lost its raison d'etre.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
This is on top of bc/maint-keep-pack
-brandon
 Documentation/git-repack.txt |   25 ++++++++++++-------------
 git-repack.sh                |    8 ++++----
 2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt
index aaa8852..d04d5c2 100644
--- a/Documentation/git-repack.txt
+++ b/Documentation/git-repack.txt
@@ -32,21 +32,20 @@ OPTIONS
 	pack everything referenced into a single pack.
 	Especially useful when packing a repository that is used
 	for private development and there is no need to worry
-	about people fetching via dumb protocols from it.  Use
-	with '-d'.  This will clean up the objects that `git prune`
-	leaves behind, but `git fsck --full` shows as
-	dangling.
+	about people fetching via dumb protocols from it.  If used
+	with '-d' , then any unreachable objects in a previous pack will
+	become loose, unpacked objects, instead of being left in the
+	old pack.  Unreachable objects are never intentionally added to
+	a pack, even when repacking.  This option prevents unreachable
+	objects from being immediately deleted by way of being left in
+	the old pack and then removed.  Instead, the loose unreachable
+	objects will be pruned according to normal expiry rules
+	with the next 'git-gc' invocation. See linkgit:git-gc[1].
 
 -A::
-	Same as `-a`, unless '-d' is used.  Then any unreachable
-	objects in a previous pack become loose, unpacked objects,
-	instead of being left in the old pack.  Unreachable objects
-	are never intentionally added to a pack, even when repacking.
-	This option prevents unreachable objects from being immediately
-	deleted by way of being left in the old pack and then
-	removed.  Instead, the loose unreachable objects
-	will be pruned according to normal expiry rules
-	with the next 'git-gc' invocation. See linkgit:git-gc[1].
+	Same as `-a`. Historical note: the -a and -A options used to differ
+	in that -a did not leave unreachable objects unpacked.  Instead,
+	they were removed along with the redundant pack (when -d was used).
 
 -d::
 	After packing, if the newly created packs make some
diff --git a/git-repack.sh b/git-repack.sh
index 458a497..f1e21b9 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -7,8 +7,9 @@ OPTIONS_KEEPDASHDASH=
 OPTIONS_SPEC="\
 git repack [options]
 --
-a               pack everything in a single pack
-A               same as -a, and turn unreachable objects loose
+a               pack everything in a single pack, and turn unreachable objects
+                loose
+A               same as -a
 d               remove redundant packs, and run git-prune-packed
 f               pass --no-reuse-object to git-pack-objects
 n               do not run git-update-server-info
@@ -29,8 +30,7 @@ while test $# != 0
 do
 	case "$1" in
 	-n)	no_update_info=t ;;
-	-a)	all_into_one=t ;;
-	-A)	all_into_one=t
+	-a|-A)	all_into_one=t
 		unpack_unreachable=--unpack-unreachable ;;
 	-d)	remove_redundant=t ;;
 	-q)	quiet=-q ;;
-- 
1.6.0.3.552.g12334
Message 1 of 1 in “repack: make repack -a equivalent to repack -A and drop previous -a behavior”
  1. repack: make repack -a equivalent to repack -A and drop previous -a behaviorBrandon Casey, Nov 13, 2008

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.