The fabric prints a new line for each bit of Git progress.

I have Cloth installed before git fetch on the remote machine. It works fine, but for every percentage that Git prints: a new line is printed on stdout :

 [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?

+7
fabric
source share
2 answers

Try the following:

 run('git fetch', pty=False) 
+8
source share

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

 with hide('stdout'): run('git fetch') 
+1
source share

All Articles