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

Re: [PATCH] stash: Add stash.showFlag config variable

From
Namhyung Kim <namhyung@gmail.com>
Date
Aug 28, 2015, 01:47 UTC
Message-ID
<20150828014742.GA17656@sejong>
In-Reply-To
<CAPig+cQmTS5rRkfh1in9qR4MyP1_y9vNar7U4H3uayK6Vixa7w@mail.gmail.com>
Hi,
On Thu, Aug 27, 2015 at 08:16:35PM -0400, Eric Sunshine wrote:
Show 24 quoted lines
> On Thu, Aug 27, 2015 at 11:36 AM, Namhyung Kim <namhyung@gmail.com> wrote:
> > On Fri, Aug 28, 2015 at 12:20 AM, SZEDER Gábor <szeder@ira.uka.de> wrote:
> >>  - This hunk runs the the exact same 'git config' command twice.  Run it
> >>    only once, perhaps something like this:
> >>
> >>      show_flag=$(git config --get stash.showflag || echo --stat)
> >>
> >>    (I hope there are no obscure crazy 'echo' implemtations out there
> >>    that might barf on the unknown option '--stat'...)
> >
> > What about `echo "--stat"` then?
> 
> Adding quotes around --stat won't buy you anything since the shell
> will have removed the quotes by the time the argument is passed to
> echo, so an "obscure crazy" 'echo' will still see --stat as an option.
> 
> POSIX states that printf should take no options, so:
> 
>     printf --stat
> 
> should be safe, but some implementations do process options (and will
> complain about the unknown --stat option), therefore, best would be:
> 
>     printf '%s' --stat
That's good to know.  I'll change it that way.

Thanks for your review! Namhyung

Previous: Eric SunshineNext: Junio C Hamano
Message 5 of 9 in “stash: Add stash.showFlag config variable”
  1. stash: Add stash.showFlag config variableNamhyung Kim, Aug 27, 2015
  2. SZEDER GáborAug 27, 2015
  3. Namhyung KimAug 27, 2015
  4. Eric SunshineAug 28, 2015
  5. Namhyung KimAug 28, 2015
  6. Junio C HamanoAug 28, 2015
  7. Namhyung KimAug 28, 2015
  8. Junio C HamanoAug 28, 2015
  9. Namhyung KimAug 29, 2015

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.