Re: [PATCHv15 2/5] run_processes_parallel: add LF when caller is sloppy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 24, 2016 at 1:19 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Stefan Beller wrote:
>
>> When the callers of parallel processing machine are sloppy with their
>> messages, make sure the output is terminated with LF after one child
>> process is handled.
>
> Why not always add \n here?

So you propose to always add a \n if the output length was > 0 ?

>
> That would make callers simpler and would make it easier for callers to
> know what to do.  It also makes it possible to end with \n\n if the
> caller wants.

If the caller wants a \n\n it can do so as well using this patch?

If we add an \n unconditionally we run the risk of having lots of empty lines
in there. Consider the tests which are already there:

    test-run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\"
Hello World" >actual

would produce

cat >expect <<-EOF
preloaded output of a child
Hello
World

preloaded output of a child
Hello
World

preloaded output of a child
Hello
World

preloaded output of a child
Hello
World
EOF

as both the child as well as we added a \n, so one empty line was born.
And as most child processes actually terminate with a reasonable \n
after their output,
I would not want to add another \n because it is simpler or easier to predict.

Thanks,
Stefan


>
> Thanks,
> Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]