All of lore.kernel.org
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Denton Liu <liu.denton@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v4 1/2] format-patch: create leading components of output directory
Date: Fri, 11 Oct 2019 18:17:07 +0200	[thread overview]
Message-ID: <20191011161707.GN29845@szeder.dev> (raw)
In-Reply-To: <CAKPyHN22-SnZ2_o1MO6EXuWk7S2AAWGQSjxu0OrhDq4pw=ap=g@mail.gmail.com>

On Fri, Oct 11, 2019 at 05:47:44PM +0200, Bert Wesarg wrote:
> > > > +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 &&
> 
> one question: How about removing this directory first, just to be
> sure, that mkdir does create a directory?

I'm not sure I understand...

Do you mean that a previous test might have already created and left a
directory with the same name behind, and then this 'mkdir' would error
out and thus fail the test?  If yes, then you're right with your
nitpicking on my nitpicking ;)  Though instead of 'rm -rf'ing that
directory I would suggest 'mkdir -p' to simply ignore it if it were to
exist.


  reply	other threads:[~2019-10-11 16:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <30278644805925935d05ae877c4b14843e37e40c.1570469582.git.bert.wesarg@googlemail.com>
2019-10-11  8:36 ` [PATCH v4 1/2] format-patch: create leading components of output directory Bert Wesarg
2019-10-11  8:36   ` [PATCH v4 2/2] format-patch: configure a command to generate the output directory name Bert Wesarg
2019-10-11 14:46   ` [PATCH v4 1/2] format-patch: create leading components of output directory SZEDER Gábor
2019-10-11 15:45     ` Bert Wesarg
2019-10-11 15:47       ` Bert Wesarg
2019-10-11 16:17         ` SZEDER Gábor [this message]
2019-10-21 10:25 ` [PATCH v5 " Bert Wesarg
2019-10-21 10:25   ` [PATCH v5 2/2] format-patch: configure a command to generate the output directory name Bert Wesarg
2019-10-21 13:20   ` [PATCH v5 1/2] format-patch: create leading components of output directory Bert Wesarg
2019-10-23  2:08     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191011161707.GN29845@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=liu.denton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.