You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was not able to find an open or closed issue matching what I'm seeing
Setup
Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.42.0.windows.2
cpu: x86_64
built from commit: 2f819d1670fff9a1818f63b6722e9959405378e3
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.22621.2715]
What options did you set as part of the installation? Or did you choose the
defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: FFOnly
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
Any other interesting things about your environment that might be related
to the issue you're seeing?
When our git server restarts the git client will fail to authenticate and use askPass to ask for a username and password. The restarts coincide with the times set in the task scheduler by git maintenance start. IMHO the issue is a general one though and not really special to this environment.
Details
Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
Git Bash in Windows Terminal. But in the real world this issue likely happens outside the terminal in the Windows Task Scheduler.
The actual problem occurs when git maintenance tasks are running in the Windows Task Scheduler. The minimal example below just reproduces the issue in a terminal.
# you need a git server which will trigger askPass. I reproduced this, by deleting the credentials I had# (The blank line below protocol signals the input is complete.)
$ git credential-manager erase
host=github.com
protocol=https
# If credential manager is installed the next command might open a window or two.# After the user closes those windows git will fallback to askPass. The user can't type in the password though,# because headless-git is used.# SIGINT also does not work so you need to kill the task some other way.
$ "C:/Program Files/Git/mingw64/libexec/git-core/headless-git.exe" maintenance run --task=prefetch
# When the previous command started, it locked the repo with .git/objects/maintenance.lock# All maintenance commands after that will fail:
$ git maintenance run --task=prefetch
warning: lock file '.git/objects/maintenance' exists, skipping maintenance
What did you expect to occur after running these commands?
I expected headless-git to not start any terminal interaction, because there is no way for the user to interact with the terminal.
If headless-git is just a helper to facilitate git maintenance start I could live with the fact that it is not truly "headless" as long as the task that are registered in the Windows Task Scheduler set git config values to prevent the terminal interactions, e. g.
git -c "core.askPass=true" -c "credential.interactive=false" for-each-repo --config=maintenance.repo maintenance run --schedule=daily
(This is not a good solution if the graphical user interfaces triggered by askPass and Credential Manager are desired though and only the terminal interaction should be suppressed. I sadly haven't found a config value to only deactivate terminal interaction.)
What actually happened instead?
It did start a terminal interaction and locked all maintenance commands.
The text was updated successfully, but these errors were encountered:
Setup
defaults?
to the issue you're seeing?
When our git server restarts the git client will fail to authenticate and use askPass to ask for a username and password. The restarts coincide with the times set in the task scheduler by
git maintenance start
. IMHO the issue is a general one though and not really special to this environment.Details
Git Bash in Windows Terminal. But in the real world this issue likely happens outside the terminal in the Windows Task Scheduler.
Minimal, Complete, and Verifiable example
this will help us understand the issue.
The actual problem occurs when git maintenance tasks are running in the Windows Task Scheduler. The minimal example below just reproduces the issue in a terminal.
I expected headless-git to not start any terminal interaction, because there is no way for the user to interact with the terminal.
If headless-git is just a helper to facilitate
git maintenance start
I could live with the fact that it is not truly "headless" as long as the task that are registered in the Windows Task Scheduler set git config values to prevent the terminal interactions, e. g.(This is not a good solution if the graphical user interfaces triggered by askPass and Credential Manager are desired though and only the terminal interaction should be suppressed. I sadly haven't found a config value to only deactivate terminal interaction.)
It did start a terminal interaction and locked all maintenance commands.
The text was updated successfully, but these errors were encountered: