From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Johannes Sixt <J.Sixt@eudaptics.com>
Cc: Johannes Sixt <johannes.sixt@telecom.at>,
gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] filter-branch: Avoid an error message in the map function.
Date: Wed, 4 Jul 2007 12:49:03 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0707041247520.4071@racer.site> (raw)
In-Reply-To: <468B8852.CB36968@eudaptics.com>
Hi,
On Wed, 4 Jul 2007, Johannes Sixt wrote:
> Johannes Schindelin wrote:
> >
> > On Wed, 4 Jul 2007, Johannes Sixt wrote:
> >
> > > - test -r "$workdir/../map/$1" || echo "$1"
> > > - cat "$workdir/../map/$1"
> > > + test -r "$workdir/../map/$1" &&
> > > + cat "$workdir/../map/$1" ||
> > > + echo "$1"
> >
> > I think this does not do what you want. If I read it correctly, it will
> > not do anything if $workdir/../map/$1 is not readable. I think you need
> > this:
> >
> > (test -r "$workdir/../map/$1" &&
> > cat "$workdir/../map/$1") ||
> > echo "$1"
> >
> > But that is a little too cute, so I personally would prefer an
> > if-then-else-fi, because that is the idea of that code snippet.
>
> It does do what I think it should do. I tested it.
Okay. But take me as an example of an average programmer. I got confused.
Therefore I would greatly appreciate it, if it were written with
if-then-else-fi, because I get less confused then.
Thanks,
Dscho
next prev parent reply other threads:[~2007-07-04 11:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-04 7:54 [PATCH] filter-branch: Avoid an error message in the map function Johannes Sixt
2007-07-04 11:08 ` Johannes Schindelin
2007-07-04 11:45 ` Johannes Sixt
2007-07-04 11:49 ` Johannes Schindelin [this message]
2007-07-04 12:08 ` [PATCH take 2] " Johannes Sixt
2007-07-04 12:51 ` Johannes Schindelin
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=Pine.LNX.4.64.0707041247520.4071@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=J.Sixt@eudaptics.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.sixt@telecom.at \
/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).