public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail•com>
To: "Fabrice SALVAIRE" <fabrice.salvaire@orange•fr>, git@vger•kernel.org
Subject: Re: Why do we need to wait 1s between a git add and commit
Date: Fri, 22 May 2026 17:12:21 +0200	[thread overview]
Message-ID: <b403477d-5587-4afc-bd02-dbd207c22e67@app.fastmail.com> (raw)
In-Reply-To: <36eec9c1-1d2b-4cd1-a64c-a02936d8a2ae@orange.fr>

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/

  reply	other threads:[~2026-05-22 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-05-22 17:13   ` Fabrice SALVAIRE

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b403477d-5587-4afc-bd02-dbd207c22e67@app.fastmail.com \
    --to=kristofferhaugsbakk@fastmail$(echo .)com \
    --cc=fabrice.salvaire@orange$(echo .)fr \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox