From: Thomas Rast <trast@student.ethz.ch>
To: <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Marat Radchenko <marat@slonopotamus.org>
Subject: [PATCH] repack: place temporary packs under .git/objects/pack/
Date: Tue, 19 Oct 2010 11:50:43 +0200 [thread overview]
Message-ID: <cbdf4787ddaccd7105ab1661529a98257d61179b.1287481801.git.trast@student.ethz.ch> (raw)
In-Reply-To: <1287474040065-5649864.post@n2.nabble.com>
git-pack-objects is already careful to start out its temporary packs
under .git/objects/pack/ (cf. 8b4eb6b, Do not perform cross-directory
renames when creating packs, 2008-09-22), but git-repack did not
respond in kind so the effort was lost when the filesystem boundary is
exactly at that directory.
Let git-repack pass a path under .git/objects/pack/ as the base for
its temporary packs.
This means we might need the $PACKDIR sooner (before the pack-objects
invocation), so move the mkdir up just to be safe.
Also note that the only use of *.pack is in the find invocation way
before the pack-objects call, so the temporary packs will not suddenly
show up in any wildcards because of the directory change.
Reported-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
git-repack.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/git-repack.sh b/git-repack.sh
index 769baaf..624feec 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -52,7 +52,7 @@ true)
esac
PACKDIR="$GIT_OBJECT_DIRECTORY/pack"
-PACKTMP="$GIT_OBJECT_DIRECTORY/.tmp-$$-pack"
+PACKTMP="$PACKDIR/.tmp-$$-pack"
rm -f "$PACKTMP"-*
trap 'rm -f "$PACKTMP"-*' 0 1 2 3 15
@@ -82,6 +82,8 @@ case ",$all_into_one," in
;;
esac
+mkdir -p "$PACKDIR" || exit
+
args="$args $local ${GIT_QUIET:+-q} $no_reuse$extra"
names=$(git pack-objects --keep-true-parents --honor-pack-keep --non-empty --all --reflog $args </dev/null "$PACKTMP") ||
exit 1
@@ -90,7 +92,6 @@ if [ -z "$names" ]; then
fi
# Ok we have prepared all new packfiles.
-mkdir -p "$PACKDIR" || exit
# First see if there are packs of the same name and if so
# if we can move them out of the way (this can happen if we
--
1.7.3.1.271.ged4d2
next prev parent reply other threads:[~2010-10-19 9:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 6:28 [BUG] git repack fails if .git/objects/pack is on a separate partition Marat Radchenko
2010-10-19 6:59 ` Thomas Rast
2010-10-19 7:29 ` Marat Radchenko
2010-10-19 7:40 ` Marat Radchenko
2010-10-19 9:50 ` Thomas Rast [this message]
2010-10-19 10:17 ` [PATCH] repack: place temporary packs under .git/objects/pack/ Marat Radchenko
2010-10-19 16:33 ` 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=cbdf4787ddaccd7105ab1661529a98257d61179b.1287481801.git.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=marat@slonopotamus.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).