Output broken by git operations
See original GitHub issueVersion(s)
3.2.0
To reproduce
Steps to reproduce the behavior:
Target("test", () =>
{
// should fail to resolve but still print output without garbage
Run("git", $"clone ssh://git@github.com:adamralph/bullseye.git tmp_bullseye");
});
Expected behavior
The output should not contain garbage characters
Actual behaviour
outputs the following
make: Starting... (test)
make: test: Starting...
make: git clone ssh://git@github.com:adamralph/bullseye.git CloneTmp
Cloning into 'CloneTmp'...
ssh: Could not resolve hostname github.com:adamralph: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
?[90mmake:?[0m ?[36mtest?[37m:?[0m ?[91mFailed! The command exited with code 128.?[0m ?[35m(142 ms)?[0m?[0m
?[90mmake:?[0m ?[37m-------------------------------?[0m
?[90mmake:?[0m ?[37mDuration?[0m ?[37mOutcome?[0m ?[37mTarget?[0m
?[90mmake:?[0m ?[37m--------------?[0m ?[37m-------?[0m ?[37m------?[0m
?[90mmake:?[0m ?[35m142 ms?[0m?[0m ?[35m100.0%?[0m?[0m ?[91mFailed!?[0m?[0m ?[36mtest?[0m ?[0m
?[90mmake:?[0m ?[37m-------------------------------?[0m
?[90mmake:?[0m ?[91mFailed!?[0m ?[36m(test)?[0m ?[35m(148 ms)?[0m?[0m
Workarounds
It appears HTTPS urls do not cause this to happen. But that is not viable for our internal git server which requires SSH.
Additional context
This occurs with clone, and push operations that involve an SSH url. Not sure what git is doing or outputting for them. I also tried the new -E option from #393 with no luck
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
git operations throwing 'broken pipe' error
Git automatically pipes its output through a pager like less when appropriate, and the pipe error is usually the result of the Git...
Read more >Git commands often stalls with no output shown #1572
Running a Git command like git pull or git fetch stalls with no output shown. There is no timeout or other feed back....
Read more >Troubleshooting Git
If pushing over SSH, first check your SSH configuration as 'Broken pipe' errors can ... When performing Git operations over HTTP, a 403...
Read more >Common Git Errors, How to Fix, and 5 Ways to Avoid Them
We'll cover some of the most common Git errors, how to resolve them, and provide best practices for streamline use of Git, prevent...
Read more >Can't capture the output of git pull command in a variable
I tried read Result < <(git -C /another-directory pull) and then I ran echo $Result and it's empty. I also tried git -C...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Huh, I am not sure I would have been able to track that down. Thanks for looking into it for me! I will see what we can do that git issue.
OK, exactly what I thought is happening, is happening. Git is tampering with the console mode. Before Git executes, the console mode has the
ENABLE_VIRTUAL_TERMINAL_PROCESSING(0x0004) flag set, and after Git executes, that flag is no longer set.This was mentioned over 2 years ago in the Git for Windows issue tracker.
So in summary, this is a Git for Windows problem and needs to be pursued over there. In the meantime, the workaround is to run Bullseye with the
-N/--no-coloroption.Thanks for raising this!