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

[PATCH] Ensure git-repack -a -d --max-pack-size=N deletes correct packs

From
DHDana How <danahow@gmail.com>
Date
May 25, 2007, 02:06 UTC
Message-ID
<465644B2.5040203@gmail.com>

The packfile portion of the "remove redundant" code near the bottom of git-repack.sh is broken when pack splitting occurs. Particularly since this is the only place where we automatically delete packfiles, make sure it works properly for all cases, old or new.

This is based on "next".
Signed-off-by: Dana L. How <danahow@gmail.com>
---
 git-repack.sh |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-repack.sh b/git-repack.sh
index 4ea6e5b..0591bd7 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -69,6 +69,7 @@ if [ -z "$names" ]; then
 	echo Nothing new to pack.
 fi
 for name in $names ; do
+	fullbases="$fullbases pack-$name"
 	chmod a-w "$PACKTMP-$name.pack"
 	chmod a-w "$PACKTMP-$name.idx"
 	if test "$quiet" != '-q'; then
@@ -105,8 +106,8 @@ then
 		( cd "$PACKDIR" &&
 		  for e in $existing
 		  do
-			case "$e" in
-			pack-$name) ;;
+			case " $fullbases " in
+			*\ $e\ *) ;;
 			*)	rm -f "$e.pack" "$e.idx" "$e.keep" ;;
 			esac
 		  done
-- 
1.5.2.762.gd8c6-dirty
Message 1 of 1 in “Ensure git-repack -a -d --max-pack-size=N deletes correct packs”
  1. Ensure git-repack -a -d --max-pack-size=N deletes correct packsDana How, May 25, 2007

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.