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

Re: [GSoC][PATCH] t/t5000-tar-tree: add helper function

From
Kostya Farber <kostya.farber@gmail.com>
Date
Feb 4, 2023, 15:16 UTC
Message-ID
<CAPRQfCZUwaE4mko46n0wQbkKjpg4Tqxbg6eKLm9rFrBRj6sVLg@mail.gmail.com>
In-Reply-To
<CAPig+cR+1bxgitSmJ47PxD=CPxJjMh5Vm+zRdVU8iEo9pvtutw@mail.gmail.com>
On Thu, Feb 2, 2023 at 11:19 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 36 quoted lines
>
> On Thu, Feb 2, 2023 at 6:09 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
> > So, t5000 seems to be one of those relatively rare cases in which the
> > raw "test" command is more correct than the higher-level helper
> > functions.
>
> By the way, although the change made by this patch is probably
> undesirable, if you would like to try a different submission, there is
> a bit of modernization that could be applied to t5000. In particular,
> the "archive and :(glob)" test does not match present-day style
> guidelines:
>
>         git archive -v HEAD -- ":(glob)**/sh" >/dev/null 2>actual &&
>         cat >expect <<EOF &&
>     a/
>     a/bin/
>     a/bin/sh
>     EOF
>         test_cmp expect actual
>
> These days, we would use `<<-EOF` rather than `<<EOF` to allow the
> here-doc body to be indented to the same depth as the `cat` command
> itself. Furthermore, we would use `\EOF` to indicate to the reader
> that no interpolation is expected within the body. Taken together, the
> final result would be:
>
>     git archive -v HEAD -- ":(glob)**/sh" >/dev/null 2>actual &&
>     cat >expect <<-\EOF &&
>     a/
>     a/bin/
>     a/bin/sh
>     EOF
>     test_cmp expect actual
>
> Both cleanups can be done via a single patch; the commit message
> should mention both modernizations.

I would be happy to help and submit another patch for this test based on your observations above. Thanks for the suggestion. I am trying to get used to the development workflow of emailing patches and generally getting familiar with the code base and this seems like a small but important step in the right direction.

Thanks
Previous: Eric SunshineNext: Eric Sunshine
Message 5 of 8 in “t/t5000-tar-tree: add helper function”
  1. Kostya FarberFeb 2, 2023
  2. Junio C HamanoFeb 2, 2023
  3. Eric SunshineFeb 2, 2023
  4. Eric SunshineFeb 2, 2023
  5. Kostya FarberFeb 4, 2023
  6. Eric SunshineFeb 5, 2023
  7. Kostya FarberFeb 4, 2023
  8. Kostya FarberFeb 4, 2023

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.