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

Re: [PATCH v2 1/2] t: don't spuriously close and reopen quotes

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 7, 2020, 16:17 UTC
Message-ID
<CAPig+cR+JmQsj9qAALq6oxYQb9E94TAEqXHx+dAt=E0FZH6WwA@mail.gmail.com>
In-Reply-To
<CAN0heSpjgc0GUHnebeBdtr6Yny3Y_jsjz5hTfJqw15bZiPc8HQ@mail.gmail.com>
On Fri, Aug 7, 2020 at 4:45 AM Martin Ågren <martin.agren@gmail.com> wrote:
Show 14 quoted lines
> On Thu, 6 Aug 2020 at 22:26, Eric Sunshine <sunshine@sunshineco.com> wrote:
> > On Thu, Aug 6, 2020 at 4:09 PM Martin Ågren <martin.agren@gmail.com> wrote:
> > > -    echo "$fifth      branch 'fifth' of ." |
> > > +    echo "$fifth      branch fifth of ." |
> >
> > This one is a bit weird. It really seems as if the intent was to quote
> > the word "fifth" in the merge message, so dropping the quotes
> > altogether seems wrong. However, the file 'msg' is never even
> > consulted in this test (or any other test), so is this just "dead
> > code" (including the leading 'fifth=' assignment which also is
> > otherwise unused outside the 'echo')?
>
> Huh, good catch. [...] So I should be able to safely drop this
> "dead code" entirely.

That could be done atop this series if there is no other reason to re-roll.

Show 14 quoted lines
> > > -    git tag -a -m 'annotated' anno HEAD &&
> > > +    git tag -a -m "annotated" anno HEAD &&
> >
> > There are a fair number of these quoted single-token arguments
> > containing no special characters which don't actually need to be
> > quoted at all, so an alternative would be simply to drop the quotes
> > altogether, making the commands less syntactically noisy. However,
> > that might be outside the intended scope of this change.
>
> If we say that "don't use quotes if you don't need to" is a reasonable
> thing to strive for, I can drop these in a reroll. I think I'll be
> injecting a patch anyway for the "msg" you pointed out in t4200, so I
> can certainly tweak this patch to be a bit more aggressive in dropping
> unnecessary quotes.

No need. Matching the local convention makes sense, and I don't insist upon such a change at all. Mine was a non-actionable observation, and it's entirely subjective anyhow.

I don't feel strongly about whether the series should be re-rolled. It's true that dropping that dead code (mentioned above) would make more sense coming before the patch which fixes up the quoting, but it wouldn't bother me if the dead-code removal was done as a follow-on patch.

Previous: Martin ÅgrenNext: Junio C Hamano
Message 9 of 16 in “t1450: fix quoting of NUL byte when corrupting pack”
  1. t1450: fix quoting of NUL byte when corrupting packMartin Ågren, Aug 1, 2020
  2. Junio C HamanoAug 2, 2020
  3. Martin ÅgrenAug 2, 2020
  4. Eric SunshineAug 2, 2020
  5. 0/2 t: don't spuriously close and reopen quotesMartin Ågren, Aug 6, 2020
  6. 1/2 t: don't spuriously close and reopen quotesMartin Ågren, Aug 6, 2020
  7. Eric SunshineAug 6, 2020
  8. Martin ÅgrenAug 7, 2020
  9. Eric SunshineAug 7, 2020
  10. Junio C HamanoAug 7, 2020
  11. 2/2 t4104: modernize and simplify quotingMartin Ågren, Aug 6, 2020
  12. Chris TorekAug 2, 2020
  13. Chris TorekAug 2, 2020
  14. Martin ÅgrenAug 2, 2020
  15. Chris TorekAug 2, 2020
  16. Junio C HamanoAug 2, 2020

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.