git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/2] maintenance: do not open console on Windows

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Aug 9, 2023, 16:54 UTC
Message-ID
<pull.1570.git.1691600087.gitgitgadget@gmail.com>

These two patches are cherry-picks of commits that have lived in git-for-windows/git since 2019 when background maintenance was originally introduced.

If we run the core Git project's version of background maintenance on a Windows platform, then each background maintenance run will create a new console window, visible to the user. This is due to quirks around how Windows applications work: they require some parent application and will create a console window if one does not exist.

This is solved by creating a new 'headless-git.exe' executable that knows how to hide its own window. This isn't an appropriate change to make to 'git.exe' since that expects to be run within an existing console or application.

 1. Patch 1 introduces the 'headless-git.exe' executable with the ability to
    hide its window.
 2. Patch 2 modifies the schtasks integration to use 'headless-git.exe'
    instead of 'git.exe'.
Thanks, -Stolee
Johannes Schindelin (2):
  win32: add a helper to run `git.exe` without a foreground window
  git maintenance: avoid console window in scheduled tasks on Windows
 Makefile                                   |   9 ++
 builtin/gc.c                               |   2 +-
 compat/win32/headless.c                    | 115 +++++++++++++++++++++
 config.mak.uname                           |   3 +
 contrib/buildsystems/CMakeLists.txt        |   9 ++
 contrib/buildsystems/Generators/Vcxproj.pm |   4 +-
 contrib/buildsystems/engine.pl             |   1 +
 7 files changed, 140 insertions(+), 3 deletions(-)
 create mode 100644 compat/win32/headless.c
base-commit: a82fb66fed250e16d3010c75404503bea3f0ab61
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1570%2Fderrickstolee%2Fheadless-git-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1570/derrickstolee/headless-git-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1570
-- 
gitgitgadget
Next: Johannes Schindelin via GitGitGadget
Message 1 of 3 in “maintenance: do not open console on Windows”
  1. 0/2 maintenance: do not open console on WindowsDerrick Stolee via GitGitGadget, Aug 9, 2023
  2. 2/2 git maintenance: avoid console window in scheduled tasks on WindowsJohannes Schindelin via GitGitGadget, Aug 9, 2023
  3. 1/2 win32: add a helper to run `git.exe` without a foreground windowJohannes Schindelin via GitGitGadget, Aug 9, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.