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

Re: [PATCH] repack: allow simultaneous packing and pruning

From
Junio C Hamano <junkio@cox.net>
Date
Oct 10, 2006, 20:24 UTC
Message-ID
<7vk637zzpk.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0610100800490.3952@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 10 quoted lines
> On Tue, 10 Oct 2006, Sam Vilain wrote:
>>
>> If using git-repack -a, unreferenced objects are kept behind in the
>> pack.  This might be the best default, but there are no good ways
>> to clean up the packfiles if a lot of rebasing is happening, or
>> branches have been deleted.
>
> Don't do this.
>
> I understand why you want to do it, but the fact is, it's dangerous.

Sorry, I understand "it's dangerous" part, but I do not understand "why you want to do it" part.

@@ -32,6 +33,11 @@ case ",$all_into_one," in
 ,,)
 	rev_list='--unpacked'
 	pack_objects='--incremental'
+	if [ -n "$prune" ]
+	then
+	    # prune junk first
+	    git-prune
+	fi
 	;;
 ,t,)
 	rev_list=

This shouldn't make any difference if the repository is
quiescent (and is dangerous if it isn't).  pack-objects will
not get fed things that are not reachable.

@@ -40,8 +46,14 @@ case ",$all_into_one," in
 	# Redundancy check in all-into-one case is trivial.
 	existing=`cd "$PACKDIR" && \
 	    find . -type f \( -name '*.pack' -o -name '*.idx' \) -print`
+
+	if [ -n "$prune" ]
+	then
+	    rev_list=`cd "$GIT_DIR" && find refs -type f -print`
+	fi
 	;;
 esac
+

We give --all to rev-list so this should not have any effect
either; other than that the code introduced by this hunk is
broken with packed-refs.

Isn't "repack -a -d" what Sam wants?
Previous: Eran Tromer
Message 9 of 9 in “repack: allow simultaneous packing and pruning”
  1. repack: allow simultaneous packing and pruningSam Vilain, Oct 10, 2006
  2. Sam VilainOct 10, 2006
  3. Linus TorvaldsOct 10, 2006
  4. Eran TromerOct 10, 2006
  5. Linus TorvaldsOct 10, 2006
  6. Eran TromerOct 10, 2006
  7. Linus TorvaldsOct 10, 2006
  8. Eran TromerOct 10, 2006
  9. Junio C HamanoOct 10, 2006

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.