Skip to content

maintenance: do not open console on Windows

Derrick Stolee via GitGitGadget git 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2win32: add a helper to run `git.exe` without a foreground windowMakefile compat/win32/headless.c config.mak.uname +3 more+139 -20 replies
2/2git maintenance: avoid console window in scheduled tasks on Windowsbuiltin/gc.c+1 -10 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchCarlo Marcelo Arenas BelónYuyi Wang
1/2Helped-by Helped-by
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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

Signature · 1 line
gitgitgadget