Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fabric prints a new line for every bit of Git progress

Tags:

fabric

I've got Fabric set up to git fetch on a remote machine. It works fine, but there's a new line printed to stdout for every percentage progress that Git prints:

[host] out: remote: Compressing objects:   1% (3/252)   
[host] out: remote: Compressing objects:   2% (6/252)   
[host] out: remote: Compressing objects:   3% (8/252)   
[host] out: remote: Compressing objects:   4% (11/252)   
[host] out: remote: Compressing objects:   5% (13/252)   
[host] out: remote: Compressing objects:   6% (16/252)   
[host] out: remote: Compressing objects:   7% (18/252)   
[host] out: remote: Compressing objects:   8% (21/252)   
[host] out: remote: Compressing objects:   9% (23/252) 
...
[host] out: Resolving deltas:   0% (0/72)   
[host] out: Resolving deltas:  12% (9/72)   
[host] out: Resolving deltas:  15% (11/72)   
[host] out: Resolving deltas:  18% (13/72)   
[host] out: Resolving deltas:  22% (16/72)   
[host] out: Resolving deltas:  23% (17/72)   
[host] out: Resolving deltas:  55% (40/72)  

How can I prevent this from happening?

like image 655
Dmitry Minkovsky Avatar asked Sep 09 '13 22:09

Dmitry Minkovsky


2 Answers

Try this:

run('git fetch', pty=False)
like image 149
ronnix Avatar answered Nov 18 '22 17:11

ronnix


What I usually do is this if I don't care to see the output of the command:

with hide('stdout'):
    run('git fetch')
like image 34
Chris Malek Avatar answered Nov 18 '22 17:11

Chris Malek