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

Re: [PATCH] t9811: replace 'test -f' and '! test -f' with 'test_path_*'

From
Patrick Steinhardt <ps@pks.im>
Date
Jul 7, 2026, 14:51 UTC
Message-ID
<ak0ShAvpvnGh1569@pks.im>
In-Reply-To
<CAO=vGZpMe3dxyzFVwR7BWBxaAZ-z9Kw3CqQ0kAe5ZZGSQszkzw@mail.gmail.com>
On Mon, Jul 06, 2026 at 12:00:00PM -0300, Marcelo Machado Lage wrote:
Show 28 quoted lines
> Em sex., 3 de jul. de 2026 às 05:20, Patrick Steinhardt <ps@pks.im> escreveu:
> > On Thu, Jul 02, 2026 at 11:07:04AM -0300, Marcelo Machado Lage wrote:
> > > diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh
> > > index 7614dfbd95..93d6b4c479 100755
> > > --- a/t/t9811-git-p4-label-import.sh
> > > +++ b/t/t9811-git-p4-label-import.sh
> > > @@ -62,9 +62,9 @@ test_expect_success 'basic p4 labels' '
> > >
> > >               cd main &&
> > >               git checkout TAG_F1_ONLY &&
> > > -             ! test -f f2 &&
> > > +             test_path_is_missing f2 &&
> > >               git checkout TAG_WITH\$_SHELL_CHAR &&
> > > -             test -f f1 && test -f f2 && test -f file_with_\$metachar &&
> > > +             test_path_is_file f1 && test_path_is_file f2 && test_path_is_file file_with_\$metachar &&
> >
> > While at it we could split this line into three lines -- it's getting
> > overly long, and we typically don't chain multiple commands on one line
> > nowadays.
> 
> We'll do this for v2 as well and make it into a patch series to
> separate test interface modernization from formatting changes.
> 
> While on this, there are some other places in the file where multiple
> commands in a && chain appear in a single line, e.g. in line 244:
> > p4 edit f2 && date >f2 && p4 submit -d "change" f2 &&
> Should we split these into multiple lines as well, even though they
> are under the 80 characters limit?

Sure, if you want to convert this into a patch series anyway then I think it makes sense to adapt all such locations in this test suite.

Patrick
Previous: Marcelo Machado LageNext: Marcelo Machado Lage
Message 5 of 9 in “t9811: replace 'test -f' and '! test -f' with 'test_path_*'”
  1. t9811: replace 'test -f' and '! test -f' with 'test_path_*'Marcelo Machado Lage, Jul 2, 2026
  2. Patrick SteinhardtJul 3, 2026
  3. Junio C HamanoJul 3, 2026
  4. Marcelo Machado LageJul 6, 2026
  5. Patrick SteinhardtJul 7, 2026
  6. 0/2 t9811: reformat and modernize testsMarcelo Machado Lage, Jul 11, 2026
  7. 1/2 t9811: break long && chains into multiple linesMarcelo Machado Lage, Jul 11, 2026
  8. 2/2 t9811: replace 'test -f' and '! test -f' with 'test_path_*'Marcelo Machado Lage, Jul 11, 2026
  9. Patrick SteinhardtJul 13, 2026

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.