Skip to content

Username and password authentication not working with MinGit #5598

@pratikpc

Description

@pratikpc
  1. I am using MinGit so bash is not shipped by Git-For-Windows itself.
  2. If we get rid of the bash.exe executable probably linked to WSL2, the issue still continues to exist
  3. With bash.exe of System32 present, our code gets stuck at the prompt. I could type infinitely but it would still not move ahead for some reason
  4. With bash.exe of System32 moved out of harms way, we get the no such file or directory error. At least we don't get stuck

My guess is the origin of the issues potentially has to do with

  1. Rebase to v2.49.0 #5487
  2. Specifically c565315
  3. The shell_prompt function
    https://github.com/git-for-windows/git/blame/7a18c63e175adab427fa2824f3de07c7e02efd93/compat/terminal.c#L426

Why it might not be right?

  1. Same issue exists in 2.48
    So what I tried instead was to go to a version older than 2.49, specifically 2.48.
  2. To verify it was not a setup issue tried the same test in Windows Sandbox
  3. The entire functionality was introduced in 2.49. https://github.com/git-for-windows/git/blob/978fa72cf8e33cad188fe316e44653497a7ce4a9/compat/terminal.c does not contain it.

Replicating the issue without MinGit

  1. Simply delete all instances of bash.exe

Using GIT_TRACE=1, the command of importance is:-

run-command.c:929       trace: start_command: bash -c 'cat >/dev/tty && read -r line </dev/tty && echo "$line"'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions