git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Vincenzo MEZZELA <vincenzo.mezzela@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [GSOC][RFC] microproject: use test_path_is_* functions in test scripts
Date: Tue, 13 Feb 2024 09:49:46 -0800	[thread overview]
Message-ID: <xmqqy1bo5k5h.fsf@gitster.g> (raw)
In-Reply-To: <cbb450b3-b333-4391-ac83-66c2daf0ae4d@gmail.com> (Vincenzo MEZZELA's message of "Tue, 13 Feb 2024 16:44:52 +0100")

Vincenzo MEZZELA <vincenzo.mezzela@gmail.com> writes:

> Approach:
>
> As far as I understood, The work consists in replacing the shell
> 'test' command in the test
> script under 't/' directory with the ones present in the
> t/test_lib_functions.sh as follows:
>
> - test -f --> test_path_is_file
>
> - test -d --> test_path_is_dir
>
> - test -e --> test_path_exists

One thing to note is that you'd need to make sure if "test -e" for
example originally written really means "we want to see something
there and it does not matter if it is a file or a directory" while
turning it into test_path_exists.  The operations that such a test
follows may be expected to create a file and never a directory, in
which case the condition the original code is testing may need to
be corrected first to expect a more specific type (e.g. "test -f").
The same comment applies for the other two.

Some tests check with "! test -f <path>", which often would want to
be turned into "test_path_is_missing", but you'd need to make sure
that is what the original test really meant to do.

A microproject is not about "doing the real work to help the
project".  It is a practice session to come up with a set of small
changes and explain them well, to send the result to the list to get
reviewed, to respond to reviews and possibly send updates, and to
repeat the cycle until completion.  So most likely you'd pick a
single file or two and do the above conversion, while leaving the
others as practice material for other GSoC participants.

Enjoy.



  parent reply	other threads:[~2024-02-13 17:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 15:44 [GSOC][RFC] microproject: use test_path_is_* functions in test scripts Vincenzo MEZZELA
2024-02-13 17:35 ` Christian Couder
2024-02-13 17:39   ` Eric Sunshine
2024-02-13 17:49 ` Junio C Hamano [this message]
2024-02-14 10:20   ` vincenzo mezzela

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqy1bo5k5h.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=vincenzo.mezzela@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).