* Why do we need to wait 1s between a git add and commit
@ 2026-05-22 12:28 Fabrice SALVAIRE
2026-05-22 15:12 ` Kristoffer Haugsbakk
0 siblings, 1 reply; 3+ messages in thread
From: Fabrice SALVAIRE @ 2026-05-22 12:28 UTC (permalink / raw)
To: git
Dear all,
I wrote a Python tool to dump a wiki to a git repository, that does
basically a succession of subprocess calls to git add and commit.
Recently, I discovered this tool doesn't work any longer and that git
commit (2.54 on Fedora 42 / 43) crashes randomly.
I cannot explain this behavior since my code is trivial.
I had the intuition to add a sleep time of 1s just after a git call, and
it solves the issue.
I noticed for some cases that another call to git commit were
successful. For most cases, git fsck and gitk report issues.
It looks like the state of the git repository was not yet completed
before the end of the git subprocess.
Cheers,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why do we need to wait 1s between a git add and commit
2026-05-22 12:28 Why do we need to wait 1s between a git add and commit Fabrice SALVAIRE
@ 2026-05-22 15:12 ` Kristoffer Haugsbakk
2026-05-22 17:13 ` Fabrice SALVAIRE
0 siblings, 1 reply; 3+ messages in thread
From: Kristoffer Haugsbakk @ 2026-05-22 15:12 UTC (permalink / raw)
To: Fabrice SALVAIRE, git
Hi
On Fri, May 22, 2026, at 14:28, Fabrice SALVAIRE wrote:
> I wrote a Python tool to dump a wiki to a git repository, that does
> basically a succession of subprocess calls to git add and commit.
>
> Recently, I discovered this tool doesn't work any longer and that git
> commit (2.54 on Fedora 42 / 43) crashes randomly.
>
> I cannot explain this behavior since my code is trivial.
>
> I had the intuition to add a sleep time of 1s just after a git call, and
> it solves the issue.
>
> I noticed for some cases that another call to git commit were
> successful. For most cases, git fsck and gitk report issues.
>
> It looks like the state of the git repository was not yet completed
> before the end of the git subprocess.
This might be caused by git-maintenance(1) being run in the background
without locking? That’s a new issue in Git 2.54.0. See:
https://lore.kernel.org/git/20260509175249.GA2336928@coredump.intra.peff.net/
The following script reproduces the issue on Git 2.53.0. I am guessing
that your script does something similar? It depends on how many commits
it creates in a short timeframe.
https://lore.kernel.org/git/20260508180341.GB737125@coredump.intra.peff.net/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why do we need to wait 1s between a git add and commit
2026-05-22 15:12 ` Kristoffer Haugsbakk
@ 2026-05-22 17:13 ` Fabrice SALVAIRE
0 siblings, 0 replies; 3+ messages in thread
From: Fabrice SALVAIRE @ 2026-05-22 17:13 UTC (permalink / raw)
To: Kristoffer Haugsbakk, git
Hi,
Yes it throws 3000+ sequential subprocess calls at the speed of Python...
And the sleep time seems to be critical, 1s is ok but 100ms is not so ok.
I also have the feeling this is due to a git upgrade. But I didn't test
to downgrade.
That is a major issue if we have to be slow while using Git...
It is not unusual to write a shell script with a sequence of add/commit.
Le 22/05/2026 à 17:12, Kristoffer Haugsbakk a écrit :
> Hi
>
> On Fri, May 22, 2026, at 14:28, Fabrice SALVAIRE wrote:
>> I wrote a Python tool to dump a wiki to a git repository, that does
>> basically a succession of subprocess calls to git add and commit.
>>
>> Recently, I discovered this tool doesn't work any longer and that git
>> commit (2.54 on Fedora 42 / 43) crashes randomly.
>>
>> I cannot explain this behavior since my code is trivial.
>>
>> I had the intuition to add a sleep time of 1s just after a git call, and
>> it solves the issue.
>>
>> I noticed for some cases that another call to git commit were
>> successful. For most cases, git fsck and gitk report issues.
>>
>> It looks like the state of the git repository was not yet completed
>> before the end of the git subprocess.
> This might be caused by git-maintenance(1) being run in the background
> without locking? That’s a new issue in Git 2.54.0. See:
>
> https://lore.kernel.org/git/20260509175249.GA2336928@coredump.intra.peff.net/
>
> The following script reproduces the issue on Git 2.53.0. I am guessing
> that your script does something similar? It depends on how many commits
> it creates in a short timeframe.
>
> https://lore.kernel.org/git/20260508180341.GB737125@coredump.intra.peff.net/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-22 17:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 12:28 Why do we need to wait 1s between a git add and commit Fabrice SALVAIRE
2026-05-22 15:12 ` Kristoffer Haugsbakk
2026-05-22 17:13 ` Fabrice SALVAIRE
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox