Re: [PATCH 1/6] templates: Fewer subprocesses in pre-commit hook

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

 



On Mon, Jun 10, 2013 at 08:36:00PM +0200, Richard Hartmann wrote:

> Spawning a new subprocess for every line printed is inefficient.
> Thus spawn only one instance of `echo`.

Most modern shells have "echo" as a built-in these days, and do not fork
at all to run it. E.g., try "strace sh -c 'echo foo'" with your shell of
choice; neither dash nor bash will fork at all.

IMHO the indentation issues make the end result of your patch less
readable (and here-doc with cat is more readable, but actually
_increases_ the number of processes, since cat is not usually a
built-in). So I'd be in favor of keeping it as-is.

-Peff
--
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]