-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maintenance: do not open console on Windows #1570
Conversation
On Windows, there are two kinds of executables, console ones and non-console ones. Git's executables are all console ones. When launching the former e.g. in a scheduled task, a CMD window pops up. This is not what we want for the tasks installed via the `git maintenance` command. To work around this, let's introduce `headless-git.exe`, which is a non-console program that does _not_ pop up any window. All it does is to re-launch `git.exe`, suppressing that console window, passing through all command-line arguments as-are. Helped-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Helped-by: Yuyi Wang <Strawberry_Str@hotmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
We just introduced a helper to avoid showing a console window when the scheduled task runs `git.exe`. Let's actually use it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
/submit |
Submitted as pull.1570.git.1691600087.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
This branch is now known as |
This patch series was integrated into seen via git@6646ac4. |
This patch series was integrated into seen via git@9d36205. |
This patch series was integrated into next via git@3d7abef. |
This patch series was integrated into seen via git@2c472f0. |
There was a status update in the "New Topics" section about the branch Windows updates. Will merge to 'master'. source: <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.
Thanks,
-Stolee
cc: gitster@pobox.com
cc: johannes.schindelin@gmx.de