Re: [PATCHv2 2/7] revision.h: introduce blob/tree walking in order of the commits
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 1, 2017, 22:08 UTC
- Message-ID
- <alpine.DEB.2.21.1.1711012307060.6482@virtualbox>
- In-Reply-To
- <CAGZ79kY-yooE4cZK0Sxh3AL32wi66PRh1LzB8e3djq=bnLDHFg@mail.gmail.com>
Hi Stefan,
On Wed, 1 Nov 2017, Stefan Beller wrote:
Show 25 quoted lines
> On Wed, Nov 1, 2017 at 5:37 AM, Junio C Hamano <gitster@pobox.com> wrote: > > On Wed, Nov 1, 2017 at 9:26 PM, Johannes Schindelin > > <Johannes.Schindelin@gmx.de> wrote: > >> > >> ... > >> ( > >> for x in four three > >> do > >> git rm $x && > >> git commit -m "remote $x" || > >> exit > >> done > >> ) && > >> test 0 -eq $? && > >> ... > >> > >> Ugly? Yes. Correct? Also yes. > > > > I think returning non-zero with "return" is how other tests avoid an > > extra level of subshell. > > Ugly? Yes. Correct? Questionable but it seems to work for those who > > wrote them ;-) > > I think I'll go without the extra subshell and with s/return 1/false/ as > the exact value doesn't matter.
You mean
for ... do xyz || false done
? That does not work. Try this:
for a in 1 2 3; do echo $a && false; done && echo done
While it does not print `done`, it will print all of 1, 2 and 3.
Ciao, Dscho