question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Output broken by git operations

See original GitHub issue

Version(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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
glen-nicolcommented, Feb 26, 2020

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.

0reactions
adamralphcommented, Feb 25, 2020

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-color option.

Thanks for raising this!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found