{"thread":{"id":"38414","subject":"[PATCH] update-ref: Handle large transactions properly","startedAt":"2015-01-21T01:20:55Z","lastAt":"2015-01-21T01:21:48Z","messageCount":2,"participants":["Stefan Beller"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"254972","messageId":"1421803255-4037-1-git-send-email-sbeller@google.com","threadId":"38414","inReplyTo":null,"subject":"[PATCH] update-ref: Handle large transactions properly","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-01-21T01:20:55Z","receivedAt":"2015-01-21T01:20:55Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Test if we can do arbitrary large transactions. Currently this is a known\nbug that we cannot do large transactions, so document it at least in the\ntest suite.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n t/t1400-update-ref.sh | 27 +++++++++++++++++++++++++++\n 1 file changed, 27 insertions(+)\n\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex 6805b9e..a7dd1ff 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -1065,4 +1065,31 @@ test_expect_success 'stdin -z delete refs works with packed and loose refs' '\n \ttest_must_fail git rev-parse --verify -q $c\n '\n \n+run_with_limited_open_files () {\n+\t(ulimit -n 64 && \"$@\")\n+}\n+\n+test_lazy_prereq ULIMIT 'run_with_limited_open_files true'\n+\n+test_expect_failure ULIMIT 'large transaction creating branches does not burst open file limit' '\n+(\n+\tfor i in $(seq 65)\n+\t\techo \"create refs/heads/$i HEAD\"\n+\tdone >large_input &&\n+\tgit update-ref --stdin <large_input &&\n+\tgit rev-parse --verify -q refs/heads/65\n+)\n+'\n+\n+test_expect_failure ULIMIT 'large transaction deleting branches does not burst open file limit' '\n+(\n+\tfor i in $(seq 33)\n+\tdo\n+\t\techo \"delete refs/heads/$i HEAD\"\n+\tdone >large_input &&\n+\tgit update-ref --stdin <large_input &&\n+\ttest_must_fail git rev-parse --verify -q refs/heads/65\n+)\n+'\n+\n test_done\n-- \n2.2.1.62.g3f15098\n"},{"id":"254973","messageId":"CAGZ79kZax5cyVy=uZq8eKLM0+FXDjOF1LS+_tkN4sbX0+HsUjQ@mail.gmail.com","threadId":"38414","inReplyTo":"1421803255-4037-1-git-send-email-sbeller@google.com","subject":"Re: [PATCH] update-ref: Handle large transactions properly","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2015-01-21T01:21:48Z","receivedAt":"2015-01-21T01:21:48Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Tue, Jan 20, 2015 at 5:20 PM, Stefan Beller <sbeller@google.com> wrote:\n> Test if we can do arbitrary large transactions. Currently this is a known\n> bug that we cannot do large transactions, so document it at least in the\n> test suite.\n>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n>  t/t1400-update-ref.sh | 27 +++++++++++++++++++++++++++\n>  1 file changed, 27 insertions(+)\n>\n> diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\n> index 6805b9e..a7dd1ff 100755\n> --- a/t/t1400-update-ref.sh\n> +++ b/t/t1400-update-ref.sh\n> @@ -1065,4 +1065,31 @@ test_expect_success 'stdin -z delete refs works with packed and loose refs' '\n>         test_must_fail git rev-parse --verify -q $c\n>  '\n>\n> +run_with_limited_open_files () {\n> +       (ulimit -n 64 && \"$@\")\n> +}\n> +\n> +test_lazy_prereq ULIMIT 'run_with_limited_open_files true'\n> +\n> +test_expect_failure ULIMIT 'large transaction creating branches does not burst open file limit' '\n> +(\n> +       for i in $(seq 65)\n> +               echo \"create refs/heads/$i HEAD\"\n> +       done >large_input &&\n> +       git update-ref --stdin <large_input &&\n> +       git rev-parse --verify -q refs/heads/65\n> +)\n> +'\n> +\n> +test_expect_failure ULIMIT 'large transaction deleting branches does not burst open file limit' '\n> +(\n> +       for i in $(seq 33)\n\nThis should be 65 of course. :/\n\n> +       do\n> +               echo \"delete refs/heads/$i HEAD\"\n> +       done >large_input &&\n> +       git update-ref --stdin <large_input &&\n> +       test_must_fail git rev-parse --verify -q refs/heads/65\n> +)\n> +'\n> +\n>  test_done\n> --\n> 2.2.1.62.g3f15098\n>\n"}]}