hooks/post-receive: replace printf with echo
The post-receive hook may run inside the chroot. The printf command
may not be internal to the /bin/sh in use inside the chroot. The
post-receive hook was using printf to safely output the ref update
lines.
This means:
1) It's much slower
2) It will break unless the external printf command is installed
in the chroot
However, the format of a ref update line is <old> <new> <refname>
where both <old> and <new> are all hex digits and <refname> is any
acceptable Git ref name (which will always start with "refs/").
This means switching to "echo" instead will always be safe because a
hex digit (<old> always starts with a hex digit) can never be
interpreted as an option to echo and the character '\' is not valid
in Git ref names so there cannot possibly be any unintentionally
expanded escape sequences (by the versions of echo that do such
things) since all of the escape sequences in question start with '\'
and that character cannot be present in <old>, <new> or <refname>.
Therefore switch from using "printf '%s\n'" to "echo" so that shells
without an internal, built-in "printf" command are not forced to run
more slowly and will actually generate ref updates in the case where
the printf external command has not been installed in the chroot
(which Girocco is not yet guaranteeing).
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>