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

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

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 2, 2023, 23:19 UTC
Message-ID
<CAPig+cR+1bxgitSmJ47PxD=CPxJjMh5Vm+zRdVU8iEo9pvtutw@mail.gmail.com>
In-Reply-To
<CAPig+cTC4TUK2NXFmP6ymEYYjYAmCSd53dzFhKn0ido8x6uh1Q@mail.gmail.com>
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.

Previous: Eric SunshineNext: Kostya Farber
Message 4 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.