From: Miklos Vajna <vmiklos@frugalware.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Joel Becker <Joel.Becker@oracle.com>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, "J. Bruce Fields" <bfields@citi.umich.edu>
Subject: Re: [PATCH] new test from the submodule chapter of the user manual
Date: Thu, 20 Sep 2007 23:46:09 +0200 [thread overview]
Message-ID: <20070920214609.GT16235@genesis.frugalware.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0709201946410.28395@racer.site>
[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]
On Thu, Sep 20, 2007 at 07:47:32PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > +test_expect_success "create the submodules" '
> > > + for i in a b c d
> > > + do
> > > + mkdir $i &&
> > > + cd $i &&
> > > + git init &&
> > > + echo "module $i" > $i.txt &&
> > > + git add $i.txt &&
> > > + git commit -m "Initial commit, submodule $i" &&
> > > + cd ..
> > > + done
> >
> > Silly question: why use the '&&' when you can 'set -e'? As it
> > currently stands, a failure will still go back around the loop...
>
> A "set -e" will make the script exit AFAIR. That's not what we want. A
> simple "|| break" after the "cd .." will work, though.
i know i asked this on irc, but i still a bit confused. the target would
be to jump out from the loop and return 'false' if any of the items
fails
if i understand correctly then this is what Dscho proposes:
$ for i in a b; do echo $i && false || break; done
a
$ echo $?
0
this jumps out from the loop but does not return false
here is my version:
$ for i in a b; do echo $i && false; done
a
b
$ echo $?
1
this one detects the error but does not jump out from the loop. none of
them is perfect, but at least my version fails as long as the last cycle
fails (which is not problem as i think in most cases all or none of the
cycles will fail)
anyway, if you really want, i can change it, but i think it is not the
right thing to do
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-09-20 21:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 10:55 [rfc] git submodules howto Miklos Vajna
2007-09-18 12:03 ` Johannes Schindelin
2007-09-18 12:10 ` Michael Smith
2007-09-18 13:29 ` J. Bruce Fields
2007-09-18 15:47 ` Miklos Vajna
2007-09-18 15:55 ` J. Bruce Fields
2007-09-18 16:11 ` Miklos Vajna
2007-09-18 18:12 ` Michael Smith
2007-09-19 17:42 ` [PATCH] User Manual: add a chapter for submodules Miklos Vajna
2007-09-19 19:44 ` Junio C Hamano
2007-09-19 20:30 ` J. Bruce Fields
2007-09-20 0:01 ` Miklos Vajna
2007-09-20 0:34 ` Miklos Vajna
2007-09-20 4:15 ` Junio C Hamano
2007-09-20 10:34 ` Johannes Schindelin
2007-09-20 17:08 ` [PATCH] new test from the submodule chapter of the user manual Miklos Vajna
2007-09-20 17:59 ` Joel Becker
2007-09-20 18:47 ` Johannes Schindelin
2007-09-20 21:46 ` Miklos Vajna [this message]
2007-09-20 22:56 ` Joel Becker
2007-09-20 21:35 ` Junio C Hamano
2007-09-21 13:09 ` Miklos Vajna
2007-09-21 18:04 ` Junio C Hamano
2007-09-22 20:05 ` Miklos Vajna
2007-09-20 22:02 ` [PATCH] User Manual: add a chapter for submodules Miklos Vajna
2007-09-19 21:00 ` Sven Verdoolaege
2007-09-24 7:11 ` [rfc] git submodules howto Uwe Kleine-König
2007-09-24 8:30 ` Miklos Vajna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070920214609.GT16235@genesis.frugalware.org \
--to=vmiklos@frugalware.org \
--cc=Joel.Becker@oracle.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=bfields@citi.umich.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).