Re: [PATCH 2/2] filter-branch: fail gracefully when a filter fails

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

Re: [PATCH 2/2] filter-branch: fail gracefully when a filter fails

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:19

David Kastrup [off-list ref] writes:
Instead of "grep ." one could also do something like

if read line then
  while echo "$line" && read line; do :; done
  die
fi

which is fork-less.
I'd agree with you that "grep ^" would be preferable _if_ we
were to do this.  But in your fork-less example, you are
assuming that (1) "read" does not molest what is read, (2)
"echo" is built-in, and (3) "echo" does not munge the
parameter.

Since I am one of old fashioned shell people (I readily admit
that I used to have _fun_ with autoconf generated shell
scripts), I'd love to continue shell skill show-offs, but for
the purpose of updating this script, I would say a temporary
file is much better than any of the alternatives around 1>&3.
For one thing, it would make debugging the script while
developing and tweaking it, _and_ while using it, much more
pleasant.

Re: [PATCH 2/2] filter-branch: fail gracefully when a filter fails

From: Jeff King <hidden>
Date: 2016-06-15 22:43:19

On Fri, Jul 06, 2007 at 01:33:02AM -0700, Junio C Hamano wrote:
the purpose of updating this script, I would say a temporary
file is much better than any of the alternatives around 1>&3.
As the one who originally mentioned the redirection trick, let me say
that I agree. I brought it up more as "yuck, this is the way you have
to do it" than a real suggestion. I think the tempfile, while ugly, is
less ugly.

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