git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 4, 2007, 11:49 UTC
Message-ID
<Pine.LNX.4.64.0707041247520.4071@racer.site>
In-Reply-To
<468B8852.CB36968@eudaptics.com>
Hi,
On Wed, 4 Jul 2007, Johannes Sixt wrote:
Show 22 quoted lines
> 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

Previous: Johannes SixtNext: Johannes Sixt
Message 4 of 6 in “filter-branch: Avoid an error message in the map function.”
  1. filter-branch: Avoid an error message in the map function.Johannes Sixt, Jul 4, 2007
  2. Johannes SchindelinJul 4, 2007
  3. Johannes SixtJul 4, 2007
  4. Johannes SchindelinJul 4, 2007
  5. filter-branch: Avoid an error message in the map function.Johannes Sixt, Jul 4, 2007
  6. Johannes SchindelinJul 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.