git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincenzo MEZZELA <vincenzo.mezzela@gmail.com>
To: git@vger.kernel.org
Subject: [GSOC][RFC] microproject: use test_path_is_* functions in test scripts
Date: Tue, 13 Feb 2024 16:44:52 +0100	[thread overview]
Message-ID: <cbb450b3-b333-4391-ac83-66c2daf0ae4d@gmail.com> (raw)

Hello everyone,

I'm Vincenzo, a Master's degree student in Computer Engineering and 
Cybersecurity.

As I'm approaching the end of my academic journey, I'm eager to 
contribute to the Git project
and the GSoC represents a good opportunity to do so. Upon exploring the 
online documentation
of git for the application to the GSoC I'm keen to begin the required 
microproject.

Among the microproject proposed here 
https://git.github.io/SoC-2024-Microprojects/ , I would like to
work on replacing 'test -(e|f|g|...)' with test_path_is* .

Can you confirm if this task has already been taken by someone else?


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


To approximately measure the number of required replacement, I run the 
following commands from the
't/' directory (branch master):

> # Files  that requires a replacement
 > git grep -r 'test -[efdx]' 2>/dev/null| awk '{print $1}' | uniq -c | 
sort -n -r
>>    190 t7301-clean-interactive.sh:
>>     147 t7300-clean.sh:
>>      21 t2004-checkout-cache-temp.sh:
>>      17 t2401-worktree-prune.sh:
>>      16 t2003-checkout-cache-mkdir.sh:
>>      14 t0601-reffiles-pack-refs.sh:
>>      13 t4200-rerere.sh:
>>      12 t9146-git-svn-empty-dirs.sh:
>>      12 t7603-merge-reduce-heads.sh:
>>      12 lib-submodule-update.sh:
>>    ...
 >>
 > # Number of replacements
 > git grep -r 'test -[efdx]' 2>/dev/null| awk '{print $1}' | uniq -c | 
sort -n -r | awk '{sum += $1} END {print sum}'
 >> 853
 > # Number of files that requires a patch
 > git grep -r 'test -[efdx]' 2>/dev/null| awk '{print $1}' | uniq -c | 
wc -l
 >> 169

Although the replacement work might not be difficult, it spans over many 
different test files.
Do you want me to submit a patch for each of them as part of the 
microproject?
If not, How many patches do you expect me to submit?

Thanks,
Vincenzo



             reply	other threads:[~2024-02-13 15:44 UTC|newest]

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

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

  git send-email \
    --in-reply-to=cbb450b3-b333-4391-ac83-66c2daf0ae4d@gmail.com \
    --to=vincenzo.mezzela@gmail.com \
    --cc=git@vger.kernel.org \
    /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 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 NNTP newsgroup(s).