From: Kim Gybels <hidden> Date: 2018-06-30 13:46:35
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 <redacted>
---
Patch based on master, since problem doesn't reproduce on maint,
however, the improvement to the test might be valuable on maint.
builtin/gc.c | 1 +
t/t5510-fetch.sh | 2 ++
2 files changed, 3 insertions(+)
@@ -828,9 +828,11 @@ test_expect_success 'fetching with auto-gc does not lock up' 'test_committest2&&(cdauto-gc&&+gitconfigfetch.unpackLimit1&&gitconfiggc.autoPackLimit1&&gitconfiggc.autoDetachfalse&&GIT_ASK_YESNO="$D/askyesno"gitfetch>fetch.out2>&1&&+grep"Auto packing the repository"fetch.out&&!grep"Should I try again"fetch.out)'
On Sat, Jun 30, 2018 at 03:38:21PM +0200, Kim Gybels wrote:
quoted hunk
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 <redacted>
---
Patch based on master, since problem doesn't reproduce on maint,
however, the improvement to the test might be valuable on maint.
builtin/gc.c | 1 +
t/t5510-fetch.sh | 2 ++
2 files changed, 3 insertions(+)
We have repo_clear() which does this and potentially closing file
descriptors on other things as well. I suggest we use it, and before
any external command is run. Something like
@@ -828,9 +828,11 @@ test_expect_success 'fetching with auto-gc does not lock up' 'test_committest2&&(cdauto-gc&&+gitconfigfetch.unpackLimit1&&gitconfiggc.autoPackLimit1&&gitconfiggc.autoDetachfalse&&GIT_ASK_YESNO="$D/askyesno"gitfetch>fetch.out2>&1&&+grep"Auto packing the repository"fetch.out&&
From: Kim Gybels <hidden> Date: 2018-07-04 20:16:29
Teach gc --auto to clear the repository before auto packing it to
prevent failures when removing files on Windows.
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 <redacted>
---
Updated after Duy Nguyen's comments:
- use repo_clear instead of close_all_packs, and add the call in
gc_before_repack intead of just before executing git repack
- use test_i18ngrep instead of grep in updated test
builtin/gc.c | 7 +++++++
t/t5510-fetch.sh | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
@@ -828,10 +828,12 @@ test_expect_success 'fetching with auto-gc does not lock up' 'test_committest2&&(cdauto-gc&&+gitconfigfetch.unpackLimit1&&gitconfiggc.autoPackLimit1&&gitconfiggc.autoDetachfalse&&GIT_ASK_YESNO="$D/askyesno"gitfetch>fetch.out2>&1&&-!grep"Should I try again"fetch.out+test_i18ngrep"Auto packing the repository"fetch.out&&+test_i18ngrep!"Should I try again"fetch.out)'
@@ -828,10 +828,12 @@ test_expect_success 'fetching with auto-gc does not lock up' 'test_committest2&&(cdauto-gc&&+gitconfigfetch.unpackLimit1&&gitconfiggc.autoPackLimit1&&gitconfiggc.autoDetachfalse&&GIT_ASK_YESNO="$D/askyesno"gitfetch>fetch.out2>&1&&-!grep"Should I try again"fetch.out+test_i18ngrep"Auto packing the repository"fetch.out&&+test_i18ngrep!"Should I try again"fetch.out
The messages containing "Auto packing the repository" are indeed
translated, thus they have to be checked with 'test_i18ngrep', good.
However, none of the "Should I try again" messages are translated, so
checking them with bare 'grep' is fine and it shouldn't be changed.
From: Kim Gybels <hidden> Date: 2018-07-09 20:38:07
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 <redacted>
---
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(+)
@@ -828,9 +828,11 @@ test_expect_success 'fetching with auto-gc does not lock up' 'test_committest2&&(cdauto-gc&&+gitconfigfetch.unpackLimit1&&gitconfiggc.autoPackLimit1&&gitconfiggc.autoDetachfalse&&GIT_ASK_YESNO="$D/askyesno"gitfetch>fetch.out2>&1&&+test_i18ngrep"Auto packing the repository"fetch.out&&!grep"Should I try again"fetch.out)'