From: Kim Gybels <kgybels@infogroep.be>
To: git@vger.kernel.org
Cc: "Kim Gybels" <kgybels@infogroep.be>,
"Adam Borowski" <kilobyte@angband.pl>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Michael J Gruber" <git@grubix.eu>,
"SZEDER Gábor" <szeder.dev@gmail.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Torsten Bögershausen" <tboegi@web.de>
Subject: [PATCH v3] gc --auto: release pack files before auto packing
Date: Mon, 9 Jul 2018 22:37:27 +0200 [thread overview]
Message-ID: <20180709203727.8236-1-kgybels@infogroep.be> (raw)
In-Reply-To: <20180704201600.9908-1-kgybels@infogroep.be>
Teach gc --auto to release pack files before auto packing the repository
to prevent failures when removing them.
Also teach the test 'fetching with auto-gc does not lock up' to complain
when it is no longer triggering an auto packing of the repository.
Fixes https://github.com/git-for-windows/git/issues/500
Signed-off-by: Kim Gybels <kgybels@infogroep.be>
---
Changes since v2:
- revert fix back to v1: use close_all_packs instead of repo_clear
- use test_i18ngrep only for translated string
builtin/gc.c | 1 +
t/t5510-fetch.sh | 2 ++
2 files changed, 3 insertions(+)
diff --git a/builtin/gc.c b/builtin/gc.c
index ccfb1ceaeb..63b62ab57c 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -612,6 +612,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
return -1;
if (!repository_format_precious_objects) {
+ close_all_packs(the_repository->objects);
if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
return error(FAILED_RUN, repack.argv[0]);
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index e402aee6a2..6f1450eb69 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -828,9 +828,11 @@ test_expect_success 'fetching with auto-gc does not lock up' '
test_commit test2 &&
(
cd auto-gc &&
+ git config fetch.unpackLimit 1 &&
git config gc.autoPackLimit 1 &&
git config gc.autoDetach false &&
GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
+ test_i18ngrep "Auto packing the repository" fetch.out &&
! grep "Should I try again" fetch.out
)
'
--
2.18.0.windows.1
prev parent reply other threads:[~2018-07-09 20:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-30 13:38 [PATCH] gc --auto: release pack files before auto packing Kim Gybels
2018-06-30 14:58 ` Duy Nguyen
2018-07-06 16:39 ` Junio C Hamano
2018-07-07 9:40 ` SZEDER Gábor
2018-07-07 23:16 ` Kim Gybels
2018-07-09 14:33 ` Duy Nguyen
2018-07-09 21:10 ` Junio C Hamano
2018-07-11 15:33 ` Duy Nguyen
2018-07-04 20:16 ` [PATCH v2] gc --auto: clear repository " Kim Gybels
2018-07-07 9:57 ` SZEDER Gábor
2018-07-09 20:37 ` Kim Gybels [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180709203727.8236-1-kgybels@infogroep.be \
--to=kgybels@infogroep.be \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@grubix.eu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kilobyte@angband.pl \
--cc=pclouds@gmail.com \
--cc=peff@peff.net \
--cc=szeder.dev@gmail.com \
--cc=tboegi@web.de \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).