From: Jeff King <peff@peff.net>
To: Mike Galbraith <efault@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Jon Jensen <jon@endpoint.com>,
git@vger.kernel.org
Subject: Re: How to stop sharing objects between repositories
Date: Mon, 17 Aug 2009 02:48:02 -0400 [thread overview]
Message-ID: <20090817064801.GA31543@coredump.intra.peff.net> (raw)
In-Reply-To: <1250475682.7155.16.camel@marge.simson.net>
On Mon, Aug 17, 2009 at 04:21:22AM +0200, Mike Galbraith wrote:
> > (1) Such a user does not necessarily know a casual "git repack -a" breaks
> > the dependency, defeating the -s option s/he deliberately used in
> > order to save disk space in the first place. Perhaps we can reword
> > this further to kill two penguins with a single stone?
>
> Perhaps a runtime warning that you're about to break it? This user may
> not even be the one who set the thing up, no?
I'm not really sure what such a setup would look like. If it is a big
hosting site like kernel.org or repo.or.cz, then probably it wouldn't
matter much. The admins there should probably be running "git repack -l
-d -A" periodically to consolidate the object stores (which can happen
from this sort of repacking, or from people just pushing the same
commits to their repos).
That being said, I can see there being setups where such a warning might
be useful. However, we don't really know if the user _wants_ that
effect, or if it is an accident. So people following the recommnded
"here is how you break the dependency" advice will also get the warning.
I'm torn on whether this is actually a good idea.
-- >8 --
Subject: [PATCH] repack: warn when "-l" is not used with alternates
Failing to use "-l" means that we will copy objects from the
source repository, nullifying the usefulness of "-s". We
don't want to make this an error, though, since "git repack
-a" is used to intentionally break the dependency.
Signed-off-by: Jeff King <peff@peff.net>
---
Is "test -s" portable? It's in POSIX, but I have some lingering doubt in
the back of my mind.
A user seeing such a warning can perhaps ^C to abort the pack. However,
should we also give instructions on how to undo the copying (which
should be "git repack -d -l -A")?
git-repack.sh | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/git-repack.sh b/git-repack.sh
index 1eb3bca..0bdc6e9 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -44,6 +44,15 @@ do
shift
done
+if test -z "$local" && test -s "$GIT_DIR/objects/info/alternates"; then
+cat >&2 <<'EOF'
+warning: this repository uses objects from other repositories via the
+warning: "alternates" mechanism; repacking without "-l" will cause objects
+warning: to be copied into this repository, wasting disk space.
+
+EOF
+fi
+
case "`git config --bool repack.usedeltabaseoffset || echo true`" in
true)
extra="$extra --delta-base-offset" ;;
--
1.6.4.283.ga2765.dirty
next prev parent reply other threads:[~2009-08-17 6:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-16 0:04 How to stop sharing objects between repositories Jon Jensen
2009-08-16 8:43 ` Johannes Schindelin
2009-08-16 12:28 ` Jeff King
2009-08-16 12:30 ` Johannes Schindelin
2009-08-16 13:54 ` Daniel Villeneuve
2009-08-16 13:57 ` Johannes Schindelin
2009-08-16 13:57 ` Jeff King
2009-08-16 19:16 ` Junio C Hamano
2009-08-17 2:21 ` Mike Galbraith
2009-08-17 6:48 ` Jeff King [this message]
2009-08-17 7:12 ` Mike Galbraith
2009-08-17 7:24 ` Junio C Hamano
2009-08-17 7:25 ` Jeff King
2009-08-17 7:35 ` Junio C Hamano
2009-08-17 7:50 ` Jeff King
2009-08-17 6:19 ` Jeff King
2009-08-17 6:32 ` Jeff King
2009-08-17 6:31 ` 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=20090817064801.GA31543@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=efault@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jon@endpoint.com \
/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