sillsdev / chorus

End-user collaboration library via 3-way xml merging and hg dvcs under the hood
6 stars 26 forks source link

Don't write empty "standerr:" lines to verbose progress output #348

Closed rmunn closed 2 months ago

rmunn commented 3 months ago

Many times the verbose progress log will contain things like the following:

   Using cached result: log -r0 --template "{node}" 
   standerr: 

   standout: 4173623d30060fb329fffb3d90fb36027aeb6a83

   Using cached result: log -r0 --template "{node}" 
   standerr: 

   standout: 4173623d30060fb329fffb3d90fb36027aeb6a83

There's no need to write the standerr section if it's blank, and there's also no need to double up on the final newline from standard output. IProgress.WriteVerbose already writes a newline, so we should trim the extra newline before writing it, and skip writing something entirely if there's no meaningful output (it's just a newline, for example).