From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: fetching packs and storing them as packs
Date: Sat, 28 Oct 2006 23:50:25 -0400 [thread overview]
Message-ID: <20061029035025.GC3435@spearce.org> (raw)
In-Reply-To: <7vfyd88d6s.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> Shawn Pearce <spearce@spearce.org> writes:
>
> > Shawn Pearce <spearce@spearce.org> wrote:
> >> Why not just use create a new flag file?
> >>
> >> Lets say that a pack X is NOT eligible to be repacked if
> >> "$GIT_DIR/objects/pack/pack-X.keep" exists.
> >
> > Here's the `git repack -a -d` portion of that.
> > Thoughts?
>
> > + args=--unpacked
> > + active=
> > + if test -d "$PACKDIR"
> > + then
> > + for p in `find "$PACKDIR" -type f -name '*.pack' -print`
>
> This change to run 'find "$PACKDIR"' is fragile when your
> $GIT_OBJECT_DIRECTORY has $IFS in it; running "find ." after
> "cd" in a subprocess was done very much on purpose to avoid that
> issue. Please don't break it.
I only broke it because you backed me into a corner with --unpacked=
:-)
The issue is --unpacked= uses the path of the pack name, which
includes $GIT_OBJECT_DIRECTORY, whatever that may be. This makes it
impossible for the shell script to hand through a proper --unpacked=
line for the active packs without including $GIT_OBJECT_DIRECTORY
as part of the option.
I agree with you about the $IFS issue. I'll redraft this patch
tonight such that $IFS doesn't get broken here but that's going
to take a small code patch over in revisions.c, which I'll also
do tonight.
> > + if test "X$args" = X--unpacked
> > + then
> > + args='--unpacked --incremental'
> > + fi
> I do not remember offhand what --incremental meant, but
> presumably this is for the very initial "repack" (PACKDIR did
> not exist or find loop did not find anything to repack) and the
> flag would not make a difference? Care to explain?
I think there is a bug in pack-objects but I couldn't find it last
night. Using --incremental worked around it. :-)
According to the documentation:
--unpacked tells pack-objects to only pack loose objects.
--incremental tells pack-objects to skip any object that is
already contained in a pack even if it appears in the input list.
What I really wanted here was to just use '--unpacked'; if there
are no active packs and the user asked for '-a' we actually just
want to pack the loose objects into a new active pack as we aren't
allowed to touch any of the existing packs (they are all kept or
there simply aren't any packs yet).
However on the git.git repository if I ran `git repack -a -d`
with every single object in a kept pack and no loose objects I kept
repacking the same 102 objects into a new active pack, even though
there were no loose objects to repack and no active packs. Uh, yea.
Adding --incremental in this case kept it from repacking those
same 102 objects on every invocation. Yea, its a bug. I meant to
mention it in my email.
--
next prev parent reply other threads:[~2006-10-29 3:50 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-26 3:44 fetching packs and storing them as packs Nicolas Pitre
2006-10-26 14:45 ` Eran Tromer
[not found] ` <Pine.LNX.4.64.0610261105200.12418@xanadu.home>
2006-10-26 22:09 ` Eran Tromer
2006-10-27 0:50 ` Nicolas Pitre
2006-10-27 1:42 ` Shawn Pearce
2006-10-27 2:38 ` Sean
2006-10-27 6:57 ` Junio C Hamano
2006-10-27 17:23 ` Nicolas Pitre
2006-10-27 2:41 ` Nicolas Pitre
2006-10-27 2:42 ` Eran Tromer
2006-10-27 3:00 ` Shawn Pearce
2006-10-27 3:13 ` Sean
2006-10-27 3:20 ` Jakub Narebski
2006-10-27 3:27 ` Sean
2006-10-27 4:03 ` Eran Tromer
2006-10-27 4:42 ` Shawn Pearce
2006-10-27 7:42 ` Alex Riesen
2006-10-27 7:52 ` Shawn Pearce
2006-10-27 8:08 ` Alex Riesen
2006-10-27 8:13 ` Shawn Pearce
2006-10-27 14:27 ` Nicolas Pitre
2006-10-27 14:38 ` Petr Baudis
2006-10-27 14:48 ` J. Bruce Fields
2006-10-27 15:03 ` Petr Baudis
2006-10-27 16:04 ` J. Bruce Fields
2006-10-27 16:05 ` J. Bruce Fields
2006-10-27 18:56 ` Junio C Hamano
2006-10-27 20:22 ` Linus Torvalds
2006-10-27 21:53 ` Junio C Hamano
2006-10-28 3:42 ` Shawn Pearce
2006-10-28 4:09 ` Junio C Hamano
2006-10-28 4:18 ` Linus Torvalds
2006-10-28 5:42 ` Junio C Hamano
2006-10-28 7:21 ` Shawn Pearce
2006-10-28 8:40 ` Shawn Pearce
2006-10-28 19:15 ` Junio C Hamano
2006-10-29 3:50 ` Shawn Pearce [this message]
2006-10-29 4:29 ` Junio C Hamano
2006-10-29 4:38 ` Shawn Pearce
2006-10-29 5:16 ` Junio C Hamano
2006-10-29 5:21 ` Shawn Pearce
2006-10-28 17:59 ` Linus Torvalds
2006-10-28 18:34 ` Junio C Hamano
2006-10-28 22:31 ` Eran Tromer
2006-10-29 3:38 ` Shawn Pearce
2006-10-29 3:48 ` Jakub Narebski
2006-10-29 3:52 ` Shawn Pearce
2006-10-29 7:47 ` [PATCH] send-pack --keep: do not explode into loose objects on the receiving end Junio C Hamano
2006-10-29 7:56 ` Shawn Pearce
2006-10-29 8:05 ` Junio C Hamano
2006-10-30 1:44 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061029035025.GC3435@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).