From: Tao Klerks <tao@klerks.biz>
To: Jeff Hostetler <git@jeffhostetler.com>
Cc: Derrick Stolee <derrickstolee@github.com>, git <git@vger.kernel.org>
Subject: Re: Auto packing the repository - foreground or background in Windows?
Date: Thu, 8 Dec 2022 15:29:44 +0100 [thread overview]
Message-ID: <CAPMMpojW1mHmZ7_P=JpDZr2JjNxn-Rt_CP5VjtnMVJ6ZDFk36g@mail.gmail.com> (raw)
In-Reply-To: <091329e0-9af3-b853-0ed3-edd10d2a2b72@jeffhostetler.com>
Thank you all. I will try to carry forward a patch with this change
and a hint about the recommended maintenance approach for longer runs.
On Tue, Dec 6, 2022 at 11:41 PM Jeff Hostetler <git@jeffhostetler.com> wrote:
>
>
>
> On 12/6/22 1:03 PM, Derrick Stolee wrote:
> > On 12/1/2022 7:25 AM, Tao Klerks wrote:
> >> But my *question* is: Does anyone know where I could/should look to
> >> understand why the GC was happening in the foreground, even though the
> >> message says it will run in the background?
> >
> > On Windows, Git's foreground process cannot complete without also
> > killing the background process. I'm not sure on the concrete details,
> > but the lack of a background "git gc --auto" here is deliberate for
> > that platform.
>
> Here the GC code uses `daemonize()`. On Posix this is a wrapper around
> `fork()` where the parent exits and the child continues the computation
> (without stdin/out).
>
> However, `daemonize()` just returns an ENOSYS on Windows, since Windows
> doesn't have `fork()`. The net result is that the foreground process
> falls thru and does the actual work.
>
>
> [...]
> > Instead, the modern recommendation for repositories where "git gc --auto"
> > would be slow is to run "git maintenance start" which will schedule
> > background maintenance jobs with the Windows scheduler. Those processes
> > are built to do updates that are non-invasive to concurrent foreground
> > processes. It also sets config to avoid "git gc --auto" commands at the
> > end of foreground Git processes.
> >
> > See [1] for more details.
> >
> > [1] https://git-scm.com/docs/git-maintenance
>
> It is possible to do the GC in the background on Windows (using other
> techniques), but I don't think it is worth the bother now that we have
> `git maintenance` to handle it.
>
> And yes, AEvar's suggested fix for printing the correct error message
> looks helpful.
>
>
> Jeff
next prev parent reply other threads:[~2022-12-08 14:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 12:25 Auto packing the repository - foreground or background in Windows? Tao Klerks
2022-12-06 18:03 ` Derrick Stolee
2022-12-06 19:19 ` Ævar Arnfjörð Bjarmason
2022-12-06 22:41 ` Jeff Hostetler
2022-12-08 14:29 ` Tao Klerks [this message]
2022-12-08 14:52 ` Tao Klerks
2022-12-09 15:11 ` Derrick Stolee
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='CAPMMpojW1mHmZ7_P=JpDZr2JjNxn-Rt_CP5VjtnMVJ6ZDFk36g@mail.gmail.com' \
--to=tao@klerks.biz \
--cc=derrickstolee@github.com \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).