Re: [PATCH] builtin-remote: better handling of multiple remote HEADs

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] builtin-remote: better handling of multiple remote HEADs

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:12

Jay Soffian [off-list ref] writes:
       Bash allows both the standard output (file descriptor 1) and
       the standard  error
       output  (file  descriptor 2) to be redirected to the file whose
       name is the expansion of word with this construct.

       There are two formats for redirecting standard output and
       standard error:

              &>word
       and
              >&word

       Of the two forms, the first is preferred.  This is semantically
       equivalent to

              >word 2>&1
Just to clarify, the above is not a recommendation for shell scripts in
git project.  The last one is the only one we recommend in our scripts.

By the say, does anybody know why bash people recommend &>word form?

Neither &>word nor >&word to send both stderr and stdout to the file is
from true Bourne, but at least the use of >&word form for this purpose is
more familiar to people who are used to Csh.

Re: [PATCH] builtin-remote: better handling of multiple remote HEADs

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:12

On Sun, Feb 15, 2009 at 9:21 PM, Junio C Hamano [off-list ref] wrote:
quoted
              &>word
              >&word
Just to clarify, the above is not a recommendation for shell scripts in
git project.
Indeed not! My use of it wasn't even intentional, I was a tcsh
(cringe...) user for a long time and I only finally switched to bash
about a year ago. It must've been muscle memory that made me type it,
but a pox on bash for not rejecting it outright -- the bash man page
claims posix'ish compliance when invoked as /bin/sh, so I don't know
why it allows such syntax in its posix'ish mode.
By the say, does anybody know why bash people recommend &>word form?

Neither &>word nor >&word to send both stderr and stdout to the file is
from true Bourne, but at least the use of >&word form for this purpose is
more familiar to people who are used to Csh.
<tongue in cheek>it is exactly because it is familiar to csh people
that they recommend the opposite</tongue in cheek>

j.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help