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

Re: [PATCH] t2028: tighten grep expression to make "move worktree" test more robust

From
Duy Nguyen <pclouds@gmail.com>
Date
Apr 3, 2018, 15:21 UTC
Message-ID
<CACsJy8DszXXK2htRupg8FhdcSgYweCv4FPAA_ZG23YKGz7AG=Q@mail.gmail.com>
In-Reply-To
<20180403092541.43920-1-sunshine@sunshineco.com>
On Tue, Apr 3, 2018 at 11:25 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 21 quoted lines
> Following a rename of worktree "source" to "destination", the "move
> worktree" test uses grep to verify that the output of "git worktree list
> --porcelain" does not contain "source" (and does contain "destination").
> Unfortunately, the grep expression is too loose and can match
> unexpectedly. For example, if component of the test trash directory path
> matches "source" (e.g. "/home/me/sources/git/t/trash*"), then the test
> will be fooled into thinking that "source" still exists. Tighten the
> expression to avoid such accidental matches.
>
> While at it, drop an unused variable ("toplevel") from the test and
> tighten a similarly too-loose expression in a related test.
>
> Reported-by: Jens Krüger <Jens.Krueger@frm2.tum.de>
> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
> ---
>
> t2028 in 2.17.0 can be fooled into failing depending upon the path of
> the test's trash directory. The problem is with the test being too
> loose, not with Git itself. Problem report and diagnosis here[1].
>
> [1]: https://public-inbox.org/git/26a00c2b-c588-68d5-7085-22310c20e6df@frm2.tum.de/T/#m994cdb29f141656b0ab48dd0d152432c7e86fc20

Thanks both. It was great to scroll to the latest mails and saw that I didn't have to do anything else :)

-- 
Duy
Previous: Eric Sunshine
Message 2 of 2 in “t2028: tighten grep expression to make "move worktree" test more robust”
  1. t2028: tighten grep expression to make "move worktree" test more robustEric Sunshine, Apr 3, 2018
  2. Duy NguyenApr 3, 2018

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.