From: Linus Torvalds <torvalds@osdl.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC] git-pack-refs --prune
Date: Mon, 18 Sep 2006 09:47:33 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0609180934360.4388@g5.osdl.org> (raw)
In-Reply-To: <7vy7shr5zw.fsf_-_@assigned-by-dhcp.cox.net>
On Mon, 18 Sep 2006, Junio C Hamano wrote:
>
> I am not sure I got the locking right, hence this RFC.
It looks correct (the important part to check is that the SHA1 of the ref
you remove still matches the SHA1 of the object you packed).
That said, we should fix it up a bit, notably
- we should _not_ prune refs that are indirect.
Right now, if we have a symbolic link, we _incorrectly_ pack it as
unlinked. The packed format doesn't have any "link" format.
This isn't a problem in practice, because the only link we ever use is
the HEAD link, but it's incorrect. As long as we don't prune, it wasn't
an issue - a unpacked head will always override a packed one, so
packing the thing didn't really matter.
- we should probably avoid even trying to prune stuff that was already
packed.
The way to fix both these problems at once would be to add a flag to the
"for_each_ref()", which says whether it followed a link, or whether it was
already packed, so that we wouldn't pack symlinks at all, and we wouldn't
add already-packed refs to the "keeprefs" list.
But that requires a sligh semantic extension to "do_for_each_ref()" (and
"struct ref_list" needs a flag to say whether it was looked up through a
symlink).
I was thinking that the easy way to solve it is to just _pack_ everything
(the way we do now - incorrectly for symrefs), but never prune a symref.
Linus
next prev parent reply other threads:[~2006-09-18 16:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-11 19:03 Allow multiple "git_path()" uses Linus Torvalds
2006-09-11 23:37 ` Start handling references internally as a sorted in-memory list Linus Torvalds
2006-09-11 23:50 ` Linus Torvalds
2006-09-11 23:57 ` Junio C Hamano
2006-09-12 1:05 ` Linus Torvalds
2006-09-12 1:09 ` Chris Wedgwood
2006-09-12 3:10 ` Add support for negative refs Linus Torvalds
2006-09-12 3:17 ` Make ref resolution saner Linus Torvalds
2006-09-12 5:36 ` Jeff King
2006-09-12 14:41 ` Linus Torvalds
2006-09-18 7:25 ` [RFC] git-pack-refs --prune Junio C Hamano
2006-09-18 16:47 ` Linus Torvalds [this message]
2006-09-18 18:44 ` Junio C Hamano
2006-09-21 7:02 ` Junio C Hamano
2006-09-21 7:06 ` [PATCH 1/5] symbolit-ref: fix resolve_ref conversion Junio C Hamano
2006-09-21 7:06 ` [PATCH 2/5] Add callback data to for_each_ref() family Junio C Hamano
2006-09-21 7:06 ` [PATCH 3/5] Tell between packed, unpacked and symbolic refs Junio C Hamano
2006-09-21 7:06 ` [PATCH 4/5] pack-refs: do not pack " Junio C Hamano
2006-09-21 7:06 ` [PATCH 5/5] git-pack-refs --prune Junio C Hamano
2006-09-21 15:19 ` [RFC] " Linus Torvalds
2006-09-22 4:57 ` Junio C Hamano
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=Pine.LNX.4.64.0609180934360.4388@g5.osdl.org \
--to=torvalds@osdl.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).