Re: [PATCH] filter-branch: Avoid an error message in the map function.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux