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

Re: [PATCH v4 1/2] format-patch: create leading components of output directory

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Oct 11, 2019, 15:45 UTC
Message-ID
<CAKPyHN0s8Rc8Sbp7ubyJ5cTDC5oh4Re+wqyTUWUo+3HgpKfECg@mail.gmail.com>
In-Reply-To
<20191011144650.GM29845@szeder.dev>
On Fri, Oct 11, 2019 at 4:46 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 41 quoted lines
>
> On Fri, Oct 11, 2019 at 10:36:41AM +0200, Bert Wesarg wrote:
> > Changes in v4:
> >  * based on dl/format-patch-doc-test-cleanup and adopt it
>
> Thanks...  but here I am nitpicking again, sorry :)
>
> > diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
> > index 72b09896cf..9facc3a79e 100755
> > --- a/t/t4014-format-patch.sh
> > +++ b/t/t4014-format-patch.sh
> > @@ -1606,6 +1606,29 @@ test_expect_success 'From line has expected format' '
> >       test_cmp from filtered
> >  '
> >
> > +test_expect_success 'format-patch -o with no leading directories' '
> > +     rm -fr patches &&
> > +     git format-patch -o patches master..side &&
> > +     count=$(git rev-list --count master..side) &&
> > +     ls patches >list &&
> > +     test_line_count = $count list
> > +'
> > +
> > +test_expect_success 'format-patch -o with leading existing directories' '
> > +     git format-patch -o patches/side master..side &&
>
> The previous test case creates the 'patches' directory and leaves it
> behind, and this test implicitly relies on that directory to check
> that 'format-patch -o' can deal with already existing directories.  So
> if the previous test case were to fail early or were not run at all
> (e.g. './t4014-format-patch.sh -r 1,137'), then that directory
> wouldn't exist, and, consequently, this test case would not check what
> it was supposed to.
>
> I think it would be better to be more explicit and self-contained
> about it, and create a leading directory in this test case:
>
>    mkdir existing-dir &&
>    git format-patch -o existing-dir/side master..size &&
>    ls existing-dir/side >list &&
>
thanks. Your nitpicking is always appreciated.
Bert
Show 19 quoted lines
> > +     count=$(git rev-list --count master..side) &&
> > +     ls patches/side >list &&
> > +     test_line_count = $count list
> > +'
> > +
> > +test_expect_success 'format-patch -o with leading non-existing directories' '
> > +     rm -fr patches &&
> > +     git format-patch -o patches/side master..side &&
> > +     count=$(git rev-list --count master..side) &&
> > +     ls patches/side >list &&
> > +     test_line_count = $count list
> > +'
> > +
> >  test_expect_success 'format-patch format.outputDirectory option' '
> >       test_config format.outputDirectory patches &&
> >       rm -fr patches &&
> > --
> > 2.23.0.13.g28bc381d7c
> >
Previous: SZEDER GáborNext: Bert Wesarg
Message 4 of 6 in “format-patch: create leading components of output directory”
  1. 1/2 format-patch: create leading components of output directoryBert Wesarg, Oct 11, 2019
  2. 2/2 format-patch: configure a command to generate the output directory nameBert Wesarg, Oct 11, 2019
  3. SZEDER GáborOct 11, 2019
  4. Bert WesargOct 11, 2019
  5. Bert WesargOct 11, 2019
  6. SZEDER GáborOct 11, 2019

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.