git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Brandon Casey <drafnel@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git gc & deleted branches
Date: Fri, 9 May 2008 00:19:21 -0400	[thread overview]
Message-ID: <20080509041921.GA14773@sigill.intra.peff.net> (raw)
In-Reply-To: <loom.20080509T011318-478@post.gmane.org>

On Fri, May 09, 2008 at 01:41:30AM +0000, Brandon Casey wrote:

> Here's what I was thinking (posted using gmane):
> 
> diff --git a/git-repack.sh b/git-repack.sh
> index e18eb3f..064c331 100755
> --- a/git-repack.sh
> +++ b/git-repack.sh

I like it. It makes an easy rule to say "packed objects _never_ get
pruned, they only get demoted to loose objects." And then of course
we have sane rules for pruning loose objects.

> -       rm -f "$PACKDIR/old-pack-$name.pack" "$PACKDIR/old-pack-$name.idx"
> +       rm -f "$PACKDIR/old-pack-$name.idx"
> +       test -z "$keep_unreachable" ||
> +         ! test -f "$PACKDIR/old-pack-$name.pack" ||
> +         git unpack-objects < "$PACKDIR/old-pack-$name.pack" || {
> +               echo >&2 "Failed unpacking unreachable objects from old pack"
> +               echo >&2 "saved as old-pack-$name.pack in $PACKDIR."
> +               exit 1
> +       }
> +       rm -f "$PACKDIR/old-pack-$name.pack"
> [...]
> 
> Is the first invocation of unpack-objects necessary? pack-objects has created
> a pack which hashes to the same name of a pack we already have, and we replace
> the original with the new one. Is that what is happening? They will be
> identical right?

Yeah, that's what it looks like to me (that the first unpack is
unnecessary, because we will just be putting the new pack into place
that has all the same objects). AIUI, two packs with identical hashes
must contain the exact same objects.

> Of course this won't set the timestamp on the created objects based on the
> timestamp of the pack file, but this was easy. Setting the timestamp would be
> proper, but what's another two weeks. Besides, for those users not manually
> running git-gc, this code path won't even be executed until there are enough
> pack files for git-gc to add -A to the repack options.

I think the extra two weeks is fine.

-Peff

  parent reply	other threads:[~2008-05-09  4:20 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08 17:45 git gc & deleted branches Guido Ostkamp
2008-05-08 18:39 ` Jeff King
2008-05-08 18:55   ` Guido Ostkamp
2008-05-08 20:07     ` Brandon Casey
2008-05-08 20:52       ` Guido Ostkamp
2008-05-08 21:01         ` Jeff King
2008-05-08 21:15           ` Nicolas Pitre
2008-05-08 21:17             ` Jeff King
2008-05-08 21:23               ` Brandon Casey
2008-05-08 21:31                 ` Jeff King
2008-05-08 21:40                   ` Brandon Casey
2008-05-08 21:44                     ` Jeff King
2008-05-08 21:53                       ` Brandon Casey
2008-05-08 22:48                         ` Jeff King
2008-05-09  1:41                           ` Brandon Casey
2008-05-09  3:21                             ` Junio C Hamano
     [not found]                               ` <ee63ef30805082105w7f04a2d1y65a4618aeb787cac@mail.gmail.com>
     [not found]                                 ` <7v1w4bb291.fsf@gitster.siamese.dyndns.org>
2008-05-10  3:32                                   ` Brandon Casey
2008-05-10  4:15                                     ` Brandon Casey
2008-05-10  4:01                               ` [PATCH 0/3] leave unreferenced objects unpacked drafnel
2008-05-10  4:01                               ` [PATCH 1/3] repack: modify behavior of -A option to " drafnel
2008-05-10  6:03                                 ` Jeff King
2008-05-11  1:10                                   ` Nicolas Pitre
2008-05-11  1:23                                     ` Junio C Hamano
2008-05-11  4:16                                   ` Brandon Casey
2008-05-11  4:51                                     ` Brandon Casey
2008-05-10  4:01                               ` [PATCH 2/3] git-gc: always use -A when manually repacking drafnel
2008-05-10  4:01                               ` [PATCH 3/3] builtin-gc.c: deprecate --prune, it now really has no effect drafnel
2008-05-09  4:19                             ` Jeff King [this message]
2008-05-09 15:00                               ` git gc & deleted branches Geert Bosch
2008-05-09 15:14                                 ` Brandon Casey
2008-05-09 15:53                                   ` Jeff King
2008-05-09 15:56                                     ` Brandon Casey
2008-05-09 16:12                                   ` Nicolas Pitre
2008-05-09 16:54                                     ` Brandon Casey
2008-05-09 22:33                                     ` Junio C Hamano
2008-05-09 23:09                                       ` [PATCH] Updating documentation to match Brandon Casey's proposed git-repack patch Chris Frey
2008-05-10  0:07                                       ` git gc & deleted branches Jeremy Maitin-Shepard
2008-05-10  0:20                                         ` Shawn O. Pearce
2008-05-10  0:43                                           ` Jeremy Maitin-Shepard
2008-05-10  1:21                                           ` Junio C Hamano
2008-05-10  1:51                                             ` Jeremy Maitin-Shepard
2008-05-10  5:25                                               ` Jeff King
2008-05-10  5:36                                                 ` Jeremy Maitin-Shepard
2008-05-10  9:04                                                   ` Johannes Schindelin
2008-05-10 16:24                                                     ` Jeremy Maitin-Shepard
2008-05-11 11:11                                                       ` Johannes Schindelin
2008-05-11 18:39                                                         ` Junio C Hamano
2008-05-08 21:33           ` Guido Ostkamp
2008-05-08 20:56       ` Jeff King
2008-05-08 20:51     ` Jeff King

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=20080509041921.GA14773@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    /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).