{"thread":{"id":"66147","subject":"[PATCH] sequencer: release the ODB before spawning git commit","startedAt":"2026-08-10T19:04:52Z","lastAt":"2026-08-25T15:54:26Z","messageCount":7,"participants":["Johannes Schindelin via GitGitGadget","Junio C Hamano","Phillip Wood"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"550213","messageId":"pull.2198.git.1786388689444.gitgitgadget@gmail.com","threadId":"66147","inReplyTo":null,"subject":"[PATCH] sequencer: release the ODB before spawning git commit","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-08-10T19:04:48Z","receivedAt":"2026-08-10T19:04:52Z","isPatch":true,"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nAs of 4557f1add261 (rebase--helper: add a builtin helper for interactive\nrebases, 2017-02-09), continuing an interactive rebase uses the builtin\nsequencer, which spawns `git commit`.\n\nThe child may trigger auto-maintenance, which may need to replace files\nfor which the sequencer still holds resources. See\nhttps://github.com/git-for-windows/git/issues/6315: on Windows, this\nproduces unlink retry prompts that cannot succeed while the sequencer\nwaits for the child.\n\nResources such as file handles or memory mappings must be released\nbefore spawning a command that may run auto-maintenance, as established\nby 28d04e1ec197 (run-command: offer to close the object store before\nrunning, 2021-09-09).\n\nRelease the sequencer's ODB before spawning `git commit`. The regression\ntest uses the legacy-delete trick introduced by 69ed0e35a754 (mingw:\noptionally use legacy (non-POSIX) delete semantics, 2026-05-07) to\ntrigger the failure on modern Windows.\n\nAssisted-by: GPT-5.6 Sol\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    sequencer: release the ODB before spawning git commit\n    \n    This fixes https://github.com/git-for-windows/git/issues/6315\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2198%2Fgit-for-windows%2Frebase-release-odb-before-commit-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2198/git-for-windows/rebase-release-odb-before-commit-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2198\n\n sequencer.c                   |  1 +\n t/t3404-rebase-interactive.sh | 18 ++++++++++++++++++\n 2 files changed, 19 insertions(+)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 57855b0066..83952d96e3 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1127,6 +1127,7 @@ static int run_git_commit(const char *defmsg,\n \tstruct child_process cmd = CHILD_PROCESS_INIT;\n \n \tcmd.git_cmd = 1;\n+\tcmd.odb_to_close = the_repository->objects;\n \n \tif (is_rebase_i(opts) &&\n \t    ((opts->committer_date_is_author_date && !opts->ignore_date) ||\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 58b3bb0c27..8f81c80fd4 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -65,6 +65,24 @@ test_expect_success 'setup' '\n \ttest_commit P fileP\n '\n \n+test_expect_success MINGW 'rebase releases object database before committing' '\n+\ttest_when_finished \"rm -f .git/hooks/post-commit repacked packs\" &&\n+\tgit switch -C repack-rewrite primary &&\n+\tgit repack -ad &&\n+\twrite_script .git/hooks/post-commit <<-\\EOF &&\n+\tgit repack -ad &&\n+\t>repacked\n+\tEOF\n+\t(\n+\t\tset_fake_editor &&\n+\t\tFAKE_LINES=\"reword 1\" GIT_TEST_LEGACY_DELETE=1 \\\n+\t\t\tgit -c core.commitGraph=false rebase -i HEAD^\n+\t) &&\n+\ttest_path_is_file repacked &&\n+\tls .git/objects/pack/*.pack >packs &&\n+\ttest_line_count = 1 packs\n+'\n+\n # \"exec\" commands are run with the user shell by default, but this may\n # be non-POSIX. For example, if SHELL=zsh then \">file\" doesn't work\n # to create a file. Unsetting SHELL avoids such non-portable behavior\n\nbase-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc\n-- \ngitgitgadget\n"},{"id":"550319","messageId":"xmqqo6f81pre.fsf@gitster.g","threadId":"66147","inReplyTo":"pull.2198.git.1786388689444.gitgitgadget@gmail.com","subject":"Re: [PATCH] sequencer: release the ODB before spawning git commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-11T18:22:13Z","receivedAt":"2026-08-11T18:22:15Z","isPatch":true,"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> As of 4557f1add261 (rebase--helper: add a builtin helper for interactive\n> rebases, 2017-02-09), continuing an interactive rebase uses the builtin\n> sequencer, which spawns `git commit`.\n>\n> The child may trigger auto-maintenance, which may need to replace files\n> for which the sequencer still holds resources. See\n> https://github.com/git-for-windows/git/issues/6315: on Windows, this\n> produces unlink retry prompts that cannot succeed while the sequencer\n> waits for the child.\n>\n> Resources such as file handles or memory mappings must be released\n> before spawning a command that may run auto-maintenance, as established\n> by 28d04e1ec197 (run-command: offer to close the object store before\n> running, 2021-09-09).\n\nThe sequencer is holding some resources, presumably because it needs\nthem to continue, and yet auto-maintenance wants to remove them?\nWhether or not we face a Windows-specific limitation when removing\nthem, it is concerning to imagine what would happen if\nauto-maintenance were allowed to do so and the sequencer then\nresumed its work, only to find that the resources needed for its\noperation were gone.\n\nI think what the proposed commit log message lacks after 'must be\nreleased' is 'and after auto-maintenance finishes and we regain\ncontrol, we will automatically reacquire these resources in a\nrefreshed state to proceed'.  Such an explanation would allay the\nunease I expressed in the previous paragraph.\n\nPerhaps issues/6315 talks about what exactly are held, but not\nspelling it out in the log message is not helping readers.\n\n> Release the sequencer's ODB before spawning `git commit`.\n\nMakes sense.\n\n> The regression\n> test uses the legacy-delete trick introduced by 69ed0e35a754 (mingw:\n> optionally use legacy (non-POSIX) delete semantics, 2026-05-07) to\n> trigger the failure on modern Windows.\n\n> diff --git a/sequencer.c b/sequencer.c\n> index 57855b0066..83952d96e3 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -1127,6 +1127,7 @@ static int run_git_commit(const char *defmsg,\n>  \tstruct child_process cmd = CHILD_PROCESS_INIT;\n>  \n>  \tcmd.git_cmd = 1;\n> +\tcmd.odb_to_close = the_repository->objects;\n>  \n>  \tif (is_rebase_i(opts) &&\n>  \t    ((opts->committer_date_is_author_date && !opts->ignore_date) ||\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 58b3bb0c27..8f81c80fd4 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -65,6 +65,24 @@ test_expect_success 'setup' '\n>  \ttest_commit P fileP\n>  '\n>  \n> +test_expect_success MINGW 'rebase releases object database before committing' '\n> +\ttest_when_finished \"rm -f .git/hooks/post-commit repacked packs\" &&\n> +\tgit switch -C repack-rewrite primary &&\n> +\tgit repack -ad &&\n> +\twrite_script .git/hooks/post-commit <<-\\EOF &&\n> +\tgit repack -ad &&\n> +\t>repacked\n> +\tEOF\n> +\t(\n> +\t\tset_fake_editor &&\n> +\t\tFAKE_LINES=\"reword 1\" GIT_TEST_LEGACY_DELETE=1 \\\n> +\t\t\tgit -c core.commitGraph=false rebase -i HEAD^\n> +\t) &&\n> +\ttest_path_is_file repacked &&\n> +\tls .git/objects/pack/*.pack >packs &&\n> +\ttest_line_count = 1 packs\n> +'\n> +\n>  # \"exec\" commands are run with the user shell by default, but this may\n>  # be non-POSIX. For example, if SHELL=zsh then \">file\" doesn't work\n>  # to create a file. Unsetting SHELL avoids such non-portable behavior\n>\n> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc\n"},{"id":"550388","messageId":"pull.2198.v2.git.1786528498689.gitgitgadget@gmail.com","threadId":"66147","inReplyTo":"pull.2198.git.1786388689444.gitgitgadget@gmail.com","subject":"[PATCH v2] sequencer: release the ODB before spawning git commit","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-08-12T09:54:57Z","receivedAt":"2026-08-12T09:55:02Z","isPatch":true,"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nAs of 4557f1add261 (rebase--helper: add a builtin helper for interactive\nrebases, 2017-02-09), continuing an interactive rebase uses the builtin\nsequencer, which spawns `git commit`.\n\nThe child may trigger auto-maintenance, which may need to replace files\nfor which the sequencer still holds resources. See\nhttps://github.com/git-for-windows/git/issues/6315: on Windows, this\nproduces unlink retry prompts that cannot succeed while the sequencer\nwaits for the child.\n\nResources such as file handles or memory mappings must be released\nbefore spawning a command that may run auto-maintenance, as established\nby 28d04e1ec197 (run-command: offer to close the object store before\nrunning, 2021-09-09): release the ODB file handles and memory mappings,\nso that auto-gc can repack (potentially deleting existing packfiles in\nthe process); If the sequencer needs to access the ODB afterwards, it\nwill gracefully (re-)open the ODB.\n\nRelease the sequencer's ODB before spawning `git commit`. The regression\ntest uses the legacy-delete trick introduced by 69ed0e35a754 (mingw:\noptionally use legacy (non-POSIX) delete semantics, 2026-05-07) to\ntrigger the failure on modern Windows.\n\nAssisted-by: GPT-5.6 Sol\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    sequencer: release the ODB before spawning git commit\n    \n    This fixes https://github.com/git-for-windows/git/issues/6315\n    \n    Changes since v1:\n    \n     * Clarify in the commit message what the strategy introduced in\n       28d04e1ec197 (run-command: offer to close the object store before\n       running, 2021-09-09) is all about.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2198%2Fgit-for-windows%2Frebase-release-odb-before-commit-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2198/git-for-windows/rebase-release-odb-before-commit-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2198\n\nRange-diff vs v1:\n\n 1:  904d65e8cb ! 1:  039fd29039 sequencer: release the ODB before spawning git commit\n     @@ Commit message\n          Resources such as file handles or memory mappings must be released\n          before spawning a command that may run auto-maintenance, as established\n          by 28d04e1ec197 (run-command: offer to close the object store before\n     -    running, 2021-09-09).\n     +    running, 2021-09-09): release the ODB file handles and memory mappings,\n     +    so that auto-gc can repack (potentially deleting existing packfiles in\n     +    the process); If the sequencer needs to access the ODB afterwards, it\n     +    will gracefully (re-)open the ODB.\n      \n          Release the sequencer's ODB before spawning `git commit`. The regression\n          test uses the legacy-delete trick introduced by 69ed0e35a754 (mingw:\n\n\n sequencer.c                   |  1 +\n t/t3404-rebase-interactive.sh | 18 ++++++++++++++++++\n 2 files changed, 19 insertions(+)\n\ndiff --git a/sequencer.c b/sequencer.c\nindex 57855b0066..83952d96e3 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -1127,6 +1127,7 @@ static int run_git_commit(const char *defmsg,\n \tstruct child_process cmd = CHILD_PROCESS_INIT;\n \n \tcmd.git_cmd = 1;\n+\tcmd.odb_to_close = the_repository->objects;\n \n \tif (is_rebase_i(opts) &&\n \t    ((opts->committer_date_is_author_date && !opts->ignore_date) ||\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 58b3bb0c27..8f81c80fd4 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -65,6 +65,24 @@ test_expect_success 'setup' '\n \ttest_commit P fileP\n '\n \n+test_expect_success MINGW 'rebase releases object database before committing' '\n+\ttest_when_finished \"rm -f .git/hooks/post-commit repacked packs\" &&\n+\tgit switch -C repack-rewrite primary &&\n+\tgit repack -ad &&\n+\twrite_script .git/hooks/post-commit <<-\\EOF &&\n+\tgit repack -ad &&\n+\t>repacked\n+\tEOF\n+\t(\n+\t\tset_fake_editor &&\n+\t\tFAKE_LINES=\"reword 1\" GIT_TEST_LEGACY_DELETE=1 \\\n+\t\t\tgit -c core.commitGraph=false rebase -i HEAD^\n+\t) &&\n+\ttest_path_is_file repacked &&\n+\tls .git/objects/pack/*.pack >packs &&\n+\ttest_line_count = 1 packs\n+'\n+\n # \"exec\" commands are run with the user shell by default, but this may\n # be non-POSIX. For example, if SHELL=zsh then \">file\" doesn't work\n # to create a file. Unsetting SHELL avoids such non-portable behavior\n\nbase-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc\n-- \ngitgitgadget\n"},{"id":"550417","messageId":"xmqqqzk3xqxs.fsf@gitster.g","threadId":"66147","inReplyTo":"pull.2198.v2.git.1786528498689.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] sequencer: release the ODB before spawning git commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-12T16:07:59Z","receivedAt":"2026-08-12T16:08:01Z","isPatch":true,"body":"\"Johannes Schindelin via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> As of 4557f1add261 (rebase--helper: add a builtin helper for interactive\n> rebases, 2017-02-09), continuing an interactive rebase uses the builtin\n> sequencer, which spawns `git commit`.\n>\n> The child may trigger auto-maintenance, which may need to replace files\n> for which the sequencer still holds resources. See\n> https://github.com/git-for-windows/git/issues/6315: on Windows, this\n> produces unlink retry prompts that cannot succeed while the sequencer\n> waits for the child.\n>\n> Resources such as file handles or memory mappings must be released\n> before spawning a command that may run auto-maintenance, as established\n> by 28d04e1ec197 (run-command: offer to close the object store before\n> running, 2021-09-09): release the ODB file handles and memory mappings,\n> so that auto-gc can repack (potentially deleting existing packfiles in\n> the process); If the sequencer needs to access the ODB afterwards, it\n> will gracefully (re-)open the ODB.\n>\n> Release the sequencer's ODB before spawning `git commit`. The regression\n> test uses the legacy-delete trick introduced by 69ed0e35a754 (mingw:\n> optionally use legacy (non-POSIX) delete semantics, 2026-05-07) to\n> trigger the failure on modern Windows.\n>\n> Assisted-by: GPT-5.6 Sol\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>     sequencer: release the ODB before spawning git commit\n>     \n>     This fixes https://github.com/git-for-windows/git/issues/6315\n\nThanks.  Let me mark the topic for 'next'.\n\n> diff --git a/sequencer.c b/sequencer.c\n> index 57855b0066..83952d96e3 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -1127,6 +1127,7 @@ static int run_git_commit(const char *defmsg,\n>  \tstruct child_process cmd = CHILD_PROCESS_INIT;\n>  \n>  \tcmd.git_cmd = 1;\n> +\tcmd.odb_to_close = the_repository->objects;\n>  \n>  \tif (is_rebase_i(opts) &&\n>  \t    ((opts->committer_date_is_author_date && !opts->ignore_date) ||\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 58b3bb0c27..8f81c80fd4 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -65,6 +65,24 @@ test_expect_success 'setup' '\n>  \ttest_commit P fileP\n>  '\n>  \n> +test_expect_success MINGW 'rebase releases object database before committing' '\n> +\ttest_when_finished \"rm -f .git/hooks/post-commit repacked packs\" &&\n> +\tgit switch -C repack-rewrite primary &&\n> +\tgit repack -ad &&\n> +\twrite_script .git/hooks/post-commit <<-\\EOF &&\n> +\tgit repack -ad &&\n> +\t>repacked\n> +\tEOF\n> +\t(\n> +\t\tset_fake_editor &&\n> +\t\tFAKE_LINES=\"reword 1\" GIT_TEST_LEGACY_DELETE=1 \\\n> +\t\t\tgit -c core.commitGraph=false rebase -i HEAD^\n> +\t) &&\n> +\ttest_path_is_file repacked &&\n> +\tls .git/objects/pack/*.pack >packs &&\n> +\ttest_line_count = 1 packs\n> +'\n> +\n>  # \"exec\" commands are run with the user shell by default, but this may\n>  # be non-POSIX. For example, if SHELL=zsh then \">file\" doesn't work\n>  # to create a file. Unsetting SHELL avoids such non-portable behavior\n>\n> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc\n"},{"id":"551121","messageId":"a786e6c0-1c17-4121-8623-b4541478a88f@gmail.com","threadId":"66147","inReplyTo":"pull.2198.v2.git.1786528498689.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] sequencer: release the ODB before spawning git commit","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-08-24T10:03:16Z","receivedAt":"2026-08-24T10:03:23Z","isPatch":true,"body":"Hi Johannes\n\nOn 12/08/2026 10:54, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> As of 4557f1add261 (rebase--helper: add a builtin helper for interactive\n> rebases, 2017-02-09), continuing an interactive rebase uses the builtin\n> sequencer, which spawns `git commit`.\n> \n> The child may trigger auto-maintenance, which may need to replace files\n> for which the sequencer still holds resources. See\n> https://github.com/git-for-windows/git/issues/6315: on Windows, this\n> produces unlink retry prompts that cannot succeed while the sequencer\n> waits for the child.\n> \n> Resources such as file handles or memory mappings must be released\n> before spawning a command that may run auto-maintenance, as established\n> by 28d04e1ec197 (run-command: offer to close the object store before\n> running, 2021-09-09): release the ODB file handles and memory mappings,\n> so that auto-gc can repack (potentially deleting existing packfiles in\n> the process); If the sequencer needs to access the ODB afterwards, it\n> will gracefully (re-)open the ODB.\n> \n> Release the sequencer's ODB before spawning `git commit`. The regression\n> test uses the legacy-delete trick introduced by 69ed0e35a754 (mingw:\n> optionally use legacy (non-POSIX) delete semantics, 2026-05-07) to\n> trigger the failure on modern Windows.\n\nThis looks fine as an immediate fix for the bug but I wonder if we \nshould pass \"-c gc.auto=false\" when we fork \"git commit\" from the \nsequencer. We call run_auto_maintenance() at the end of the rebase and \nits not clear to me that repacking during the rebase is helpful. Another \nthought I had was whether we should automatically close the object \ndatabase when forking another git command. I'm not sure how easy that is \nto implement but it would prevent future regressions and I assuming \nre-opening the object store is cheap compared to forking another git \ncommand.\n\nThanks\n\nPhillip\n\n\n> Assisted-by: GPT-5.6 Sol\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>      sequencer: release the ODB before spawning git commit\n>      \n>      This fixes https://github.com/git-for-windows/git/issues/6315\n>      \n>      Changes since v1:\n>      \n>       * Clarify in the commit message what the strategy introduced in\n>         28d04e1ec197 (run-command: offer to close the object store before\n>         running, 2021-09-09) is all about.\n> \n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2198%2Fgit-for-windows%2Frebase-release-odb-before-commit-v2\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2198/git-for-windows/rebase-release-odb-before-commit-v2\n> Pull-Request: https://github.com/gitgitgadget/git/pull/2198\n> \n> Range-diff vs v1:\n> \n>   1:  904d65e8cb ! 1:  039fd29039 sequencer: release the ODB before spawning git commit\n>       @@ Commit message\n>            Resources such as file handles or memory mappings must be released\n>            before spawning a command that may run auto-maintenance, as established\n>            by 28d04e1ec197 (run-command: offer to close the object store before\n>       -    running, 2021-09-09).\n>       +    running, 2021-09-09): release the ODB file handles and memory mappings,\n>       +    so that auto-gc can repack (potentially deleting existing packfiles in\n>       +    the process); If the sequencer needs to access the ODB afterwards, it\n>       +    will gracefully (re-)open the ODB.\n>        \n>            Release the sequencer's ODB before spawning `git commit`. The regression\n>            test uses the legacy-delete trick introduced by 69ed0e35a754 (mingw:\n> \n> \n>   sequencer.c                   |  1 +\n>   t/t3404-rebase-interactive.sh | 18 ++++++++++++++++++\n>   2 files changed, 19 insertions(+)\n> \n> diff --git a/sequencer.c b/sequencer.c\n> index 57855b0066..83952d96e3 100644\n> --- a/sequencer.c\n> +++ b/sequencer.c\n> @@ -1127,6 +1127,7 @@ static int run_git_commit(const char *defmsg,\n>   \tstruct child_process cmd = CHILD_PROCESS_INIT;\n>   \n>   \tcmd.git_cmd = 1;\n> +\tcmd.odb_to_close = the_repository->objects;\n>   \n>   \tif (is_rebase_i(opts) &&\n>   \t    ((opts->committer_date_is_author_date && !opts->ignore_date) ||\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index 58b3bb0c27..8f81c80fd4 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -65,6 +65,24 @@ test_expect_success 'setup' '\n>   \ttest_commit P fileP\n>   '\n>   \n> +test_expect_success MINGW 'rebase releases object database before committing' '\n> +\ttest_when_finished \"rm -f .git/hooks/post-commit repacked packs\" &&\n> +\tgit switch -C repack-rewrite primary &&\n> +\tgit repack -ad &&\n> +\twrite_script .git/hooks/post-commit <<-\\EOF &&\n> +\tgit repack -ad &&\n> +\t>repacked\n> +\tEOF\n> +\t(\n> +\t\tset_fake_editor &&\n> +\t\tFAKE_LINES=\"reword 1\" GIT_TEST_LEGACY_DELETE=1 \\\n> +\t\t\tgit -c core.commitGraph=false rebase -i HEAD^\n> +\t) &&\n> +\ttest_path_is_file repacked &&\n> +\tls .git/objects/pack/*.pack >packs &&\n> +\ttest_line_count = 1 packs\n> +'\n> +\n>   # \"exec\" commands are run with the user shell by default, but this may\n>   # be non-POSIX. For example, if SHELL=zsh then \">file\" doesn't work\n>   # to create a file. Unsetting SHELL avoids such non-portable behavior\n> \n> base-commit: e9019fcafe0040228b8631c30f97ae1adb61bcdc\n\n"},{"id":"551131","messageId":"xmqqo6ersi07.fsf@gitster.g","threadId":"66147","inReplyTo":"a786e6c0-1c17-4121-8623-b4541478a88f@gmail.com","subject":"Re: [PATCH v2] sequencer: release the ODB before spawning git commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-24T14:36:08Z","receivedAt":"2026-08-24T14:36:11Z","isPatch":true,"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> This looks fine as an immediate fix for the bug but I wonder if we \n> should pass \"-c gc.auto=false\" when we fork \"git commit\" from the \n> sequencer. We call run_auto_maintenance() at the end of the rebase and \n> its not clear to me that repacking during the rebase is helpful.\n\nThis is a bit amusing as I was reading old discussion the other day\naround the constant 6700 [*] and saw it discused that because\n\"commit\" triggers auto-gc, there was no point in doing so in\n\"rebase\", which does series of \"commit\" invocations [*].  With small\nprojects and short rebases I tend to agree with you that gc at the\nend of a rebase session should be plenty, but given the widespread\nuse of Git, itt may not apply to everybody.\n\n> Another \n> thought I had was whether we should automatically close the object \n> database when forking another git command. I'm not sure how easy that is \n> to implement but it would prevent future regressions and I assuming \n> re-opening the object store is cheap compared to forking another git \n> command.\n\nI think it is a great approach to study how feasible it is, as we\nwill not have to sprinkle fixes like the one proposed to many code\npaths.  Thanks for raising it.\n\n\n[References]\n\n * https://lore.kernel.org/git/?q=6700+d:..20071231\n * https://lore.kernel.org/git/20070906023934.GI18160@spearce.org/\n"},{"id":"551195","messageId":"472164ed-7707-4842-a275-0356cb0e7c71@gmail.com","threadId":"66147","inReplyTo":"xmqqo6ersi07.fsf@gitster.g","subject":"Re: [PATCH v2] sequencer: release the ODB before spawning git commit","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-08-25T15:54:14Z","receivedAt":"2026-08-25T15:54:26Z","isPatch":true,"body":"On 24/08/2026 15:36, Junio C Hamano wrote:\n> Phillip Wood <phillip.wood123@gmail.com> writes:\n> \n>> This looks fine as an immediate fix for the bug but I wonder if we\n>> should pass \"-c gc.auto=false\" when we fork \"git commit\" from the\n>> sequencer. We call run_auto_maintenance() at the end of the rebase and\n>> its not clear to me that repacking during the rebase is helpful.\n> \n> This is a bit amusing as I was reading old discussion the other day\n> around the constant 6700 [*] and saw it discused that because\n> \"commit\" triggers auto-gc, there was no point in doing so in\n> \"rebase\", which does series of \"commit\" invocations [*].  With small\n> projects and short rebases I tend to agree with you that gc at the\n> end of a rebase session should be plenty, but given the widespread\n> use of Git, itt may not apply to everybody.\n\nThat's a coincidence. These days we avoid running \"git commit\" for \nsimple picks, but we do run it when rebasing a merge and I suspect large \nrebases probably include merges. So we will probably do trigger gc \nduring large rebases even if there are no conflicts or commits being \nreworded (which I think are the only two other cases where we fork \"git \ncommit\").\n\nThanks\n\nPhillip\n\n>> Another\n>> thought I had was whether we should automatically close the object\n>> database when forking another git command. I'm not sure how easy that is\n>> to implement but it would prevent future regressions and I assuming\n>> re-opening the object store is cheap compared to forking another git\n>> command.\n> \n> I think it is a great approach to study how feasible it is, as we\n> will not have to sprinkle fixes like the one proposed to many code\n> paths.  Thanks for raising it.\n> \n> \n> [References]\n> \n>   * https://lore.kernel.org/git/?q=6700+d:..20071231\n>   * https://lore.kernel.org/git/20070906023934.GI18160@spearce.org/\n\n"}]}