git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Johannes Sixt <johannes.sixt@telecom.at>
Cc: gitster@pobox.com, git@vger.kernel.org, j.sixt@eudaptics.com
Subject: Re: [PATCH] filter-branch: Avoid an error message in the map function.
Date: Wed, 4 Jul 2007 12:08:26 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0707041205250.4071@racer.site> (raw)
In-Reply-To: <11835356473029-git-send-email-johannes.sixt@telecom.at>

Hi,

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.

Ciao,
Dscho

  reply	other threads:[~2007-07-04 11:09 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 [this message]
2007-07-04 11:45   ` Johannes Sixt
2007-07-04 11:49     ` Johannes Schindelin
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.0707041205250.4071@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@eudaptics.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).