All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Elijah Newren <newren@gmail.com>
Cc: Mooga <contact@m-mooga.com>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [GSoC] microporject test_path_is_*
Date: Wed, 27 Mar 2019 11:09:18 +0100	[thread overview]
Message-ID: <877eckbpdd.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <CABPp-BHwUoqk79Kf=ynna5x+mCJyOLz66v6pDieyEeM7YCRS+g@mail.gmail.com>


On Tue, Mar 26 2019, Elijah Newren wrote:

> Hi,
>
> On Tue, Mar 26, 2019 at 2:10 PM Mooga <contact@m-mooga.com> wrote:
>>
>> Hi,
>> I am still a bit confused about the task itself
>>
>> it’s just text replacing for example:
>> t1400-update-ref.sh , line 194 -> `test_path_is_missing`  has to be ‘test_path_is_file’
>>
>> Thanks
>
> There are several places in the code that use test with -e or -f or -d
> (or -h or...) in order to check for the presence of a
> file/directory/symlink/etc.  For example,
>    test -f path1/file1
> This could be made more clear and produce nicer error messages if it
> were instead
>    test_path_is_file path1/file1

See also the recent thread I started
https://public-inbox.org/git/87sgwav8cp.fsf@evledraar.gmail.com/ asking
if these wrappers were useless now. The consensus was to keep them (a
bunch of use-cases I didn't know about). Useful if you're poking at them
and wondering why we're using this / what it gives us.

> There are likewise several that use one of
>    ! test -e path/to/filename
> or
>    ! test -f path/to/filename
> or
>   test ! -f path/to/filename
> which could be replaced by
>   test_path_is_missing path/to/filename

Interesting that for some we use the 'test_is_there/test_is_not_there'
pattern and for others 'test_is_there [!]'. E.g
test_path_exist/test_path_is_missing v.s. test_i18ngrep.

> This GSoC microproject is just about picking one testfile that has
> some of these constructs, and fixing the cases found within that
> testfile.

  reply	other threads:[~2019-03-27 10:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-26 21:07 [GSoC] microporject test_path_is_* Mooga
2019-03-26 22:06 ` Elijah Newren
2019-03-27 10:09   ` Ævar Arnfjörð Bjarmason [this message]
2019-03-27 10:49     ` SZEDER Gábor
2019-03-27 11:21       ` Ævar Arnfjörð Bjarmason
2019-03-27 12:14         ` SZEDER Gábor
2019-03-27 14:10           ` Ævar Arnfjörð Bjarmason
2019-03-28  9:58             ` SZEDER Gábor
2019-03-27 11:28   ` Mooga

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=877eckbpdd.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=contact@m-mooga.com \
    --cc=git@vger.kernel.org \
    --cc=newren@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.